From e4a4eb0a94a14c2fb5c96d707ed39220f4be9ceb Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 15 Dec 2025 20:06:14 +0000 Subject: [PATCH] ipa: simple: awb: Fix ColourGains reported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AWB gains reported in the metadata are currently scaled against the maximum gain, but in fact the gain itself is already stored as a floating point gain value. Remove the incorrect scaling and report the gains directly. Fixes: a0b97475b1c0 ("ipa: simple: Report the ColourGains in metadata") Signed-off-by: Kieran Bingham Reviewed-by: Milan Zamazal Reviewed-by: Barnabás Pőcze Signed-off-by: Kieran Bingham --- src/ipa/simple/algorithms/awb.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp index cf78e980..0080865a 100644 --- a/src/ipa/simple/algorithms/awb.cpp +++ b/src/ipa/simple/algorithms/awb.cpp @@ -55,10 +55,9 @@ void Awb::process(IPAContext &context, const SwIspStats::Histogram &histogram = stats->yHistogram; const uint8_t blackLevel = context.activeState.blc.level; - const float maxGain = 1024.0; const float mdGains[] = { - static_cast(frameContext.gains.red / maxGain), - static_cast(frameContext.gains.blue / maxGain) + static_cast(frameContext.gains.red), + static_cast(frameContext.gains.blue) }; metadata.set(controls::ColourGains, mdGains);