[{"id":36864,"web_url":"https://patchwork.libcamera.org/comment/36864/","msgid":"<d3540c37-127a-490e-b263-bf58343009d2@ideasonboard.com>","date":"2025-11-17T12:58:54","subject":"Re: [PATCH v3 15/19] ipa: libipa: agc: Fold resetFrameCount() in\n\tconfigure()","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2025. 11. 14. 15:17 keltezéssel, Jacopo Mondi írta:\n> The AgcMeanLuminance::resetFrameCount() function has to be called\n> after a call to AgcMeanLuminance::configure(). As the two calls always\n> happen one after another, do not require each IPA implementation to do\n> that but fold instead the call to resetFrameCount() in\n> AgcMeanLuminance::configure().\n> \n> Update the AgcMeanLuminance class documentation accordingly.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   src/ipa/ipu3/algorithms/agc.cpp       |  2 --\n>   src/ipa/libipa/agc_mean_luminance.cpp | 19 ++++++-------------\n>   src/ipa/libipa/agc_mean_luminance.h   |  9 ++++-----\n>   src/ipa/mali-c55/algorithms/agc.cpp   |  2 --\n>   src/ipa/rkisp1/algorithms/agc.cpp     |  2 --\n>   5 files changed, 10 insertions(+), 24 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index 002ee574c02b79c25834a9d87a5881a9de52e39e..c9d41f93cff5b81710b76592303f1e0d10697326 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -128,8 +128,6 @@ int Agc::configure(IPAContext &context,\n>   \n>   \t/* \\todo Update AGC limits when FrameDurationLimits is passed in */\n>   \n> -\tresetFrameCount();\n> -\n>   \treturn 0;\n>   }\n>   \n> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\n> index 9fc275ea9e5b81ce107eabe1982be3c44c01479c..725a23ef2f6f612c6d3408701246db7415fd8327 100644\n> --- a/src/ipa/libipa/agc_mean_luminance.cpp\n> +++ b/src/ipa/libipa/agc_mean_luminance.cpp\n> @@ -171,9 +171,10 @@ static constexpr double kMaxRelativeLuminanceTarget = 0.95;\n>    *\n>    * IPA modules that want to use this class to implement their AEGC algorithm\n>    * should derive it and provide an overriding estimateLuminance() function for\n> - * this class to use. They must call parseTuningData() in init(), and must also\n> - * call resetFrameCounter() in configure(). They may then use calculateNewEv()\n> - * in process(). To update the algorithm limits for example, in response to a\n> + * this class to use. They must call parseTuningData() in init() and the use the\n> + * sensor configuration data to call AgcMeanLuminance::configure() in their\n> + * configure() implementation. They may then use calculateNewEv() in process().\n> + * To update the algorithm limits for example, in response to a\n>    * FrameDurationLimit control being passed in queueRequest()) then\n>    * setExposureLimits() must be called with the new values.\n>    */\n> @@ -379,6 +380,8 @@ void AgcMeanLuminance::configure(const SensorConfiguration &config,\n>   \n>   \t\thelper->configure(sensorConfig, sensorHelper);\n>   \t}\n> +\n> +\tresetFrameCount();\n>   }\n>   \n>   /**\n> @@ -692,16 +695,6 @@ AgcMeanLuminance::calculateNewEv(uint32_t constraintModeIndex,\n>   \treturn exposureModeHelper->splitExposure(newExposureValue);\n>   }\n>   \n> -/**\n> - * \\fn AgcMeanLuminance::resetFrameCount()\n> - * \\brief Reset the frame counter\n> - *\n> - * This function resets the internal frame counter, which exists to help the\n> - * algorithm decide whether it should respond instantly or not. The expectation\n> - * is for derived classes to call this function before each camera start call in\n> - * their configure() function.\n> - */\n> -\n>   } /* namespace ipa */\n>   \n>   } /* namespace libcamera */\n> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h\n> index 12316ca8bbd7d8b5783a948f5e01d5f0f56bfe3a..acbefc4e5765413bc803417eae1dbd0a943bc95e 100644\n> --- a/src/ipa/libipa/agc_mean_luminance.h\n> +++ b/src/ipa/libipa/agc_mean_luminance.h\n> @@ -87,11 +87,6 @@ public:\n>   \n>   \tdouble effectiveYTarget() const;\n>   \n> -\tvoid resetFrameCount()\n> -\t{\n> -\t\tframeCount_ = 0;\n> -\t}\n> -\n>   private:\n>   \tvirtual double estimateLuminance(const double gain) const = 0;\n>   \n> @@ -104,6 +99,10 @@ private:\n>   \t\t\t\t   const Histogram &hist,\n>   \t\t\t\t   double gain);\n>   \tutils::Duration filterExposure(utils::Duration exposureValue);\n\nI'd probably add an empty line here.\n\n\n> +\tvoid resetFrameCount()\n> +\t{\n> +\t\tframeCount_ = 0;\n> +\t}\n>   \n>   \tdouble exposureCompensation_;\n>   \tuint64_t frameCount_;\n> diff --git a/src/ipa/mali-c55/algorithms/agc.cpp b/src/ipa/mali-c55/algorithms/agc.cpp\n> index 731b29ced1030ecb3f44b83ad28a0691dd5d2f0d..91b1438f7e5ca0498373c86fd75b91f9c5a81c3f 100644\n> --- a/src/ipa/mali-c55/algorithms/agc.cpp\n> +++ b/src/ipa/mali-c55/algorithms/agc.cpp\n> @@ -186,8 +186,6 @@ int Agc::configure(IPAContext &context,\n>   \n>   \t/* \\todo Update AGC limits when FrameDurationLimits is passed in */\n>   \n> -\tresetFrameCount();\n> -\n>   \treturn 0;\n>   }\n>   \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index c8210e175186a282faf586378c5a0a761612047c..b9a94ba03c910f73420579dd6737d8d46b26e576 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -213,8 +213,6 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)\n>   \n>   \tcontext.activeState.agc.automatic.yTarget = effectiveYTarget();\n>   \n> -\tresetFrameCount();\n> -\n>   \treturn 0;\n>   }\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 886F7BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 17 Nov 2025 12:59:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 892A560A80;\n\tMon, 17 Nov 2025 13:58:59 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 317A460856\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Nov 2025 13:58:58 +0100 (CET)","from [192.168.33.31] (185.221.143.100.nat.pool.zt.hu\n\t[185.221.143.100])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 00C5642B;\n\tMon, 17 Nov 2025 13:56:54 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WiuKmD8Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763384215;\n\tbh=wIOpY5xQghGYwbFTAED9PDQRGVuTCgs7ruslOrLjNH8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=WiuKmD8Yj8ruNNjaaH/J3U4ICzd2EZ7zmhIvyJTYxojMrIHK9AtB+71i3I/ftE1Ju\n\tmdVXdVTc3GePpe6dynCFYVncBaZxqO7ZYguy1PpYxK3KL/uJIZj6dWVp0WpBK6OlJ/\n\tq10HmLGC4F7hPKqLvQHfApliW9uN7y0FkNPf7dBg=","Message-ID":"<d3540c37-127a-490e-b263-bf58343009d2@ideasonboard.com>","Date":"Mon, 17 Nov 2025 13:58:54 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 15/19] ipa: libipa: agc: Fold resetFrameCount() in\n\tconfigure()","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, =?utf-8?q?Niklas_S=C3=B6?=\n\t=?utf-8?q?derlund?= <niklas.soderlund@ragnatech.se>, Robert Mader\n\t<robert.mader@collabora.com>,  libcamera-devel@lists.libcamera.org","References":"<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>\n\t<20251114-exposure-limits-v3-15-b7c07feba026@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20251114-exposure-limits-v3-15-b7c07feba026@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":36930,"web_url":"https://patchwork.libcamera.org/comment/36930/","msgid":"<176362812430.2176992.1716334851276694431@localhost>","date":"2025-11-20T08:42:04","subject":"Re: [PATCH v3 15/19] ipa: libipa: agc: Fold resetFrameCount() in\n\tconfigure()","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nQuoting Jacopo Mondi (2025-11-14 15:17:10)\n> The AgcMeanLuminance::resetFrameCount() function has to be called\n> after a call to AgcMeanLuminance::configure(). As the two calls always\n> happen one after another, do not require each IPA implementation to do\n> that but fold instead the call to resetFrameCount() in\n> AgcMeanLuminance::configure().\n> \n> Update the AgcMeanLuminance class documentation accordingly.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/algorithms/agc.cpp       |  2 --\n>  src/ipa/libipa/agc_mean_luminance.cpp | 19 ++++++-------------\n>  src/ipa/libipa/agc_mean_luminance.h   |  9 ++++-----\n>  src/ipa/mali-c55/algorithms/agc.cpp   |  2 --\n>  src/ipa/rkisp1/algorithms/agc.cpp     |  2 --\n>  5 files changed, 10 insertions(+), 24 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index 002ee574c02b79c25834a9d87a5881a9de52e39e..c9d41f93cff5b81710b76592303f1e0d10697326 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -128,8 +128,6 @@ int Agc::configure(IPAContext &context,\n>  \n>         /* \\todo Update AGC limits when FrameDurationLimits is passed in */\n>  \n> -       resetFrameCount();\n> -\n>         return 0;\n>  }\n>  \n> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\n> index 9fc275ea9e5b81ce107eabe1982be3c44c01479c..725a23ef2f6f612c6d3408701246db7415fd8327 100644\n> --- a/src/ipa/libipa/agc_mean_luminance.cpp\n> +++ b/src/ipa/libipa/agc_mean_luminance.cpp\n> @@ -171,9 +171,10 @@ static constexpr double kMaxRelativeLuminanceTarget = 0.95;\n>   *\n>   * IPA modules that want to use this class to implement their AEGC algorithm\n>   * should derive it and provide an overriding estimateLuminance() function for\n> - * this class to use. They must call parseTuningData() in init(), and must also\n> - * call resetFrameCounter() in configure(). They may then use calculateNewEv()\n> - * in process(). To update the algorithm limits for example, in response to a\n> + * this class to use. They must call parseTuningData() in init() and the use the\n> + * sensor configuration data to call AgcMeanLuminance::configure() in their\n> + * configure() implementation. They may then use calculateNewEv() in process().\n> + * To update the algorithm limits for example, in response to a\n>   * FrameDurationLimit control being passed in queueRequest()) then\n>   * setExposureLimits() must be called with the new values.\n>   */\n> @@ -379,6 +380,8 @@ void AgcMeanLuminance::configure(const SensorConfiguration &config,\n>  \n>                 helper->configure(sensorConfig, sensorHelper);\n>         }\n> +\n> +       resetFrameCount();\n>  }\n>  \n>  /**\n> @@ -692,16 +695,6 @@ AgcMeanLuminance::calculateNewEv(uint32_t constraintModeIndex,\n>         return exposureModeHelper->splitExposure(newExposureValue);\n>  }\n>  \n> -/**\n> - * \\fn AgcMeanLuminance::resetFrameCount()\n> - * \\brief Reset the frame counter\n> - *\n> - * This function resets the internal frame counter, which exists to help the\n> - * algorithm decide whether it should respond instantly or not. The expectation\n> - * is for derived classes to call this function before each camera start call in\n> - * their configure() function.\n> - */\n> -\n>  } /* namespace ipa */\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h\n> index 12316ca8bbd7d8b5783a948f5e01d5f0f56bfe3a..acbefc4e5765413bc803417eae1dbd0a943bc95e 100644\n> --- a/src/ipa/libipa/agc_mean_luminance.h\n> +++ b/src/ipa/libipa/agc_mean_luminance.h\n> @@ -87,11 +87,6 @@ public:\n>  \n>         double effectiveYTarget() const;\n>  \n> -       void resetFrameCount()\n> -       {\n> -               frameCount_ = 0;\n> -       }\n> -\n>  private:\n>         virtual double estimateLuminance(const double gain) const = 0;\n>  \n> @@ -104,6 +99,10 @@ private:\n>                                    const Histogram &hist,\n>                                    double gain);\n>         utils::Duration filterExposure(utils::Duration exposureValue);\n> +       void resetFrameCount()\n> +       {\n> +               frameCount_ = 0;\n> +       }\n\nCan't we just drop the whole function and move that line into\nconfigure()? It is only called from one place.\n\nAnyways:\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nBest regards,\nStefan\n\n>  \n>         double exposureCompensation_;\n>         uint64_t frameCount_;\n> diff --git a/src/ipa/mali-c55/algorithms/agc.cpp b/src/ipa/mali-c55/algorithms/agc.cpp\n> index 731b29ced1030ecb3f44b83ad28a0691dd5d2f0d..91b1438f7e5ca0498373c86fd75b91f9c5a81c3f 100644\n> --- a/src/ipa/mali-c55/algorithms/agc.cpp\n> +++ b/src/ipa/mali-c55/algorithms/agc.cpp\n> @@ -186,8 +186,6 @@ int Agc::configure(IPAContext &context,\n>  \n>         /* \\todo Update AGC limits when FrameDurationLimits is passed in */\n>  \n> -       resetFrameCount();\n> -\n>         return 0;\n>  }\n>  \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index c8210e175186a282faf586378c5a0a761612047c..b9a94ba03c910f73420579dd6737d8d46b26e576 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -213,8 +213,6 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)\n>  \n>         context.activeState.agc.automatic.yTarget = effectiveYTarget();\n>  \n> -       resetFrameCount();\n> -\n>         return 0;\n>  }\n>  \n> \n> -- \n> 2.51.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 B92CABD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Nov 2025 08:42:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BDF9360A8B;\n\tThu, 20 Nov 2025 09:42:10 +0100 (CET)","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 EF999606E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Nov 2025 09:42:08 +0100 (CET)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:6a98:fbdf:d77e:8a49])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id DBF96C59;\n\tThu, 20 Nov 2025 09:40:02 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"h4AkB4QN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763628002;\n\tbh=wvZgtj5+fwSI8km6v/0X+gFc+zk1Dd9cPILbCs3oEd8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=h4AkB4QN4KUk/7IJzEKCWCcdo1dKN1APp+NHJXUAvzHElxYQ1kXuW2B0d+x5s9GKo\n\tPPlJYvnLkiNHAwSFtSe+am2FLYZBLT/R8ZG/zHFf1HpyKaanXuf/qVcuNqO5wjK1Pq\n\tuGU0y5ncYrTG13h3DlO7elF69VP0kHGxhEvi1QCc=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251114-exposure-limits-v3-15-b7c07feba026@ideasonboard.com>","References":"<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>\n\t<20251114-exposure-limits-v3-15-b7c07feba026@ideasonboard.com>","Subject":"Re: [PATCH v3 15/19] ipa: libipa: agc: Fold resetFrameCount() in\n\tconfigure()","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, Niklas =?utf-8?b?U8O2?=\n\t=?utf-8?q?derlund?= <niklas.soderlund@ragnatech.se>, Robert Mader\n\t<robert.mader@collabora.com>, libcamera-devel@lists.libcamera.org","Date":"Thu, 20 Nov 2025 09:42:04 +0100","Message-ID":"<176362812430.2176992.1716334851276694431@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38128,"web_url":"https://patchwork.libcamera.org/comment/38128/","msgid":"<177039191450.607498.2386320555693162817@neptunite.rasen.tech>","date":"2026-02-06T15:31:54","subject":"Re: [PATCH v3 15/19] ipa: libipa: agc: Fold resetFrameCount() in\n\tconfigure()","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2025-11-14 23:17:10)\n> The AgcMeanLuminance::resetFrameCount() function has to be called\n> after a call to AgcMeanLuminance::configure(). As the two calls always\n> happen one after another, do not require each IPA implementation to do\n> that but fold instead the call to resetFrameCount() in\n\ns/to/into/ (also in the title)\n\n> AgcMeanLuminance::configure().\n> \n> Update the AgcMeanLuminance class documentation accordingly.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/ipu3/algorithms/agc.cpp       |  2 --\n>  src/ipa/libipa/agc_mean_luminance.cpp | 19 ++++++-------------\n>  src/ipa/libipa/agc_mean_luminance.h   |  9 ++++-----\n>  src/ipa/mali-c55/algorithms/agc.cpp   |  2 --\n>  src/ipa/rkisp1/algorithms/agc.cpp     |  2 --\n>  5 files changed, 10 insertions(+), 24 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index 002ee574c02b79c25834a9d87a5881a9de52e39e..c9d41f93cff5b81710b76592303f1e0d10697326 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -128,8 +128,6 @@ int Agc::configure(IPAContext &context,\n>  \n>         /* \\todo Update AGC limits when FrameDurationLimits is passed in */\n>  \n> -       resetFrameCount();\n> -\n>         return 0;\n>  }\n>  \n> diff --git a/src/ipa/libipa/agc_mean_luminance.cpp b/src/ipa/libipa/agc_mean_luminance.cpp\n> index 9fc275ea9e5b81ce107eabe1982be3c44c01479c..725a23ef2f6f612c6d3408701246db7415fd8327 100644\n> --- a/src/ipa/libipa/agc_mean_luminance.cpp\n> +++ b/src/ipa/libipa/agc_mean_luminance.cpp\n> @@ -171,9 +171,10 @@ static constexpr double kMaxRelativeLuminanceTarget = 0.95;\n>   *\n>   * IPA modules that want to use this class to implement their AEGC algorithm\n>   * should derive it and provide an overriding estimateLuminance() function for\n> - * this class to use. They must call parseTuningData() in init(), and must also\n> - * call resetFrameCounter() in configure(). They may then use calculateNewEv()\n> - * in process(). To update the algorithm limits for example, in response to a\n> + * this class to use. They must call parseTuningData() in init() and the use the\n> + * sensor configuration data to call AgcMeanLuminance::configure() in their\n> + * configure() implementation. They may then use calculateNewEv() in process().\n> + * To update the algorithm limits for example, in response to a\n>   * FrameDurationLimit control being passed in queueRequest()) then\n>   * setExposureLimits() must be called with the new values.\n>   */\n> @@ -379,6 +380,8 @@ void AgcMeanLuminance::configure(const SensorConfiguration &config,\n>  \n>                 helper->configure(sensorConfig, sensorHelper);\n>         }\n> +\n> +       resetFrameCount();\n>  }\n>  \n>  /**\n> @@ -692,16 +695,6 @@ AgcMeanLuminance::calculateNewEv(uint32_t constraintModeIndex,\n>         return exposureModeHelper->splitExposure(newExposureValue);\n>  }\n>  \n> -/**\n> - * \\fn AgcMeanLuminance::resetFrameCount()\n> - * \\brief Reset the frame counter\n> - *\n> - * This function resets the internal frame counter, which exists to help the\n> - * algorithm decide whether it should respond instantly or not. The expectation\n> - * is for derived classes to call this function before each camera start call in\n> - * their configure() function.\n> - */\n> -\n>  } /* namespace ipa */\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/ipa/libipa/agc_mean_luminance.h b/src/ipa/libipa/agc_mean_luminance.h\n> index 12316ca8bbd7d8b5783a948f5e01d5f0f56bfe3a..acbefc4e5765413bc803417eae1dbd0a943bc95e 100644\n> --- a/src/ipa/libipa/agc_mean_luminance.h\n> +++ b/src/ipa/libipa/agc_mean_luminance.h\n> @@ -87,11 +87,6 @@ public:\n>  \n>         double effectiveYTarget() const;\n>  \n> -       void resetFrameCount()\n> -       {\n> -               frameCount_ = 0;\n> -       }\n> -\n>  private:\n>         virtual double estimateLuminance(const double gain) const = 0;\n>  \n> @@ -104,6 +99,10 @@ private:\n>                                    const Histogram &hist,\n>                                    double gain);\n>         utils::Duration filterExposure(utils::Duration exposureValue);\n> +       void resetFrameCount()\n> +       {\n> +               frameCount_ = 0;\n> +       }\n>  \n>         double exposureCompensation_;\n>         uint64_t frameCount_;\n> diff --git a/src/ipa/mali-c55/algorithms/agc.cpp b/src/ipa/mali-c55/algorithms/agc.cpp\n> index 731b29ced1030ecb3f44b83ad28a0691dd5d2f0d..91b1438f7e5ca0498373c86fd75b91f9c5a81c3f 100644\n> --- a/src/ipa/mali-c55/algorithms/agc.cpp\n> +++ b/src/ipa/mali-c55/algorithms/agc.cpp\n> @@ -186,8 +186,6 @@ int Agc::configure(IPAContext &context,\n>  \n>         /* \\todo Update AGC limits when FrameDurationLimits is passed in */\n>  \n> -       resetFrameCount();\n> -\n>         return 0;\n>  }\n>  \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index c8210e175186a282faf586378c5a0a761612047c..b9a94ba03c910f73420579dd6737d8d46b26e576 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -213,8 +213,6 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo)\n>  \n>         context.activeState.agc.automatic.yTarget = effectiveYTarget();\n>  \n> -       resetFrameCount();\n> -\n>         return 0;\n>  }\n>  \n> \n> -- \n> 2.51.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 79942C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Feb 2026 15:32:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1B954620DE;\n\tFri,  6 Feb 2026 16:32:03 +0100 (CET)","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 8DDB262095\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Feb 2026 16:32:01 +0100 (CET)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:5247:7b72:2b7:10da])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 877F12E0;\n\tFri,  6 Feb 2026 16:31:17 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ZUP/7OBq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1770391878;\n\tbh=zbLB5H0mLjy3rXWjKbnCeEmlCAHaIUWasAZTkXeWEl8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ZUP/7OBqtTZxtDbtzemNvsSBVwkYvCSI3UCObs9/M5t6cfJfcYa1/ldF3HmKuDlqb\n\t3aeLhjukjDvQHFKsT1BBpjt4UBRn2AhiHcb0zWJwvWhxHXZpPTT1Nie+m9BM6wrw1E\n\tL7dQezz0YdNxbU0H6sHb+IxHnekVzux7EuW4EPKU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251114-exposure-limits-v3-15-b7c07feba026@ideasonboard.com>","References":"<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>\n\t<20251114-exposure-limits-v3-15-b7c07feba026@ideasonboard.com>","Subject":"Re: [PATCH v3 15/19] ipa: libipa: agc: Fold resetFrameCount() in\n\tconfigure()","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, Niklas =?utf-8?b?U8O2?=\n\t=?utf-8?q?derlund?= <niklas.soderlund@ragnatech.se>, Robert Mader\n\t<robert.mader@collabora.com>, libcamera-devel@lists.libcamera.org","Date":"Sat, 07 Feb 2026 00:31:54 +0900","Message-ID":"<177039191450.607498.2386320555693162817@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]