summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/algorithms/agc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/ipu3/algorithms/agc.cpp')
-rw-r--r--src/ipa/ipu3/algorithms/agc.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
index 74bce7bb..61ca8b3f 100644
--- a/src/ipa/ipu3/algorithms/agc.cpp
+++ b/src/ipa/ipu3/algorithms/agc.cpp
@@ -188,14 +188,6 @@ void Agc::filterExposure()
*/
void Agc::computeExposure(IPAFrameContext &frameContext)
{
-
- /* Are we correctly exposed ? */
- if (std::abs(iqMean_ - kEvGainTarget * knumHistogramBins) <= 1) {
- LOG(IPU3Agc, Debug) << "We are well exposed (iqMean = "
- << iqMean_ << ")";
- return;
- }
-
/* Get the effective exposure and gain applied on the sensor. */
uint32_t exposure = frameContext.sensor.exposure;
double analogueGain = frameContext.sensor.gain;
@@ -203,6 +195,12 @@ void Agc::computeExposure(IPAFrameContext &frameContext)
/* Estimate the gain needed to have the proportion wanted */
double evGain = kEvGainTarget * knumHistogramBins / iqMean_;
+ if (std::abs(evGain - 1.0) < 0.01) {
+ LOG(IPU3Agc, Debug) << "We are well exposed (iqMean = "
+ << iqMean_ << ")";
+ return;
+ }
+
/* extracted from Rpi::Agc::computeTargetExposure */
/* Calculate the shutter time in seconds */
utils::Duration currentShutter = exposure * lineDuration_;