ipa: rkisp1: agc: drop hard-coded analogue gain range
As the sensor's analogue gain range is known (read-out in IPARkISP1::configure()), drop the limiting hard-coded range. This enables better performance in low-light conditions for sensors with a higher gain (e.g. the imx327). Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
e8fccaea46
commit
a3178dd039
1 changed files with 3 additions and 16 deletions
|
@ -36,15 +36,6 @@ namespace ipa::rkisp1::algorithms {
|
||||||
|
|
||||||
LOG_DEFINE_CATEGORY(RkISP1Agc)
|
LOG_DEFINE_CATEGORY(RkISP1Agc)
|
||||||
|
|
||||||
/*
|
|
||||||
* Limits for analogue gain values
|
|
||||||
*
|
|
||||||
* \todo Remove the hard-coded limits and let the sensor helper specify
|
|
||||||
* the minimum and maximum allowed gain values.
|
|
||||||
*/
|
|
||||||
static constexpr double kMinAnalogueGain = 1.0;
|
|
||||||
static constexpr double kMaxAnalogueGain = 16.0;
|
|
||||||
|
|
||||||
/* \todo Honour the FrameDurationLimits control instead of hardcoding a limit */
|
/* \todo Honour the FrameDurationLimits control instead of hardcoding a limit */
|
||||||
static constexpr utils::Duration kMaxShutterSpeed = 60ms;
|
static constexpr utils::Duration kMaxShutterSpeed = 60ms;
|
||||||
|
|
||||||
|
@ -80,9 +71,7 @@ Agc::Agc()
|
||||||
int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)
|
int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)
|
||||||
{
|
{
|
||||||
/* Configure the default exposure and gain. */
|
/* Configure the default exposure and gain. */
|
||||||
context.activeState.agc.automatic.gain =
|
context.activeState.agc.automatic.gain = context.configuration.sensor.minAnalogueGain;
|
||||||
std::max(context.configuration.sensor.minAnalogueGain,
|
|
||||||
kMinAnalogueGain);
|
|
||||||
context.activeState.agc.automatic.exposure =
|
context.activeState.agc.automatic.exposure =
|
||||||
10ms / context.configuration.sensor.lineDuration;
|
10ms / context.configuration.sensor.lineDuration;
|
||||||
context.activeState.agc.manual.gain = context.activeState.agc.automatic.gain;
|
context.activeState.agc.manual.gain = context.activeState.agc.automatic.gain;
|
||||||
|
@ -265,10 +254,8 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext,
|
||||||
utils::Duration maxShutterSpeed = std::min(configuration.sensor.maxShutterSpeed,
|
utils::Duration maxShutterSpeed = std::min(configuration.sensor.maxShutterSpeed,
|
||||||
kMaxShutterSpeed);
|
kMaxShutterSpeed);
|
||||||
|
|
||||||
double minAnalogueGain = std::max(configuration.sensor.minAnalogueGain,
|
double minAnalogueGain = configuration.sensor.minAnalogueGain;
|
||||||
kMinAnalogueGain);
|
double maxAnalogueGain = configuration.sensor.maxAnalogueGain;
|
||||||
double maxAnalogueGain = std::min(configuration.sensor.maxAnalogueGain,
|
|
||||||
kMaxAnalogueGain);
|
|
||||||
|
|
||||||
/* Consider within 1% of the target as correctly exposed. */
|
/* Consider within 1% of the target as correctly exposed. */
|
||||||
if (utils::abs_diff(evGain, 1.0) < 0.01)
|
if (utils::abs_diff(evGain, 1.0) < 0.01)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue