@@ -128,8 +128,6 @@ int Agc::configure(IPAContext &context,
/* \todo Update AGC limits when FrameDurationLimits is passed in */
- resetFrameCount();
-
return 0;
}
@@ -171,9 +171,10 @@ static constexpr double kMaxRelativeLuminanceTarget = 0.95;
*
* IPA modules that want to use this class to implement their AEGC algorithm
* should derive it and provide an overriding estimateLuminance() function for
- * this class to use. They must call parseTuningData() in init(), and must also
- * call resetFrameCounter() in configure(). They may then use calculateNewEv()
- * in process(). To update the algorithm limits for example, in response to a
+ * this class to use. They must call parseTuningData() in init() and the use the
+ * sensor configuration data to call AgcMeanLuminance::configure() in their
+ * configure() implementation. They may then use calculateNewEv() in process().
+ * To update the algorithm limits for example, in response to a
* FrameDurationLimit control being passed in queueRequest()) then
* setExposureLimits() must be called with the new values.
*/
@@ -379,6 +380,8 @@ void AgcMeanLuminance::configure(const SensorConfiguration &config,
helper->configure(sensorConfig, sensorHelper);
}
+
+ resetFrameCount();
}
/**
@@ -692,16 +695,6 @@ AgcMeanLuminance::calculateNewEv(uint32_t constraintModeIndex,
return exposureModeHelper->splitExposure(newExposureValue);
}
-/**
- * \fn AgcMeanLuminance::resetFrameCount()
- * \brief Reset the frame counter
- *
- * This function resets the internal frame counter, which exists to help the
- * algorithm decide whether it should respond instantly or not. The expectation
- * is for derived classes to call this function before each camera start call in
- * their configure() function.
- */
-
} /* namespace ipa */
} /* namespace libcamera */
@@ -87,11 +87,6 @@ public:
double effectiveYTarget() const;
- void resetFrameCount()
- {
- frameCount_ = 0;
- }
-
private:
virtual double estimateLuminance(const double gain) const = 0;
@@ -104,6 +99,10 @@ private:
const Histogram &hist,
double gain);
utils::Duration filterExposure(utils::Duration exposureValue);
+ void resetFrameCount()
+ {
+ frameCount_ = 0;
+ }
double exposureCompensation_;
uint64_t frameCount_;
@@ -186,8 +186,6 @@ int Agc::configure(IPAContext &context,
/* \todo Update AGC limits when FrameDurationLimits is passed in */
- resetFrameCount();
-
return 0;
}
@@ -213,8 +213,6 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)
context.activeState.agc.automatic.yTarget = effectiveYTarget();
- resetFrameCount();
-
return 0;
}
The AgcMeanLuminance::resetFrameCount() function has to be called after a call to AgcMeanLuminance::configure(). As the two calls always happen one after another, do not require each IPA implementation to do that but fold instead the call to resetFrameCount() in AgcMeanLuminance::configure(). Update the AgcMeanLuminance class documentation accordingly. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- src/ipa/ipu3/algorithms/agc.cpp | 2 -- src/ipa/libipa/agc_mean_luminance.cpp | 19 ++++++------------- src/ipa/libipa/agc_mean_luminance.h | 9 ++++----- src/ipa/mali-c55/algorithms/agc.cpp | 2 -- src/ipa/rkisp1/algorithms/agc.cpp | 2 -- 5 files changed, 10 insertions(+), 24 deletions(-)