[libcamera-devel,v2,11/11] ipa: rkisp1: af: Skip one frame after changing the AF window
diff mbox series

Message ID 20220713084317.24268-12-dse@thaumatec.com
State Superseded
Headers show
Series
  • ipa: rkisp1: Add autofocus algorithm
Related show

Commit Message

Daniel Semkowicz July 13, 2022, 8:43 a.m. UTC
Drop the first frame after the window change was requested to guarantee
that sharpness level was calculated for the new window.

Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
---
 src/ipa/rkisp1/algorithms/af.cpp | 1 +
 src/ipa/rkisp1/algorithms/af.h   | 1 +
 2 files changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/af.cpp b/src/ipa/rkisp1/algorithms/af.cpp
index a0d914e0..e2769e69 100644
--- a/src/ipa/rkisp1/algorithms/af.cpp
+++ b/src/ipa/rkisp1/algorithms/af.cpp
@@ -128,6 +128,7 @@  void Af::updateCurrentWindow(const Rectangle &window)
 {
 	currentWindow_ = window;
 	updateAfwindow_ = true;
+	setFramesToSkip(kWindowWaitFrames);
 }
 
 REGISTER_IPA_ALGORITHM(Af, "Af")
diff --git a/src/ipa/rkisp1/algorithms/af.h b/src/ipa/rkisp1/algorithms/af.h
index 36d0c9b0..b2da4890 100644
--- a/src/ipa/rkisp1/algorithms/af.h
+++ b/src/ipa/rkisp1/algorithms/af.h
@@ -38,6 +38,7 @@  private:
 	bool updateAfwindow_ = false;
 
 	static constexpr uint32_t kFLensWaitFrames = 2;
+	static constexpr uint32_t kWindowWaitFrames = 1;
 };
 
 } /* namespace libcamera::ipa::rkisp1::algorithms */