diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-22 01:47:31 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-11-09 23:43:57 +0200 |
commit | 00b650b6b813230eb328742c560236aa43465134 (patch) | |
tree | 089d02ae454dd8765de0c2ea5b72780ae09ba938 /src/ipa/rkisp1/algorithms | |
parent | 02bc2a8a24baaff82d1c5f8cb5d9ab7d1afab426 (diff) |
ipa: rkisp1: Move shutter speed and analogue gain limits from agc to sensor
The limits for the shutter speed and analogue gain are stored in
IPASessionConfiguration::agc. While they're related to the AGC, they are
properties of the sensor, and are stored in the session configuration by
the IPA module, not the AGC algorithm. Move them to the
IPASessionConfiguration::sensor structure where they belong.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/ipa/rkisp1/algorithms')
-rw-r--r-- | src/ipa/rkisp1/algorithms/agc.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 11613d1c..dba58c90 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -74,7 +74,8 @@ Agc::Agc() int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) { /* Configure the default exposure and gain. */ - context.activeState.agc.gain = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain); + context.activeState.agc.gain = std::max(context.configuration.sensor.minAnalogueGain, + kMinAnalogueGain); context.activeState.agc.exposure = 10ms / context.configuration.sensor.lineDuration; /* @@ -202,13 +203,13 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext, /* Use the highest of the two gain estimates. */ double evGain = std::max(yGain, iqMeanGain); - utils::Duration minShutterSpeed = configuration.agc.minShutterSpeed; - utils::Duration maxShutterSpeed = std::min(configuration.agc.maxShutterSpeed, + utils::Duration minShutterSpeed = configuration.sensor.minShutterSpeed; + utils::Duration maxShutterSpeed = std::min(configuration.sensor.maxShutterSpeed, kMaxShutterSpeed); - double minAnalogueGain = std::max(configuration.agc.minAnalogueGain, + double minAnalogueGain = std::max(configuration.sensor.minAnalogueGain, kMinAnalogueGain); - double maxAnalogueGain = std::min(configuration.agc.maxAnalogueGain, + double maxAnalogueGain = std::min(configuration.sensor.maxAnalogueGain, kMaxAnalogueGain); /* Consider within 1% of the target as correctly exposed. */ |