From patchwork Fri Jul 12 14:32:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20657 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 4B347BD87C for ; Fri, 12 Jul 2024 14:32:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F404D63374; Fri, 12 Jul 2024 16:32:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fQaZENxM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7738563369 for ; Fri, 12 Jul 2024 16:32:44 +0200 (CEST) Received: from ideasonboard.com (unknown [94.31.101.36]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 05B69735; Fri, 12 Jul 2024 16:32:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720794730; bh=D8QQ2O6bD21mRk+8P5ndPfrEC3oD0xcu/FW4WljJd/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQaZENxMSTWdUuNP0H2LDR/FafXOybQiKc4Kfb0QqtXu6xJgPNCNHK//MKu0EIUbI 9Sn9xHjKUcfD9fiWWVNruVAJZxZOOjtdx3TULf5ljFDkxX4A1PWTqGvuFB98xMUqoe Uxexq9thlfUYIsURQ/y2oXNzByKYMFbFtYfdDoc4= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 2/5] ipa rkisp1: Remove temperatureK from FrameContext Date: Fri, 12 Jul 2024 16:32:03 +0200 Message-ID: <20240712143227.3036702-3-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240712143227.3036702-1-stefan.klug@ideasonboard.com> References: <20240712143227.3036702-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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 frame context is used to store data used for processing that frame. It is later used to either act as input for other algorithms or to fill the metadata. For the colour temperature this is not needed, as the meatadata shall not contain the value that was active when the image was processed, but the value that was calculated based on the statistics for that image. This is no functional change. Signed-off-by: Stefan Klug Reviewed-by: Daniel Scally Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/ipa/rkisp1/algorithms/awb.cpp | 7 ++----- src/ipa/rkisp1/ipa_context.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 1a5d4776970a..18f750207793 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -277,7 +277,6 @@ void Awb::process(IPAContext &context, */ if (redMean < kMeanMinThreshold && greenMean < kMeanMinThreshold && blueMean < kMeanMinThreshold) { - frameContext.awb.temperatureK = activeState.awb.temperatureK; return; } @@ -309,21 +308,19 @@ void Awb::process(IPAContext &context, activeState.awb.gains.automatic.blue = blueGain; activeState.awb.gains.automatic.green = 1.0; - frameContext.awb.temperatureK = activeState.awb.temperatureK; - metadata.set(controls::AwbEnable, frameContext.awb.autoEnabled); metadata.set(controls::ColourGains, { static_cast(frameContext.awb.gains.red), static_cast(frameContext.awb.gains.blue) }); - metadata.set(controls::ColourTemperature, frameContext.awb.temperatureK); + metadata.set(controls::ColourTemperature, activeState.awb.temperatureK); LOG(RkISP1Awb, Debug) << std::showpoint << "Means [" << redMean << ", " << greenMean << ", " << blueMean << "], gains [" << activeState.awb.gains.automatic.red << ", " << activeState.awb.gains.automatic.green << ", " << activeState.awb.gains.automatic.blue << "], temp " - << frameContext.awb.temperatureK << "K"; + << activeState.awb.temperatureK << "K"; } REGISTER_IPA_ALGORITHM(Awb, "Awb") diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index 1d0e9030af1c..27a9bf62fc16 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -136,7 +136,6 @@ struct IPAFrameContext : public FrameContext { double blue; } gains; - unsigned int temperatureK; bool autoEnabled; } awb;