summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2021-05-10 10:58:15 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-05-11 03:14:42 +0300
commit99feb66df02988831c9e8535649b99fad9a78069 (patch)
treed5a9447a641cb8dc986f14dfeb549e91a4e941a5 /src/libcamera/pipeline
parenta80db5a72391e8dba60c2dcf20397eb73b379574 (diff)
ipa: raspberrypi: Rate-limit the controller algorithms
The controller algorithms currently run on every frame provided to the IPA by the pipeline handler. This may be undesirable for very fast fps operating modes where it could significantly increase the computation cycles (per unit time) without providing any significant changes to the IQ parameters. The added latencies could also cause dropped frames. Pass the FrameBuffer timestamp to the IPA through the controls. This timestamp will be used to rate-limit the controller algorithms to run with a minimum inter-frame time given by a compile time constant, currently set to 16.66ms. On startup, we don't rate-limit the algorithms until after the number of frames required for convergence. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline')
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 82ae0482..6fbdba04 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -1433,6 +1433,11 @@ void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)
* DelayedControl and queue them along with the frame buffer.
*/
ControlList ctrl = delayedCtrls_->get(buffer->metadata().sequence);
+ /*
+ * Add the frame timestamp to the ControlList for the IPA to use
+ * as it does not receive the FrameBuffer object.
+ */
+ ctrl.set(controls::SensorTimestamp, buffer->metadata().timestamp);
bayerQueue_.push({ buffer, std::move(ctrl) });
} else {
embeddedQueue_.push(buffer);