summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/ipu3.cpp
diff options
context:
space:
mode:
authorKate Hsuan <hpa@redhat.com>2022-02-14 17:51:36 +0800
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-03-15 17:20:50 +0000
commitb608984e78824f8738a089136721b1fe54016248 (patch)
treed24e8665930783f9a90be20274a880412c565d05 /src/ipa/ipu3/ipu3.cpp
parente41854a4e6fde2dd9e2a2a7290670943235776cd (diff)
ipa: ipu3: af: Auto focus for dw9719 Surface Go2 VCM
Since VCM for surface Go 2 (dw9719) had been successfully driven, this Af module can be used to control the VCM and determine the focus value based on the IPU3 AF state. Based on the values from the IPU3 AF buffer, the variance of each focus step is determined and a greedy approach is used to find the maximum variance of the AF state and an appropriate focus value. The grid configuration is implemented as a context. Also, the grid parameter- AF_MIN_BLOCK_WIDTH is set to 4 (default is 3) since if the default value is used, x_start (x_start > 640) will be at an incorrect location of the image (rightmost of the sensor). Signed-off-by: Kate Hsuan <hpa@redhat.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/ipu3.cpp')
-rw-r--r--src/ipa/ipu3/ipu3.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index 17324616..1c4ff2d7 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -30,6 +30,7 @@
#include "libcamera/internal/mapped_framebuffer.h"
+#include "algorithms/af.h"
#include "algorithms/agc.h"
#include "algorithms/algorithm.h"
#include "algorithms/awb.h"
@@ -297,6 +298,7 @@ int IPAIPU3::init(const IPASettings &settings,
context_.configuration.sensor.lineDuration = sensorInfo.lineLength * 1.0s / sensorInfo.pixelRate;
/* Construct our Algorithms */
+ algorithms_.push_back(std::make_unique<algorithms::Af>());
algorithms_.push_back(std::make_unique<algorithms::Agc>());
algorithms_.push_back(std::make_unique<algorithms::Awb>());
algorithms_.push_back(std::make_unique<algorithms::BlackLevelCorrection>());