From patchwork Fri May 6 05:18:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15806 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 CA78EC3256 for ; Fri, 6 May 2022 05:19:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C8B665640; Fri, 6 May 2022 07:19:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1651814371; bh=C5/uYU927iuwA4pj2bU6uI3pimNAYm1DCPWq50b9Qd4=; 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=Z7U5FxLvWUXATq3E8slzihbL4wZpneqWBqu4kCWtwcSaT8wgHReah3a7Q5cNA3dh6 Qz7RVJ+m+rr/vRQulZWuXzt7Refb7IoA28TvcozbcvPBjx0PfBIqfTtW6yjgj/7NjV Xh6pmZFU8B9YClyAPLRxIqwnKLfoyDYFFlRrQb8o++jVF67uGys0n2WjRckLpU4HkT K+as9Pwc2414+uvq0DmsGaEajsnE9A+Sx01Z/PajAHS1p+Sgoc/0mnybIm1X+1RqXl BN1cMaGzoImJByktIojfYt5azCf7xrWVfMAmqx7Hf46oGkZepcV2WY4nSEGdFpauyV GVJOIacAFgjPA== Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.129.74]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6489D6563F for ; Fri, 6 May 2022 07:19:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="gZk6mPb1"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651814368; 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=omsIT3200jmOpd8UmbMKOoQ2PBpF6lw563RcNDag/9M=; b=gZk6mPb1Dtl6N5otkgZJq6gXdbcIWd5oyDv2GYdPfkFOuvEzQvmXana3Q7wV5WGyTP9hgo q7awky3RvyX7/ak/TuJ9TGAcpWxf6j2PixOQ3RRHEbY/ykQhxL1CXN8Ap1CuGkNddo1CGC IYLhItgidMwuviUASur+eXYGe6N1gtQ= 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-471-br-AjkGxMWGOPtjBw1FSiQ-1; Fri, 06 May 2022 01:19:27 -0400 X-MC-Unique: br-AjkGxMWGOPtjBw1FSiQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 480F03C0CD43; Fri, 6 May 2022 05:19:27 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id C92D22166B17; Fri, 6 May 2022 05:19:24 +0000 (UTC) To: libcamera devel , Jean-Michel Hautbois , Hans De Goede Date: Fri, 6 May 2022 13:18:41 +0800 Message-Id: <20220506051841.70792-4-hpa@redhat.com> In-Reply-To: <20220506051841.70792-1-hpa@redhat.com> References: <20220506051841.70792-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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 v2 3/3] ipa: ipu3: awb: Suspend AWB when AF is working 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" An unstable AWB results in AF performance degradation. AWB is properly paused during AF scanning to improve the accuracy of focus. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/algorithms/awb.cpp | 8 +++++++- src/ipa/ipu3/algorithms/awb.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp index 87a6cc7a..3c924fc9 100644 --- a/src/ipa/ipu3/algorithms/awb.cpp +++ b/src/ipa/ipu3/algorithms/awb.cpp @@ -384,12 +384,18 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats) } } +bool Awb::isAfStable(IPAContext context) +{ + return context.frameContext.af.stable; +} + /** * \copydoc libcamera::ipa::Algorithm::process */ void Awb::process(IPAContext &context, const ipu3_uapi_stats_3a *stats) { - calculateWBGains(stats); + if (!isAfStable(context)) + calculateWBGains(stats); /* * Gains are only recalculated if enough zones were detected. diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h index ab4b0a33..131a51e4 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 isAfStable(IPAContext context); std::vector zones_; Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];