[libcamera-devel] [PATCH v2] ipa: ipu3: agc: Clamp shutter speed
Jean-Michel Hautbois
jeanmichel.hautbois at ideasonboard.com
Tue Oct 26 13:27:50 CEST 2021
In case the maximum exposure received from the sensor is very high, we
can have a very high shutter speed with a small analogue gain, and it
may result in very slow framerate. We are not really supporting it for
the moment, so clamp the shutter speed to an arbitrary value of 60ms.
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
Tested-by: Umang Jain <umang.jain at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
v2:
- Reword the todo according to Laurent's comment
---
src/ipa/ipu3/algorithms/agc.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
index 6c151232..6b4ba4bf 100644
--- a/src/ipa/ipu3/algorithms/agc.cpp
+++ b/src/ipa/ipu3/algorithms/agc.cpp
@@ -34,6 +34,9 @@ static constexpr uint32_t kFrameSkipCount = 6;
static constexpr double kMinAnalogueGain = 1.0;
static constexpr double kMaxAnalogueGain = 8.0;
+/* \todo Honour the FrameDurationLimits control instead of hardcoding a limit */
+static constexpr utils::Duration kMaxShutterSpeed = 60ms;
+
/* Histogram constants */
static constexpr uint32_t knumHistogramBins = 256;
static constexpr double kEvGainTarget = 0.5;
@@ -54,7 +57,8 @@ int Agc::configure(IPAContext &context, const IPAConfigInfo &configInfo)
/* \todo replace the exposure in lines storage with time based ones. */
minExposureLines_ = context.configuration.agc.minShutterSpeed / lineDuration_;
- maxExposureLines_ = context.configuration.agc.maxShutterSpeed / lineDuration_;
+ maxExposureLines_ = std::min(context.configuration.agc.maxShutterSpeed / lineDuration_,
+ kMaxShutterSpeed / lineDuration_);
minAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);
maxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);
--
2.32.0
More information about the libcamera-devel
mailing list