libipa: agc_mean_luminance: Introduce effectiveYTarget() accessor

The upcoming WDR algorithm needs to know the effective y target (Which
includes the current ExposureValue). Add an accessor for that.

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>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Stefan Klug
2025-09-19 11:40:30 +02:00
committed by Kieran Bingham
parent c7cc1f7f0d
commit 6eb02d6759
2 changed files with 16 additions and 2 deletions

View File

@@ -458,8 +458,7 @@ void AgcMeanLuminance::setLimits(utils::Duration minExposureTime,
*/
double AgcMeanLuminance::estimateInitialGain() const
{
double yTarget = std::min(relativeLuminanceTarget_ * exposureCompensation_,
kMaxRelativeLuminanceTarget);
double yTarget = effectiveYTarget();
double yGain = 1.0;
/*
@@ -521,6 +520,19 @@ double AgcMeanLuminance::constraintClampGain(uint32_t constraintModeIndex,
return gain;
}
/**
* \brief Get the currently effective y target
*
* This function returns the current y target including exposure compensation.
*
* \return The y target value
*/
double AgcMeanLuminance::effectiveYTarget() const
{
return std::min(relativeLuminanceTarget_ * exposureCompensation_,
kMaxRelativeLuminanceTarget);
}
/**
* \brief Apply a filter on the exposure value to limit the speed of changes
* \param[in] exposureValue The target exposure from the AGC algorithm

View File

@@ -72,6 +72,8 @@ public:
calculateNewEv(uint32_t constraintModeIndex, uint32_t exposureModeIndex,
const Histogram &yHist, utils::Duration effectiveExposureValue);
double effectiveYTarget() const;
void resetFrameCount()
{
frameCount_ = 0;