[{"id":22685,"web_url":"https://patchwork.libcamera.org/comment/22685/","msgid":"<164983740567.22830.14678343265273950202@Monstersaurus>","date":"2022-04-13T08:10:05","subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Kate Hsuan via libcamera-devel (2022-04-13 08:43:53)\n> A not initialized frame ignore counter (ignoreCounter_) makes the AF\n> function not work since the ignore counter may start from a random\n> negative number. The counter was set to kIgnoreFrame when AF is in\n> prepare stage.\n> \n> Signed-off-by: Kate Hsuan<hpa@redhat.com>\n> ---\n>  src/ipa/ipu3/algorithms/af.cpp | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> index addf98af..f700b01f 100644\n> --- a/src/ipa/ipu3/algorithms/af.cpp\n> +++ b/src/ipa/ipu3/algorithms/af.cpp\n> @@ -181,6 +181,9 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n>         /* Initial max focus step */\n>         maxStep_ = kMaxFocusSteps;\n>  \n> +       /* Initial frame ignore counter */\n> +       afIgnoreFrameReset();\n> +\n\nShould this be handled by the constructor at all? (I suspect it doesn't\nneed to if the data is not accessed before the algorithm is running) Or\nis there any requirement to reset the counter when a stream off, stream\non cycle occurs (without a reconfigure in between?)\n\nAssuming those are fine...\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n>         /* Initial focus value */\n>         context.frameContext.af.focus = 0;\n>         /* Maximum variance of the AF statistics */\n> -- \n> 2.35.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DD5D5C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Apr 2022 08:10:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CACBF65645;\n\tWed, 13 Apr 2022 10:10:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C84336563E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Apr 2022 10:10:08 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4190C25B;\n\tWed, 13 Apr 2022 10:10:08 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649837410;\n\tbh=SkWqVdLy6nBR9I4O+tM+K3GTZvTOaWFy4+qeD+3uPzM=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=UWqlXer2hMhNZn3wx2ikpGxT6TrZOg8E6pHC0z2E3SA+gFiyNW8qlXyYNa5SmCe6k\n\tx3HVLZSLY15Xm94RaOxjh2Auyg6TWWS7O0xqqJEqKLPsOfgtKMzcGF53I5mB13Iyun\n\th9lHP6KCz44uZrdtZlxz7vzRrsi0svBRGGitGvGbTITJZj7Ti5TTDxLXZRmZ+FhXof\n\tl3m9vugTE1dFFEiy2OnxXOYrtu+OlP1E3f5Q8LiQlZyfoJ9aCNXk48KqUfx02y6+Nk\n\ttf8ZzbOfJ7BCx20Lo0o2LGHvy7L3WzEMNM6ac/cqeSbWqQscEWNVdvrnVBz93tWYZo\n\tGqjhI9RV8yFxw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649837408;\n\tbh=SkWqVdLy6nBR9I4O+tM+K3GTZvTOaWFy4+qeD+3uPzM=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=mmI8hYrshnuhfbpLzSBxZETLuSy2Ldp2U/+Ru6blKOmX0gH7u3xLFRfdb3SJe2PsH\n\tIaRsKj04OEZE0NjZ7TlHgIn7N+sNHVjbON+R/Vl0BbzRBMe4lg08gKld6y6uG/SyVh\n\t37JwD8jvWPSITJJ5pMegzcCOgwtH48s5qEyZwfKQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"mmI8hYrs\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220413074353.13147-1-hpa@redhat.com>","References":"<20220413074353.13147-1-hpa@redhat.com>","To":"Kate Hsuan <hpa@redhat.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Wed, 13 Apr 2022 09:10:05 +0100","Message-ID":"<164983740567.22830.14678343265273950202@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22686,"web_url":"https://patchwork.libcamera.org/comment/22686/","msgid":"<5c7e7600-ba2d-e564-6fe3-edb382ae2df0@ideasonboard.com>","date":"2022-04-13T08:11:42","subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hello,\n\nOn 4/13/22 13:13, Kate Hsuan via libcamera-devel wrote:\n> A not initialized frame ignore counter (ignoreCounter_) makes the AF\n> function not work since the ignore counter may start from a random\n> negative number. The counter was set to kIgnoreFrame when AF is in\n> prepare stage.\n>\n> Signed-off-by: Kate Hsuan<hpa@redhat.com>\n> ---\n>   src/ipa/ipu3/algorithms/af.cpp | 3 +++\n>   1 file changed, 3 insertions(+)\n>\n> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> index addf98af..f700b01f 100644\n> --- a/src/ipa/ipu3/algorithms/af.cpp\n> +++ b/src/ipa/ipu3/algorithms/af.cpp\n> @@ -181,6 +181,9 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n>   \t/* Initial max focus step */\n>   \tmaxStep_ = kMaxFocusSteps;\n>   \n> +\t/* Initial frame ignore counter */\n> +\tafIgnoreFrameReset();\n> +\n\n\n... wondering if afReset() makes more sense here?\n\n>   \t/* Initial focus value */\n>   \tcontext.frameContext.af.focus = 0;\n>   \t/* Maximum variance of the AF statistics */","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 16B01C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Apr 2022 08:11:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A77A165645;\n\tWed, 13 Apr 2022 10:11:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 77B006563E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Apr 2022 10:11:48 +0200 (CEST)","from [IPV6:2401:4900:1f3e:5b41:7dc9:ad59:fa84:68bf] (unknown\n\t[IPv6:2401:4900:1f3e:5b41:7dc9:ad59:fa84:68bf])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A8A9E25B;\n\tWed, 13 Apr 2022 10:11:47 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649837509;\n\tbh=cJMf3s9/h9+MfkSSLvBoryqYn1dBUbq3emv7cL/Glq8=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Udj2KS3hjhb5VuWORRf/Zch4fpG0I9Ap1F8tvMqinxlsaFnZBSsFT/D5D+Wk55HTh\n\tRtqi0MTBp/+PV2O4vHpZdFELPCmAd02RzgvClpvhFneXpRODpyUsZCuvlfDUAud6cd\n\tU+mM3S8yk4t2M069d2QTBSpPNJUfmhU2sDCVjTJfMQyBZH14LYsTi5y8LrJJmg3XAp\n\tcvs1uQTkS+yCTEx4uaIeJfUICOHw+8r56K8+lgs7tbfhGq/Vys3AV7ksLLXkweAhrT\n\tu1aMar+wTxG6iOplJmNPpoGu51K04kFk3M6RcrxIhZwEc6IYmAC1FiCCvCqvx6gYEi\n\tYvGCkxdCFMMYQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649837508;\n\tbh=cJMf3s9/h9+MfkSSLvBoryqYn1dBUbq3emv7cL/Glq8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=IxB5D0bU4o08bQrZ4s/Bg6mtsgd+l0KOdJ3b2GvP7SMssTxuyvfjkrwQ/oY74S3ye\n\tKZBNFbhm7qia7pd26H4aGPMoeDDSOyMCpSX/CgADjymE9S5qT8qrzRrInDK6QEFIx3\n\t7Gu0ix17kB7df/ETDaL2sUmfd8XU6P7hzQvmHUXc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"IxB5D0bU\"; dkim-atps=neutral","Message-ID":"<5c7e7600-ba2d-e564-6fe3-edb382ae2df0@ideasonboard.com>","Date":"Wed, 13 Apr 2022 13:41:42 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Kate Hsuan <hpa@redhat.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>","References":"<20220413074353.13147-1-hpa@redhat.com>","In-Reply-To":"<20220413074353.13147-1-hpa@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22687,"web_url":"https://patchwork.libcamera.org/comment/22687/","msgid":"<CAEth8oFzt6nGfa+_qSekyr7WUAYfH0ijLG1a_939TZsqGsSoaA@mail.gmail.com>","date":"2022-04-13T08:31:03","subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","submitter":{"id":105,"url":"https://patchwork.libcamera.org/api/people/105/","name":"Kate Hsuan","email":"hpa@redhat.com"},"content":"Hi Umang,\n\nOn Wed, Apr 13, 2022 at 4:20 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\n> Hello,\n>\n> On 4/13/22 13:13, Kate Hsuan via libcamera-devel wrote:\n> > A not initialized frame ignore counter (ignoreCounter_) makes the AF\n> > function not work since the ignore counter may start from a random\n> > negative number. The counter was set to kIgnoreFrame when AF is in\n> > prepare stage.\n> >\n> > Signed-off-by: Kate Hsuan<hpa@redhat.com>\n> > ---\n> >   src/ipa/ipu3/algorithms/af.cpp | 3 +++\n> >   1 file changed, 3 insertions(+)\n> >\n> > diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> > index addf98af..f700b01f 100644\n> > --- a/src/ipa/ipu3/algorithms/af.cpp\n> > +++ b/src/ipa/ipu3/algorithms/af.cpp\n> > @@ -181,6 +181,9 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n> >       /* Initial max focus step */\n> >       maxStep_ = kMaxFocusSteps;\n> >\n> > +     /* Initial frame ignore counter */\n> > +     afIgnoreFrameReset();\n> > +\n>\n>\n> ... wondering if afReset() makes more sense here?\n\nafReset first checks the ignore counter and then resets all the\nvariables. I think it can't be used here. :)\n\n>\n> >       /* Initial focus value */\n> >       context.frameContext.af.focus = 0;\n> >       /* Maximum variance of the AF statistics */\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1CD65C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Apr 2022 08:31:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 645E86563E;\n\tWed, 13 Apr 2022 10:31:20 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0735D604B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Apr 2022 10:31:18 +0200 (CEST)","from mail-lj1-f197.google.com (mail-lj1-f197.google.com\n\t[209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-202-4dj_I-WFMg6ROma_t3ED4g-1; Wed, 13 Apr 2022 04:31:16 -0400","by mail-lj1-f197.google.com with SMTP id\n\tk19-20020a2ea273000000b0024b63166774so217166ljm.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Apr 2022 01:31:16 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649838680;\n\tbh=orDdtNjR3w+/PLcdosLOYreOxOeW577Mheh16xULeVI=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=3s9Nz9YGJBHSSNjfuXyyRavfjAyDeOQwSRk2vKQv5T1NayTg0wpybMEmIOwTzXKVb\n\tp0Mn8tpxc9zVDry8MoQr1sjGSrtUHKTKRk+dpSeAfUkAREvlkhFJtFMilUIqM+ODKM\n\tAS5LdBq00yDdfs3GwRSSpkIt3nGrGoqudGgBau6/PZrRr2krWdhWUa2m8s7DYzISJ2\n\t4W5C+8nySwCFie1zAx1C20M1U2NDlxR5M+3Ug1GUevCxpbP5xhFpbGmtubDUMYO4Qs\n\teqQm/kfmMnxYMpQbKUd1rDMRum3/okJT5PBE87BZ3NwQ7QGCVHFdIpRIXP2gt2FU1C\n\tETbXZQ3ic6khQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1649838677;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=LAGNZbaRbFiCg07ilTxtz90Fu92oyMTxnzkuwmlZfhE=;\n\tb=TcQWuE0L3PFOk6UVdzkI1aG9/NCHhbJKdILO2QwF4ynBdStGyohNQUw5kTXk+9YdSJ+wGL\n\tk0FvdvqCCnyitQAjQKlKzN8cuTWDClDEjJzDlZ/s5Xsg50OErFJrIqtMwqN1KUJK3LqtBe\n\tvUYmthVKttwQVrrZWWjWEM6U3OeJYl8="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"TcQWuE0L\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com"],"X-MC-Unique":"4dj_I-WFMg6ROma_t3ED4g-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=LAGNZbaRbFiCg07ilTxtz90Fu92oyMTxnzkuwmlZfhE=;\n\tb=vih7XTzPe4cBJJHV2nrsyeT/XrTzbAxwpCB55XAprFb3xN+bym0DdJpEGTTAOICebp\n\tdFWlQyS3eEdPQ8Ye3IXqLG/EtEXmWB1646Uw5HIJWmNDrnqrTUBd9KdslTQgBHzxNoYW\n\tfjmCJWXeJw922H0G9sWOmkQvdKBAeCFDTl6Xg/Sq0jgfM6dPRUMWNurM+DsFdH+9Hko+\n\tPA0Qd5dM0DwGlL/K5S/XKiwF4rEG28nyamJOzsOeJzqacJEmrDfDfECJjRuuRX3SPKpi\n\tW8Vo07nPLPgXJ3i6t0kGLkXNCg4zjx71vkaLFnKUVGvggfA6qkeiKdcQCP2ydOWdpuk4\n\tg+OQ==","X-Gm-Message-State":"AOAM531E1XChifyy00HZ/J7XHX7fMKueBgnL5eRdbPwGCrnWKIYUgSpO\n\tSq+Y/Ih0vEu4TZjd6+qWV17yeJhvfHGyH1eHJZYqq8nR2zHpxB9tduDyr+ehjByG2M7IPNvqUmb\n\t8BHOgL8wS7Bcfdp/tKi8YA3OZl5ZTvqMWGJ4V6c7dVhM4KPmnPA==","X-Received":["by 2002:a05:6512:260d:b0:448:35d2:f72a with SMTP id\n\tbt13-20020a056512260d00b0044835d2f72amr28104437lfb.515.1649838675041; \n\tWed, 13 Apr 2022 01:31:15 -0700 (PDT)","by 2002:a05:6512:260d:b0:448:35d2:f72a with SMTP id\n\tbt13-20020a056512260d00b0044835d2f72amr28104421lfb.515.1649838674639;\n\tWed, 13 Apr 2022 01:31:14 -0700 (PDT)"],"X-Google-Smtp-Source":"ABdhPJw67uqGD2lblQuJQKxE+eXG5avCxnRKK+RNXziL8CAXxwq4eoVnye596HLfAD9eq4nuwJWZSKHcHxvpfijJgp8=","MIME-Version":"1.0","References":"<20220413074353.13147-1-hpa@redhat.com>\n\t<5c7e7600-ba2d-e564-6fe3-edb382ae2df0@ideasonboard.com>","In-Reply-To":"<5c7e7600-ba2d-e564-6fe3-edb382ae2df0@ideasonboard.com>","Date":"Wed, 13 Apr 2022 16:31:03 +0800","Message-ID":"<CAEth8oFzt6nGfa+_qSekyr7WUAYfH0ijLG1a_939TZsqGsSoaA@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kate Hsuan via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Kate Hsuan <hpa@redhat.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22688,"web_url":"https://patchwork.libcamera.org/comment/22688/","msgid":"<CAEth8oFpOZLyVDbcWcoMV-Pyqb98KxcH1NkSYf6==-qf9UmS9Q@mail.gmail.com>","date":"2022-04-13T08:39:58","subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","submitter":{"id":105,"url":"https://patchwork.libcamera.org/api/people/105/","name":"Kate Hsuan","email":"hpa@redhat.com"},"content":"Hi Kieran,\n\nOn Wed, Apr 13, 2022 at 4:10 PM Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting Kate Hsuan via libcamera-devel (2022-04-13 08:43:53)\n> > A not initialized frame ignore counter (ignoreCounter_) makes the AF\n> > function not work since the ignore counter may start from a random\n> > negative number. The counter was set to kIgnoreFrame when AF is in\n> > prepare stage.\n> >\n> > Signed-off-by: Kate Hsuan<hpa@redhat.com>\n> > ---\n> >  src/ipa/ipu3/algorithms/af.cpp | 3 +++\n> >  1 file changed, 3 insertions(+)\n> >\n> > diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> > index addf98af..f700b01f 100644\n> > --- a/src/ipa/ipu3/algorithms/af.cpp\n> > +++ b/src/ipa/ipu3/algorithms/af.cpp\n> > @@ -181,6 +181,9 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n> >         /* Initial max focus step */\n> >         maxStep_ = kMaxFocusSteps;\n> >\n> > +       /* Initial frame ignore counter */\n> > +       afIgnoreFrameReset();\n> > +\n>\n> Should this be handled by the constructor at all? (I suspect it doesn't\n> need to if the data is not accessed before the algorithm is running) Or\n> is there any requirement to reset the counter when a stream off, stream\n> on cycle occurs (without a reconfigure in between?)\n\nThose places are good to initialize the counter. We only have to make\nsure the counter will not be a negative number.\nFor stream on, the counter could be reset since it makes more time to\nstable the image status, such as AE and AWB.\n\nThank you :)\n>\n> Assuming those are fine...\n>\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n>\n> >         /* Initial focus value */\n> >         context.frameContext.af.focus = 0;\n> >         /* Maximum variance of the AF statistics */\n> > --\n> > 2.35.1\n> >\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 35800C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Apr 2022 08:40:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 75F8665644;\n\tWed, 13 Apr 2022 10:40:16 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7DE52604B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Apr 2022 10:40:14 +0200 (CEST)","from mail-lf1-f72.google.com (mail-lf1-f72.google.com\n\t[209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-502-tHMLkLaiMPW-en7d4A7hRQ-1; Wed, 13 Apr 2022 04:40:12 -0400","by mail-lf1-f72.google.com with SMTP id\n\tk11-20020a05651239cb00b0046bbe5d500eso636910lfu.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Apr 2022 01:40:11 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649839216;\n\tbh=muw+AEaM69GJ0RzFg1pciIhjnZvSa5A/xwkNBmUGUf4=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=opj4cpK0QwQaJL3Ymnb9foPQL+knyHUzUuAjO8ENwPz2ZbxoxkXtwKH3UoWkwzzCg\n\td6hDsm7sCPBS6PxxHiQY0v5lBRYH3npkW6iPTHr6Ak564vG5lYk/WZbIaVgOB43Ue1\n\tn9CJ3wjQGkdjqAqw7ks0zXU6Pvm+ejTPSZUQLvDrDYcml7YVFHZSaA9kswDegpGj5O\n\tT5Y6nRyMzEA18qfxq7eBc+EuwDM2RN6U/bI/zIjMh78Ng8XliCv4ULSD68fNOP3ZGh\n\trGWdZlJ96HMMdyP502uMJP/udO+8JVY+L37q7xYAhWPRucJDLb5yFJsyVWgvaJZzwQ\n\tupVFtH/f/WKHw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1649839213;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=yiX5Pjp/pTC7JwzdeHDe0scVKYnlXvh/Adk6zCzKQM4=;\n\tb=Pv8W+oJma8/Oj1CBIRr0gFUiv75N/cxKwmYJ0oaJ7fo99kZIFMf5CE7incCxRjcf5NepIc\n\tenXa1CJjfrIVilPfjX+A5Fl5y9/J3R8UzYsT3AVzkYGAd+x2qcxOVQYXM94MdvylgxsJei\n\txnNledPLUuHO8M/v0JpsV35MDnppx68="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"Pv8W+oJm\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com"],"X-MC-Unique":"tHMLkLaiMPW-en7d4A7hRQ-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=yiX5Pjp/pTC7JwzdeHDe0scVKYnlXvh/Adk6zCzKQM4=;\n\tb=nNP52RMHGVXZI9Dyg9rzZZ7AIjLSTjdl1CQJM1SydEyoVZWk/9JNbuwqRE0uippcZ8\n\t5zjadvK7KY3oGJeM2uOAGNuP4X3/m6BtcO9MbwH4D4xh5F2kvlUFcZAR8BFmJAt6v1Nb\n\tJ8ORCKGmOXzWPP4C9QPotyLQWDuYnGL1M2RpbCkNvNBqwDFCe+TpUBLJKutrSYICMPcQ\n\ti0l7WqbdUZ5fH4wvtlMqw8TLPp8BBVnW6Hu02folH5N4InVjimBnKGOVAvhPGpA5eU/Y\n\tt01fyl2AuMT0dmeWzeKbHlWVbSpiy0PobphJhzSD2P6km6waBhNyE6LIY0Hr5YQH4Edv\n\tk0og==","X-Gm-Message-State":"AOAM5334EIXZUPEZZf9LtjsCIG7mdctTUgpFtBfEVIllUM7XAg4+dUJ1\n\tQqkpEwDGEWSf8Z4XYJ7dDOoA19ODUJhoi802X/KvhWkfzJXZ+8w5NdYeMmMOcEcFuVRuoZBBOQC\n\tyvOh4oHkDOF25cSUK4Kx2PH7kL/SCZW4d9xJa3hBbOePhd8KmIA==","X-Received":["by 2002:a05:6512:3f8c:b0:45d:cb2a:8779 with SMTP id\n\tx12-20020a0565123f8c00b0045dcb2a8779mr28551858lfa.499.1649839210478; \n\tWed, 13 Apr 2022 01:40:10 -0700 (PDT)","by 2002:a05:6512:3f8c:b0:45d:cb2a:8779 with SMTP id\n\tx12-20020a0565123f8c00b0045dcb2a8779mr28551843lfa.499.1649839210168;\n\tWed, 13 Apr 2022 01:40:10 -0700 (PDT)"],"X-Google-Smtp-Source":"ABdhPJyND2DPokzGGB7TZcyl57NfBUqX2wBx/SFlMC2/7HYCbq9Boq3ZsXhjeP5L75dM6eC/wHanUIGLq+vCRuQW3iY=","MIME-Version":"1.0","References":"<20220413074353.13147-1-hpa@redhat.com>\n\t<164983740567.22830.14678343265273950202@Monstersaurus>","In-Reply-To":"<164983740567.22830.14678343265273950202@Monstersaurus>","Date":"Wed, 13 Apr 2022 16:39:58 +0800","Message-ID":"<CAEth8oFpOZLyVDbcWcoMV-Pyqb98KxcH1NkSYf6==-qf9UmS9Q@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kate Hsuan via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Kate Hsuan <hpa@redhat.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22689,"web_url":"https://patchwork.libcamera.org/comment/22689/","msgid":"<8bf25adb-64ca-a269-4e7b-4a6300451d7b@ideasonboard.com>","date":"2022-04-13T08:53:13","subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi,\n\nOn 4/13/22 14:01, Kate Hsuan wrote:\n> Hi Umang,\n>\n> On Wed, Apr 13, 2022 at 4:20 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>> Hello,\n>>\n>> On 4/13/22 13:13, Kate Hsuan via libcamera-devel wrote:\n>>> A not initialized frame ignore counter (ignoreCounter_) makes the AF\n>>> function not work since the ignore counter may start from a random\n>>> negative number. The counter was set to kIgnoreFrame when AF is in\n>>> prepare stage.\n>>>\n>>> Signed-off-by: Kate Hsuan<hpa@redhat.com>\n>>> ---\n>>>    src/ipa/ipu3/algorithms/af.cpp | 3 +++\n>>>    1 file changed, 3 insertions(+)\n>>>\n>>> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n>>> index addf98af..f700b01f 100644\n>>> --- a/src/ipa/ipu3/algorithms/af.cpp\n>>> +++ b/src/ipa/ipu3/algorithms/af.cpp\n>>> @@ -181,6 +181,9 @@ int Af::configure(IPAContext &context, const IPAConfigInfo &configInfo)\n>>>        /* Initial max focus step */\n>>>        maxStep_ = kMaxFocusSteps;\n>>>\n>>> +     /* Initial frame ignore counter */\n>>> +     afIgnoreFrameReset();\n>>> +\n>>\n>> ... wondering if afReset() makes more sense here?\n> afReset first checks the ignore counter and then resets all the\n> variables. I think it can't be used here. :)\n\n\nAh yes! I missed to notice that part - for what it's worth\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n>\n>>>        /* Initial focus value */\n>>>        context.frameContext.af.focus = 0;\n>>>        /* Maximum variance of the AF statistics */\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0C999C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 13 Apr 2022 08:53:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3270165644;\n\tWed, 13 Apr 2022 10:53:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9204A604B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 13 Apr 2022 10:53:18 +0200 (CEST)","from [IPV6:2401:4900:1f3e:5b41:7dc9:ad59:fa84:68bf] (unknown\n\t[IPv6:2401:4900:1f3e:5b41:7dc9:ad59:fa84:68bf])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3FDE025B;\n\tWed, 13 Apr 2022 10:53:17 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1649840000;\n\tbh=oD8emhbb5eqsnmp/JpSLtjz/WfDLaxWjybmhetlyFTI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=hiDFDMrxSkF3CdO2178ZWQX8f7wUuLhEZqCi1n9J/iH6yNUsJJKiQZIB/KytwcymZ\n\tHa26dD+JSiDGCqOZ4g0po5vDbbkuY+4ok9lIohWIjeWLSx+c/Cs431bldRl5Bbw4/f\n\tz2F0lg4L5dzSrPo/u0nS/7JAuEaO3bN7kzrdzW2dwvWzxfwwxcvl3+93MnM/IFzshF\n\tHWIqVbP1N0TcKtOipDUrloR8OUMuoofk+itFdWEU4NZeEz/vpaxeyXAgN0E5fLq3Li\n\tnENhmG8ErOaA3HOllVLU+pmU0hnwx2qTlV7PtlKZnc+J3dUUgBM8r7f41t7vW1spMT\n\tQIfoebrwE00JQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1649839997;\n\tbh=oD8emhbb5eqsnmp/JpSLtjz/WfDLaxWjybmhetlyFTI=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=A3+ooYhXjPK5WqcjVurNWkZkEdb0cU7+BHwzhgUdtR5sX707upXt0aCQn5T4wznPQ\n\tR9+aPDszuZ29uQ/hW8+gDL6T+1eeaEJC0mJX9/sBG4/H6NYXWKByrHHk0I8jepQyU9\n\txfFojX2tZphb+QROTB9rlRtX8XtvX/UwckYE1wrQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"A3+ooYhX\"; dkim-atps=neutral","Message-ID":"<8bf25adb-64ca-a269-4e7b-4a6300451d7b@ideasonboard.com>","Date":"Wed, 13 Apr 2022 14:23:13 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Kate Hsuan <hpa@redhat.com>","References":"<20220413074353.13147-1-hpa@redhat.com>\n\t<5c7e7600-ba2d-e564-6fe3-edb382ae2df0@ideasonboard.com>\n\t<CAEth8oFzt6nGfa+_qSekyr7WUAYfH0ijLG1a_939TZsqGsSoaA@mail.gmail.com>","In-Reply-To":"<CAEth8oFzt6nGfa+_qSekyr7WUAYfH0ijLG1a_939TZsqGsSoaA@mail.gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v1] ipa: ipu3: af: A not initialized\n\tframe ignore counter fixing","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]