libcamera/src
Stefan Klug eb550486c7 ipa: libipa: Fix bug in ExposureModeHelper that leads to oscillations in AEGC
The ExposureModeHelper::splitExposures() runs through the configured
stages to find the best gain/exposure time pair. It first raises the
exposure time until it reaches the limit of the current stage. Then it
raises the gain until that also reaches the limit of the current stage.
After that it continues with the next stage until a match is found.

Due to a slight mistake in the initial code, the second step doesn't
work as expected because the exposure time gets divided by the gain of
the current stage, effectively leading to a jump of the gain value from
the maximum gain of the last stage to the maximum gain of the current
stage instead of gradually increasing the gain value.

Depending on the tuning file this leads to very visible oscillations and
jumps in the brightness.

Fix by clamping the exposure time in the second step to the maximum
exposure time of the current stage.

While at it, add two comments for easier understanding.

Fixes: 34c9ab6282 ("ipa: libipa: Add ExposureModeHelper")
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-02-28 10:00:51 +01:00
..
android meson: Don't unnecessarily fallback to libyuv wrap 2024-11-26 19:05:17 +02:00
apps apps: lc-compliance: Merge CaptureBalanced and CaptureUnbalanced 2025-02-27 17:31:04 +01:00
gstreamer gstreamer: Fix scaler-crop property get 2025-02-17 18:59:22 +02:00
ipa ipa: libipa: Fix bug in ExposureModeHelper that leads to oscillations in AEGC 2025-02-28 10:00:51 +01:00
libcamera libcamera: base: log: Avoid manual LogCategory deletion 2025-02-27 11:30:23 +01:00
py utils: codegen: controls.py: Parse direction information 2024-12-18 17:26:52 +09:00
v4l2 meson: Convert v4l2 into a feature option 2025-01-10 12:35:10 +01:00
meson.build meson: Don't unnecessarily fallback to libyuv wrap 2024-11-26 19:05:17 +02:00