From f9c490ab25f38dcaf62da27980dcd8e9f1e53897 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 6 Oct 2022 14:17:37 +0100 Subject: ipa: raspberrypi: Pass lineLength into the CamHelper API Update CamHelper::exposureLines() and CamHelper::exposure() to take a line length duration parameter for use in the exposure calculations. For now, only use the minimum line length for all the calculations to match the existing IPA behavior. Signed-off-by: Naushir Patuck Tested-by: Dave Stevenson Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ipa/raspberrypi/cam_helper.cpp') diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index 42251ba2..fd3527b9 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -61,16 +61,16 @@ void CamHelper::process([[maybe_unused]] StatisticsPtr &stats, { } -uint32_t CamHelper::exposureLines(const Duration exposure) const +uint32_t CamHelper::exposureLines(const Duration exposure, const Duration lineLength) const { assert(initialized_); - return exposure / mode_.minLineLength; + return exposure / lineLength; } -Duration CamHelper::exposure(uint32_t exposureLines) const +Duration CamHelper::exposure(uint32_t exposureLines, const Duration lineLength) const { assert(initialized_); - return exposureLines * mode_.minLineLength; + return exposureLines * lineLength; } uint32_t CamHelper::getVBlanking(Duration &exposure, @@ -78,7 +78,7 @@ uint32_t CamHelper::getVBlanking(Duration &exposure, Duration maxFrameDuration) const { uint32_t frameLengthMin, frameLengthMax, vblank; - uint32_t exposureLines = CamHelper::exposureLines(exposure); + uint32_t exposureLines = CamHelper::exposureLines(exposure, mode_.minLineLength); assert(initialized_); @@ -94,7 +94,7 @@ uint32_t CamHelper::getVBlanking(Duration &exposure, * re-calculate if it has been clipped. */ exposureLines = std::min(frameLengthMax - frameIntegrationDiff_, exposureLines); - exposure = CamHelper::exposure(exposureLines); + exposure = CamHelper::exposure(exposureLines, mode_.minLineLength); /* Limit the vblank to the range allowed by the frame length limits. */ vblank = std::clamp(exposureLines + frameIntegrationDiff_, -- cgit v1.2.1