From 4bb284e0fa5669bbf6adda93e2f770014834c8cb Mon Sep 17 00:00:00 2001 From: Jean-Michel Hautbois Date: Wed, 15 Jun 2022 16:57:43 +0200 Subject: ipa: ipu3: awb: Correct the gains calculation The factor used right now in the IPU3 is 8192, as a multiplier of the estimated gain. This is wrong, as the isp is adding 1.0 to the gain applied, ie Pout = { Pin * (1 + Gx) }. Fix it, and to ease the reading, introduce a small helper function. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/ipa/ipu3/algorithms/awb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ipa/ipu3/algorithms/awb.h') diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h index 9a50a985..0acd2148 100644 --- a/src/ipa/ipu3/algorithms/awb.h +++ b/src/ipa/ipu3/algorithms/awb.h @@ -73,6 +73,7 @@ private: void awbGreyWorld(); uint32_t estimateCCT(double red, double green, double blue); static constexpr uint16_t threshold(float value); + static constexpr uint16_t gainValue(double gain); std::vector zones_; Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY]; -- cgit v1.2.1