| Message ID | 20251114-exposure-limits-v3-12-b7c07feba026@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
Quoting Jacopo Mondi (2025-11-14 23:17:07) > The maximum shutter time the AGC algorithm can achieve is, by definition, > limited by the maximum programmed frame duration. > > When configuring the AGC algorithm, use the frame duration to calculate > the maximum shutter time by using the CameraSensorHelper::maxShutterTime() > function, unless the IPA has asked for a fixed exposure by setting min == s/exposure/frame duration/ ? > max. > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/ipa/libipa/exposure_mode_helper.cpp | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > > diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp > index f771b10a28eead2976c0000cf099ba5cfbe78e0f..45f51f9088170c983bb0de2c18714627514c5641 100644 > --- a/src/ipa/libipa/exposure_mode_helper.cpp > +++ b/src/ipa/libipa/exposure_mode_helper.cpp > @@ -127,14 +127,30 @@ ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, dou > void ExposureModeHelper::configure(const SensorConfiguration &sensorConfig, > const CameraSensorHelper *sensorHelper) > { > + ASSERT(sensorHelper); > + > sensor_ = sensorConfig; > sensorHelper_ = sensorHelper; > > /* Initialize run-time limits with sensor's default. */ > - minExposureTime_ = sensor_.minExposureTime_; > - maxExposureTime_ = sensor_.maxExposureTime_; > minGain_ = sensor_.minGain_; > maxGain_ = sensor_.maxGain_; > + > + minExposureTime_ = sensor_.minExposureTime_; > + > + /* > + * Compute the maximum shutter time. > + * > + * If maxExposureTime is equal to minExposureTime then we use them > + * to fix the exposure time. > + * > + * Otherwise, if the exposure can range between a min and max delegate > + * the maximum shutter time calculation to the sensor helper. > + */ > + maxExposureTime_ = minExposureTime_ != sensorConfig.maxExposureTime_ > + ? sensorHelper_->maxShutterTime(sensorConfig.maxFrameDuration_, > + sensorConfig.lineDuration_) > + : minExposureTime_; > } > > /** > > -- > 2.51.1 >
Quoting Paul Elder (2026-02-07 00:31:25) > Quoting Jacopo Mondi (2025-11-14 23:17:07) > > The maximum shutter time the AGC algorithm can achieve is, by definition, > > limited by the maximum programmed frame duration. > > > > When configuring the AGC algorithm, use the frame duration to calculate > > the maximum shutter time by using the CameraSensorHelper::maxShutterTime() > > function, unless the IPA has asked for a fixed exposure by setting min == > > s/exposure/frame duration/ ? oic it's from the IPA not the application, lgtm. Paul > > > max. > > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > > > --- > > src/ipa/libipa/exposure_mode_helper.cpp | 20 ++++++++++++++++++-- > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp > > index f771b10a28eead2976c0000cf099ba5cfbe78e0f..45f51f9088170c983bb0de2c18714627514c5641 100644 > > --- a/src/ipa/libipa/exposure_mode_helper.cpp > > +++ b/src/ipa/libipa/exposure_mode_helper.cpp > > @@ -127,14 +127,30 @@ ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, dou > > void ExposureModeHelper::configure(const SensorConfiguration &sensorConfig, > > const CameraSensorHelper *sensorHelper) > > { > > + ASSERT(sensorHelper); > > + > > sensor_ = sensorConfig; > > sensorHelper_ = sensorHelper; > > > > /* Initialize run-time limits with sensor's default. */ > > - minExposureTime_ = sensor_.minExposureTime_; > > - maxExposureTime_ = sensor_.maxExposureTime_; > > minGain_ = sensor_.minGain_; > > maxGain_ = sensor_.maxGain_; > > + > > + minExposureTime_ = sensor_.minExposureTime_; > > + > > + /* > > + * Compute the maximum shutter time. > > + * > > + * If maxExposureTime is equal to minExposureTime then we use them > > + * to fix the exposure time. > > + * > > + * Otherwise, if the exposure can range between a min and max delegate > > + * the maximum shutter time calculation to the sensor helper. > > + */ > > + maxExposureTime_ = minExposureTime_ != sensorConfig.maxExposureTime_ > > + ? sensorHelper_->maxShutterTime(sensorConfig.maxFrameDuration_, > > + sensorConfig.lineDuration_) > > + : minExposureTime_; > > } > > > > /** > > > > -- > > 2.51.1 > >
diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp index f771b10a28eead2976c0000cf099ba5cfbe78e0f..45f51f9088170c983bb0de2c18714627514c5641 100644 --- a/src/ipa/libipa/exposure_mode_helper.cpp +++ b/src/ipa/libipa/exposure_mode_helper.cpp @@ -127,14 +127,30 @@ ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, dou void ExposureModeHelper::configure(const SensorConfiguration &sensorConfig, const CameraSensorHelper *sensorHelper) { + ASSERT(sensorHelper); + sensor_ = sensorConfig; sensorHelper_ = sensorHelper; /* Initialize run-time limits with sensor's default. */ - minExposureTime_ = sensor_.minExposureTime_; - maxExposureTime_ = sensor_.maxExposureTime_; minGain_ = sensor_.minGain_; maxGain_ = sensor_.maxGain_; + + minExposureTime_ = sensor_.minExposureTime_; + + /* + * Compute the maximum shutter time. + * + * If maxExposureTime is equal to minExposureTime then we use them + * to fix the exposure time. + * + * Otherwise, if the exposure can range between a min and max delegate + * the maximum shutter time calculation to the sensor helper. + */ + maxExposureTime_ = minExposureTime_ != sensorConfig.maxExposureTime_ + ? sensorHelper_->maxShutterTime(sensorConfig.maxFrameDuration_, + sensorConfig.lineDuration_) + : minExposureTime_; } /**
The maximum shutter time the AGC algorithm can achieve is, by definition, limited by the maximum programmed frame duration. When configuring the AGC algorithm, use the frame duration to calculate the maximum shutter time by using the CameraSensorHelper::maxShutterTime() function, unless the IPA has asked for a fixed exposure by setting min == max. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- src/ipa/libipa/exposure_mode_helper.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)