[libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized frame ignore counter fixing

Kate Hsuan hpa at redhat.com
Wed Apr 13 10:31:03 CEST 2022


Hi Umang,

On Wed, Apr 13, 2022 at 4:20 PM Umang Jain <umang.jain at ideasonboard.com> wrote:
>
> Hello,
>
> On 4/13/22 13:13, Kate Hsuan via libcamera-devel wrote:
> > A not initialized frame ignore counter (ignoreCounter_) makes the AF
> > function not work since the ignore counter may start from a random
> > negative number. The counter was set to kIgnoreFrame when AF is in
> > prepare stage.
> >
> > Signed-off-by: Kate Hsuan<hpa at redhat.com>
> > ---
> >   src/ipa/ipu3/algorithms/af.cpp | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp
> > index addf98af..f700b01f 100644
> > --- a/src/ipa/ipu3/algorithms/af.cpp
> > +++ b/src/ipa/ipu3/algorithms/af.cpp
> > @@ -181,6 +181,9 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)
> >       /* Initial max focus step */
> >       maxStep_ = kMaxFocusSteps;
> >
> > +     /* Initial frame ignore counter */
> > +     afIgnoreFrameReset();
> > +
>
>
> ... wondering if afReset() makes more sense here?

afReset first checks the ignore counter and then resets all the
variables. I think it can't be used here. :)

>
> >       /* Initial focus value */
> >       context.frameContext.af.focus = 0;
> >       /* Maximum variance of the AF statistics */
>


-- 
BR,
Kate



More information about the libcamera-devel mailing list