From patchwork Wed Apr 13 07:43:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15664 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 925E7C3256 for ; Wed, 13 Apr 2022 07:44:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9D91D65644; Wed, 13 Apr 2022 09:44:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1649835846; bh=dBiMZV3k56Dn9enXmHnmqPsDcIiwWVZwchnuR//9SEQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=QO8x34S7IuNSRIxHSf7IjXPdVtYj79obR9llmaCRKUVdA8GzjZWDj2P7ApbZvcGGp /JF0p8DzKvBEH/BITh0ulWLpBpBJTnzQ5QtpiBOLjH/tE7uog/H50HoAwwoXHqQmy+ ELrJDpcton2h4YOyIrGj3VXMVW+jZQOhj447lmbdenUFf4hok5FETRThha+0w6kS+b a5+BDRqK8BUV/iWdALw/lsgUROnOGbBdcER+5ba4d+txVj2QfEDDf6Fexs9T/7YM0J U5OXNiy5HNuKAOl8gojhspu403PB1jEZ7BemlKj1zIkIGZvKBCFg2wjP5ESphw8n/+ 8jWBqTSvtBEwg== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A7F5604B3 for ; Wed, 13 Apr 2022 09:44:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="aD/+kTkR"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649835844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFv5vxaePNTIqBLGtESy2zXBs9+ci/TnETOTe2XWoT4=; b=aD/+kTkRXsQn+BeYbNHkFJRks7WrU/k6t2i0haBFK5ccNVtOr/KPKtq6rSW7qZoI1gTjGZ riDBJmawrzisLyw4jEQbiJGIZ8KtvEB2IcQqeubcnkXVezpIPv5bOeQr4c8LGayVbRIdfl Z2uVaA5cyXZnkOwmRtBX8/8PcK+r6Bw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-34-Ro2-M2p9MPKm-oJci-7YyQ-1; Wed, 13 Apr 2022 03:44:02 -0400 X-MC-Unique: Ro2-M2p9MPKm-oJci-7YyQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1CA27804195 for ; Wed, 13 Apr 2022 07:44:02 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.194.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7645E42B925; Wed, 13 Apr 2022 07:43:59 +0000 (UTC) To: libcamera devel Date: Wed, 13 Apr 2022 15:43:53 +0800 Message-Id: <20220413074353.13147-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized frame ignore counter fixing X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kate Hsuan via libcamera-devel From: Kate Hsuan Reply-To: Kate Hsuan Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" A not initialized frame ignore counter (ignoreCounter_) makes the AF function not work since the ignore counter may start from a random negative number. The counter was set to kIgnoreFrame when AF is in prepare stage. Signed-off-by: Kate Hsuan Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- src/ipa/ipu3/algorithms/af.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index addf98af..f700b01f 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -181,6 +181,9 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo) /* Initial max focus step */ maxStep_ = kMaxFocusSteps; + /* Initial frame ignore counter */ + afIgnoreFrameReset(); + /* Initial focus value */ context.frameContext.af.focus = 0; /* Maximum variance of the AF statistics */