summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/awb.h
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2022-06-15 16:57:43 +0200
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2022-06-18 18:31:49 +0200
commit4bb284e0fa5669bbf6adda93e2f770014834c8cb (patch)
treed6172e2f8be8197f16d12d985b8c09f71d98d2d2 /src/ipa/ipu3/algorithms/awb.h
parentd2c097c4828e15821b6d14b101f2d627f2371c39 (diff)
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 <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/awb.h')
-rw-r--r--src/ipa/ipu3/algorithms/awb.h1
1 files changed, 1 insertions, 0 deletions
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<RGB> zones_;
Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];