[libcamera-devel,RFC,v4,0/1] ipa: ipu3: af: Auto focus for dw9719 Surface Go2 VCM
mbox series

Message ID 20211213122847.26260-1-hpa@redhat.com
Headers show
Series
  • ipa: ipu3: af: Auto focus for dw9719 Surface Go2 VCM
Related show

Message

Kate Hsuan Dec. 13, 2021, 12:28 p.m. UTC
In v4, a two-pass AF searching scheme is proposed to reduce the searching
time and improve the focus quality. In the beginning, the AF searching step is
10 so an approximate AF range can be found and pass this small AF range
to pass two search. In pass two, the searching step is reduced to 1 so
the variance of every step in this range can be tested and find the local
maximum variance. Eventually, the focus step with the largest variance
is the focused lens position.

To reduce the searching time, since we only can find the largest
variance for a given image, if a negative gradient is found, the
searching can be terminated immediately to eliminate the unnecessary
searching and reducing the searching time.

IPU3 AF accelerator provides low pass and high pass filtered convolution
results. This information can be used to perform coarse and fine searches
for the focused image. Low pass convolution results are used for coarse
search and the high pass filtered convolution results are used for fine
search. Through these convolution results, the quality of a focused image
is also improved.

Kate Hsuan (1):
  ipa: ipu3: af: Auto focus for dw9719 Surface Go2 VCM

 src/ipa/ipu3/algorithms/af.cpp      | 334 ++++++++++++++++++++++++++++
 src/ipa/ipu3/algorithms/af.h        |  66 ++++++
 src/ipa/ipu3/algorithms/meson.build |   3 +-
 src/ipa/ipu3/ipa_context.cpp        |  27 +++
 src/ipa/ipu3/ipa_context.h          |  11 +
 src/ipa/ipu3/ipu3.cpp               |   2 +
 6 files changed, 442 insertions(+), 1 deletion(-)
 create mode 100644 src/ipa/ipu3/algorithms/af.cpp
 create mode 100644 src/ipa/ipu3/algorithms/af.h