mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-12 23:09:45 +03:00
ipa: rkisp1: Alias lineDuration
The configured line duration of the sensor is used frequently throughout the AGC implementation. It's available in the IPA context through the rather long: context.configuration.sensor.lineDuration Take a copy of the lineDuration early in the call and replace the two current usages of the reference with the shorter copy to manage line length and ease readibility. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
parent
443ac36e12
commit
2abfcac1c3
1 changed files with 4 additions and 4 deletions
|
@ -470,6 +470,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const utils::Duration &lineDuration = context.configuration.sensor.lineDuration;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \todo Verify that the exposure and gain applied by the sensor for
|
* \todo Verify that the exposure and gain applied by the sensor for
|
||||||
* this frame match what has been requested. This isn't a hard
|
* this frame match what has been requested. This isn't a hard
|
||||||
|
@ -519,8 +521,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
|
||||||
* The Agc algorithm needs to know the effective exposure value that was
|
* The Agc algorithm needs to know the effective exposure value that was
|
||||||
* applied to the sensor when the statistics were collected.
|
* applied to the sensor when the statistics were collected.
|
||||||
*/
|
*/
|
||||||
utils::Duration exposureTime = context.configuration.sensor.lineDuration
|
utils::Duration exposureTime = lineDuration * frameContext.sensor.exposure;
|
||||||
* frameContext.sensor.exposure;
|
|
||||||
double analogueGain = frameContext.sensor.gain;
|
double analogueGain = frameContext.sensor.gain;
|
||||||
utils::Duration effectiveExposureValue = exposureTime * analogueGain;
|
utils::Duration effectiveExposureValue = exposureTime * analogueGain;
|
||||||
|
|
||||||
|
@ -537,8 +538,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
|
||||||
|
|
||||||
IPAActiveState &activeState = context.activeState;
|
IPAActiveState &activeState = context.activeState;
|
||||||
/* Update the estimated exposure and gain. */
|
/* Update the estimated exposure and gain. */
|
||||||
activeState.agc.automatic.exposure = newExposureTime
|
activeState.agc.automatic.exposure = newExposureTime / lineDuration;
|
||||||
/ context.configuration.sensor.lineDuration;
|
|
||||||
activeState.agc.automatic.gain = aGain;
|
activeState.agc.automatic.gain = aGain;
|
||||||
|
|
||||||
fillMetadata(context, frameContext, metadata);
|
fillMetadata(context, frameContext, metadata);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue