summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/agc.cpp
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-10-21 07:52:33 +0200
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-10-22 07:30:18 +0200
commitf1cf01d13b729f0f6efeef07012605577f31ee69 (patch)
tree1d440cef8e2fa686d47eba5203b34c7b98524343 /src/ipa/ipu3/algorithms/agc.cpp
parenta58a784e53f4c350a912aa36a1103ee2f259aedb (diff)
ipa: ipu3: agc: Use filtered exposure values
We are filtering the exposure value to limit the gain to apply, but we are not using the result. Fix it. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/agc.cpp')
-rw-r--r--src/ipa/ipu3/algorithms/agc.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
index 984aed53..f5bb3328 100644
--- a/src/ipa/ipu3/algorithms/agc.cpp
+++ b/src/ipa/ipu3/algorithms/agc.cpp
@@ -158,17 +158,17 @@ void Agc::lockExposureGain(uint32_t &exposure, double &gain)
utils::Duration newExposure = 0.0s;
if (currentShutter < maxShutterSpeed) {
- exposure = std::clamp<uint32_t>(exposure * currentExposure_ / currentExposureNoDg_,
+ exposure = std::clamp<uint32_t>(exposure * filteredExposure_ / currentExposureNoDg_,
minExposureLines_,
maxExposureLines_);
- newExposure = currentExposure_ / exposure;
- gain = std::clamp(gain * currentExposure_ / newExposure,
+ newExposure = filteredExposure_ / exposure;
+ gain = std::clamp(gain * filteredExposure_ / newExposure,
kMinGain, kMaxGain);
} else {
- gain = std::clamp(gain * currentExposure_ / currentExposureNoDg_,
+ gain = std::clamp(gain * filteredExposure_ / currentExposureNoDg_,
kMinGain, kMaxGain);
- newExposure = currentExposure_ / gain;
- exposure = std::clamp<uint32_t>(exposure * currentExposure_ / newExposure,
+ newExposure = filteredExposure_ / gain;
+ exposure = std::clamp<uint32_t>(exposure * filteredExposure_ / newExposure,
minExposureLines_,
maxExposureLines_);
}