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_imx296.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/ipa/raspberrypi/cam_helper_imx296.cpp') diff --git a/src/ipa/raspberrypi/cam_helper_imx296.cpp b/src/ipa/raspberrypi/cam_helper_imx296.cpp index 66d21e36..d86ff387 100644 --- a/src/ipa/raspberrypi/cam_helper_imx296.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp @@ -21,8 +21,8 @@ public: CamHelperImx296(); uint32_t gainCode(double gain) const override; double gain(uint32_t gainCode) const override; - uint32_t exposureLines(Duration exposure) const override; - Duration exposure(uint32_t exposureLines) const override; + uint32_t exposureLines(const Duration exposure, const Duration lineLength) const override; + Duration exposure(uint32_t exposureLines, const Duration lineLength) const override; void getDelays(int &exposureDelay, int &gainDelay, int &vblankDelay) const override; private: @@ -53,12 +53,14 @@ double CamHelperImx296::gain(uint32_t gainCode) const return std::pow(10.0, gainCode / 200.0); } -uint32_t CamHelperImx296::exposureLines(Duration exposure) const +uint32_t CamHelperImx296::exposureLines(const Duration exposure, + [[maybe_unused]] const Duration lineLength) const { return std::max(minExposureLines, (exposure - 14.26us) / timePerLine); } -Duration CamHelperImx296::exposure(uint32_t exposureLines) const +Duration CamHelperImx296::exposure(uint32_t exposureLines, + [[maybe_unused]] const Duration lineLength) const { return std::max(minExposureLines, exposureLines) * timePerLine + 14.26us; } -- cgit v1.2.1