From patchwork Mon Jun 28 20:22:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 12739 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 841C0C321F for ; Mon, 28 Jun 2021 20:23:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 24372684EA; Mon, 28 Jun 2021 22:23:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RXsaMKMn"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 83C63684D8 for ; Mon, 28 Jun 2021 22:23:00 +0200 (CEST) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:c3ad:78d0:405e:fc33]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2D0532469; Mon, 28 Jun 2021 22:23:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1624911780; bh=Y0h3Bcoe7Rnm7xKKbZTDs4vuo3agSQr8boF6ViMbg+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RXsaMKMn1ZMG66pWpwa8eP43kQAqJATB1+WD8fJylrqYaURtvgxPPfhAahOOp04RV 6hbKgD+qcPusAWiHZE05/Rskzjx1IrgMR6Xryc0XMNVsQERDfv4+vNOkIf7Vy39Alm i5N9+30SbKEngChQXazNiVDgrnN4XM3U6P1nLLU0= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Jun 2021 22:22:52 +0200 Message-Id: <20210628202255.138874-5-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628202255.138874-1-jeanmichel.hautbois@ideasonboard.com> References: <20210628202255.138874-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 4/7] ipa: ipu3: use process method for all algorithms 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The main goal will be to have the same process() prototype for all algorithms, each of them would then grab the values needed using a metadata exchange way (for instance, current analogue gain, shutter time, or red/blue gains calculated in the AWB algorithm from AGC, etc.). Signed-off-by: Jean-Michel Hautbois --- src/ipa/ipu3/ipu3.cpp | 2 +- src/ipa/ipu3/ipu3_awb.cpp | 5 +++++ src/ipa/ipu3/ipu3_awb.h | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index f43f8620..4466391a 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -296,7 +296,7 @@ void IPAIPU3::parseStatistics(unsigned int frame, agcAlgo_->process(stats, exposure_, gain); gain_ = camHelper_->gainCode(gain); - awbAlgo_->calculateWBGains(stats); + awbAlgo_->process(stats); if (agcAlgo_->updateControls()) setControls(frame); diff --git a/src/ipa/ipu3/ipu3_awb.cpp b/src/ipa/ipu3/ipu3_awb.cpp index 9b409c8f..a94935c5 100644 --- a/src/ipa/ipu3/ipu3_awb.cpp +++ b/src/ipa/ipu3/ipu3_awb.cpp @@ -351,6 +351,11 @@ void IPU3Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats) } } +void IPU3Awb::process(const ipu3_uapi_stats_3a *stats) +{ + calculateWBGains(stats); +} + void IPU3Awb::updateWbParameters(ipu3_uapi_params ¶ms, double agcGamma) { /* diff --git a/src/ipa/ipu3/ipu3_awb.h b/src/ipa/ipu3/ipu3_awb.h index f4100f4a..795e32e3 100644 --- a/src/ipa/ipu3/ipu3_awb.h +++ b/src/ipa/ipu3/ipu3_awb.h @@ -33,7 +33,7 @@ public: ~IPU3Awb(); void initialise(ipu3_uapi_params ¶ms, const Size &bdsOutputSize, struct ipu3_uapi_grid_config &bdsGrid); - void calculateWBGains(const ipu3_uapi_stats_3a *stats); + void process(const ipu3_uapi_stats_3a *stats); void updateWbParameters(ipu3_uapi_params ¶ms, double agcGamma); private: @@ -42,6 +42,7 @@ private: void clearAwbStats(); void awbGreyWorld(); uint32_t estimateCCT(double red, double green, double blue); + void calculateWBGains(const ipu3_uapi_stats_3a *stats); struct ipu3_uapi_grid_config awbGrid_;