diff --git a/src/ipa/simple/algorithms/agc.cpp b/src/ipa/simple/algorithms/agc.cpp index 189de770..2f7e040c 100644 --- a/src/ipa/simple/algorithms/agc.cpp +++ b/src/ipa/simple/algorithms/agc.cpp @@ -100,7 +100,7 @@ void Agc::updateExposure(IPAContext &context, IPAFrameContext &frameContext, dou } void Agc::process(IPAContext &context, - const uint32_t frame, + [[maybe_unused]] const uint32_t frame, IPAFrameContext &frameContext, const SwIspStats *stats, ControlList &metadata) @@ -110,13 +110,14 @@ void Agc::process(IPAContext &context, metadata.set(controls::ExposureTime, exposureTime.get()); metadata.set(controls::AnalogueGain, frameContext.sensor.gain); - if (frame == 0) { + if (!context.activeState.agc.valid) { /* * Init active-state from sensor values in case updateExposure() * does not run for the first frame. */ context.activeState.agc.exposure = frameContext.sensor.exposure; context.activeState.agc.again = frameContext.sensor.gain; + context.activeState.agc.valid = true; } if (!stats->valid) { diff --git a/src/ipa/simple/ipa_context.h b/src/ipa/simple/ipa_context.h index c3081e30..26b60fb6 100644 --- a/src/ipa/simple/ipa_context.h +++ b/src/ipa/simple/ipa_context.h @@ -40,6 +40,7 @@ struct IPAActiveState { struct { int32_t exposure; double again; + bool valid; } agc; struct {