diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2022-10-06 14:17:37 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-18 03:09:44 +0300 |
commit | f9c490ab25f38dcaf62da27980dcd8e9f1e53897 (patch) | |
tree | bd37a36e377cbf693f56d2f04f1ae98ba969c321 /src/ipa/raspberrypi/cam_helper_imx296.cpp | |
parent | c513522f3f5b9e3cb091cf7dfd249376b4171bfe (diff) |
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 <naush@raspberrypi.com>
Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/cam_helper_imx296.cpp')
-rw-r--r-- | src/ipa/raspberrypi/cam_helper_imx296.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<uint32_t>(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<uint32_t>(minExposureLines, exposureLines) * timePerLine + 14.26us; } |