From patchwork Tue Mar 22 02:41:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15495 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 D4F0EC0F1B for ; Tue, 22 Mar 2022 02:42:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8AF4E61FBD; Tue, 22 Mar 2022 03:42:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647916944; bh=AyorgNFcvMPZMiAqo+E01o0z4Y9E8VtL9fb1qPyhsHc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ufPcLhqysId0R1Cs1xtOclWoTEs0h3h2dQcDPz+B5zkLUOCp2g2XqoKGt4GYNZFDO 3EP1UC437VdYxokrrybC9ex6AwSLXawIrQVlI4U/rTH4kXuMkXQnn3URNPUR1UYksS kbbRe1OfifqGGPTUH2BGnuCGDluxExSZIuvMx9pMUw6aLDt3gD3q186o3Uf5A/YvS9 ljdBZoOTIin1UczxZQpIVUsgXGMAWcZiPD3JIHGsHIKD1UIeUpm25erFbEnh07jw67 ZDvU21NopuqUWTUhAj5LbS1JU02wDntJGwgcOc10+Fd4jcFth8i1dcvE49bUu+kyo7 V4Dn8ep+ZgGtA== 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 5F2F2604DB for ; Tue, 22 Mar 2022 03:42:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="QUQ02fHc"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647916942; 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: in-reply-to:in-reply-to:references:references; bh=eqQ98mKECq3Lt3koxQsSb8ZcOY2ca4TbRpxnx4YyeSI=; b=QUQ02fHcUsUivFEb3tYmGmnAIzy5FNXBJ4ImKEjfag0Dd1rZ9Ti+v8EV7RnFO9pwnNi54f me8w5LSknIP9pUXoibtZ7XvVyAODP2qlcPbWH409EsjoovrRr/BLddD6xqYcKi+jJNzoB9 Ewo3lPLuphKf9Qmw7CoATpejFHnCjOE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-542-Dp7vfjLZMpOxMUG8qwo3UA-1; Mon, 21 Mar 2022 22:42:21 -0400 X-MC-Unique: Dp7vfjLZMpOxMUG8qwo3UA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E630B3803908 for ; Tue, 22 Mar 2022 02:42:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30B82C26E9D; Tue, 22 Mar 2022 02:42:18 +0000 (UTC) To: libcamera devel Date: Tue, 22 Mar 2022 10:41:54 +0800 Message-Id: <20220322024155.6528-4-hpa@redhat.com> In-Reply-To: <20220322024155.6528-1-hpa@redhat.com> References: <20220322024155.6528-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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 3/4] ipa: ipu3: awb: AWB lock for AF scan 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" When the AF starts to perform the scan, AWB will be suspended to stabilize the AF scene variance and improve the AF performance. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/algorithms/awb.cpp | 13 +++++++++++++ src/ipa/ipu3/algorithms/awb.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp index 87a6cc7a..328bd38d 100644 --- a/src/ipa/ipu3/algorithms/awb.cpp +++ b/src/ipa/ipu3/algorithms/awb.cpp @@ -384,11 +384,24 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats) } } +/** + * \brief Test the AF requested lock is exist. + */ +bool Awb::isAfRequestedLock(IPAContext context) +{ + if (context.configuration.af.requireAeAwbLock) + return true; + else + return false; +} + /** * \copydoc libcamera::ipa::Algorithm::process */ void Awb::process(IPAContext &context, const ipu3_uapi_stats_3a *stats) { + if (isAfRequestedLock(context)) + return; calculateWBGains(stats); /* diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h index ab4b0a33..9673592f 100644 --- a/src/ipa/ipu3/algorithms/awb.h +++ b/src/ipa/ipu3/algorithms/awb.h @@ -72,6 +72,7 @@ private: void awbGreyWorld(); uint32_t estimateCCT(double red, double green, double blue); static constexpr uint16_t threshold(float value); + bool isAfRequestedLock(IPAContext context); std::vector zones_; Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];