summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/agc.h
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-04 10:58:07 +0100
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-11-15 11:00:05 +0100
commitf8f07f9468c6618b73710e3d341ce59ce08ccc08 (patch)
tree811f88b2a4e226e6edb6efc17a7e34f026f7c085 /src/ipa/ipu3/algorithms/agc.h
parent3d81620b20e853650d2baadab1b7b8bdc82c94d5 (diff)
ipa: ipu3: agc: Improve gain calculation
When an image is partially saturated, its brightness is not increasing linearly when the shutter time or gain increases. It is a big issue with a backlight as the algorithm is fading to darkness right now. Introduce a function to estimate the brightness of the frame, based on the current exposure/gain and loop on it several times to estimate it again and approach the non linear function. Inspired-by: 7de5506c30b3 ("libcamera: src: ipa: raspberrypi: agc: Improve gain update calculation for partly saturated images") Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/agc.h')
-rw-r--r--src/ipa/ipu3/algorithms/agc.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h
index 99c60d46..8f99dab9 100644
--- a/src/ipa/ipu3/algorithms/agc.h
+++ b/src/ipa/ipu3/algorithms/agc.h
@@ -34,7 +34,11 @@ private:
void measureBrightness(const ipu3_uapi_stats_3a *stats,
const ipu3_uapi_grid_config &grid);
void filterExposure();
- void computeExposure(IPAFrameContext &frameContext);
+ void computeExposure(IPAFrameContext &frameContext, double currentYGain);
+ double computeInitialY(IPAFrameContext &frameContext,
+ const ipu3_uapi_grid_config &grid,
+ const ipu3_uapi_stats_3a *stats,
+ double currentYGain);
uint64_t frameCount_;