summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/cam_helper.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-10-06 14:17:37 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-10-18 03:09:44 +0300
commitf9c490ab25f38dcaf62da27980dcd8e9f1e53897 (patch)
treebd37a36e377cbf693f56d2f04f1ae98ba969c321 /src/ipa/raspberrypi/cam_helper.cpp
parentc513522f3f5b9e3cb091cf7dfd249376b4171bfe (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.cpp')
-rw-r--r--src/ipa/raspberrypi/cam_helper.cpp12
1 files changed, 6 insertions, 6 deletions
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_,