{"id":15806,"url":"https://patchwork.libcamera.org/api/1.1/patches/15806/?format=json","web_url":"https://patchwork.libcamera.org/patch/15806/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220506051841.70792-4-hpa@redhat.com>","date":"2022-05-06T05:18:41","name":"[libcamera-devel,v2,3/3] ipa: ipu3: awb: Suspend AWB when AF is working","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"0180c3b0dab193d9c2b4bcba0651fdbdfa29ece9","submitter":{"id":105,"url":"https://patchwork.libcamera.org/api/1.1/people/105/?format=json","name":"Kate Hsuan","email":"hpa@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15806/mbox/","series":[{"id":3096,"url":"https://patchwork.libcamera.org/api/1.1/series/3096/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3096","date":"2022-05-06T05:18:38","name":"ipa: ipu3: af: Temporarily suspend AWB during AF scanning","version":2,"mbox":"https://patchwork.libcamera.org/series/3096/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15806/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15806/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CA78EC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 May 2022 05:19:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8C8B665640;\n\tFri,  6 May 2022 07:19:31 +0200 (CEST)","from us-smtp-delivery-74.mimecast.com\n\t(us-smtp-delivery-74.mimecast.com [170.10.129.74])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6489D6563F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 May 2022 07:19:29 +0200 (CEST)","from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n\t[66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-471-br-AjkGxMWGOPtjBw1FSiQ-1; Fri, 06 May 2022 01:19:27 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mimecast-mx02.redhat.com (Postfix) with ESMTPS id 480F03C0CD43;\n\tFri,  6 May 2022 05:19:27 +0000 (UTC)","from fedora.redhat.com (unknown [10.39.192.101])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id C92D22166B17;\n\tFri,  6 May 2022 05:19:24 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1651814371;\n\tbh=C5/uYU927iuwA4pj2bU6uI3pimNAYm1DCPWq50b9Qd4=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Z7U5FxLvWUXATq3E8slzihbL4wZpneqWBqu4kCWtwcSaT8wgHReah3a7Q5cNA3dh6\n\tQz7RVJ+m+rr/vRQulZWuXzt7Refb7IoA28TvcozbcvPBjx0PfBIqfTtW6yjgj/7NjV\n\tXh6pmZFU8B9YClyAPLRxIqwnKLfoyDYFFlRrQb8o++jVF67uGys0n2WjRckLpU4HkT\n\tK+as9Pwc2414+uvq0DmsGaEajsnE9A+Sx01Z/PajAHS1p+Sgoc/0mnybIm1X+1RqXl\n\tBN1cMaGzoImJByktIojfYt5azCf7xrWVfMAmqx7Hf46oGkZepcV2WY4nSEGdFpauyV\n\tGVJOIacAFgjPA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1651814368;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=omsIT3200jmOpd8UmbMKOoQ2PBpF6lw563RcNDag/9M=;\n\tb=gZk6mPb1Dtl6N5otkgZJq6gXdbcIWd5oyDv2GYdPfkFOuvEzQvmXana3Q7wV5WGyTP9hgo\n\tq7awky3RvyX7/ak/TuJ9TGAcpWxf6j2PixOQ3RRHEbY/ykQhxL1CXN8Ap1CuGkNddo1CGC\n\tIYLhItgidMwuviUASur+eXYGe6N1gtQ="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"gZk6mPb1\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com"],"X-MC-Unique":"br-AjkGxMWGOPtjBw1FSiQ-1","To":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>,\n\tHans De Goede <hdegoede@redhat.com>","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","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain; charset=\"US-ASCII\"; x-default=true","Subject":"[libcamera-devel] [PATCH v2 3/3] ipa: ipu3: awb: Suspend AWB when\n\tAF is working","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kate Hsuan via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Kate Hsuan <hpa@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"An unstable AWB results in AF performance degradation. AWB is properly\npaused during AF scanning to improve the accuracy of focus.\n\nSigned-off-by: Kate Hsuan<hpa@redhat.com>\n---\n src/ipa/ipu3/algorithms/awb.cpp | 8 +++++++-\n src/ipa/ipu3/algorithms/awb.h   | 1 +\n 2 files changed, 8 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\nindex 87a6cc7a..3c924fc9 100644\n--- a/src/ipa/ipu3/algorithms/awb.cpp\n+++ b/src/ipa/ipu3/algorithms/awb.cpp\n@@ -384,12 +384,18 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)\n \t}\n }\n \n+bool Awb::isAfStable(IPAContext context)\n+{\n+\treturn context.frameContext.af.stable;\n+}\n+\n /**\n  * \\copydoc libcamera::ipa::Algorithm::process\n  */\n void Awb::process(IPAContext &context, const ipu3_uapi_stats_3a *stats)\n {\n-\tcalculateWBGains(stats);\n+\tif (!isAfStable(context))\n+\t\tcalculateWBGains(stats);\n \n \t/*\n \t * Gains are only recalculated if enough zones were detected.\ndiff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\nindex ab4b0a33..131a51e4 100644\n--- a/src/ipa/ipu3/algorithms/awb.h\n+++ b/src/ipa/ipu3/algorithms/awb.h\n@@ -72,6 +72,7 @@ private:\n \tvoid awbGreyWorld();\n \tuint32_t estimateCCT(double red, double green, double blue);\n \tstatic constexpr uint16_t threshold(float value);\n+\tbool isAfStable(IPAContext context);\n \n \tstd::vector<RGB> zones_;\n \tAccumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];\n","prefixes":["libcamera-devel","v2","3/3"]}