[{"id":25013,"web_url":"https://patchwork.libcamera.org/comment/25013/","msgid":"<166368194358.3912877.3711252731039956260@Monstersaurus>","date":"2022-09-20T13:52:23","subject":"Re: [libcamera-devel] [PATCH v4 07/32] ipa: libipa: algorithm:\n\tprocess(): Pass frame number","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2022-09-08 02:41:35)\n> From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> Pass the frame number of the current frame being processed.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nMissing SoB\n\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n> Changes since v3:\n> \n> - Use a const uint32_t instead of an unsigned int for the frame number\n> - Update the documentation of ipa::rkisp1::Agc::process()\n\nI think that got inadvertently squashed into 03/32.\n\nOtherwise,\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/ipa/ipu3/algorithms/af.cpp           | 4 +++-\n>  src/ipa/ipu3/algorithms/af.h             | 3 ++-\n>  src/ipa/ipu3/algorithms/agc.cpp          | 4 +++-\n>  src/ipa/ipu3/algorithms/agc.h            | 3 ++-\n>  src/ipa/ipu3/algorithms/awb.cpp          | 3 ++-\n>  src/ipa/ipu3/algorithms/awb.h            | 3 ++-\n>  src/ipa/ipu3/algorithms/tone_mapping.cpp | 4 +++-\n>  src/ipa/ipu3/algorithms/tone_mapping.h   | 3 ++-\n>  src/ipa/ipu3/ipu3.cpp                    | 2 +-\n>  src/ipa/libipa/algorithm.cpp             | 1 +\n>  src/ipa/libipa/algorithm.h               | 1 +\n>  src/ipa/rkisp1/algorithms/agc.cpp        | 2 +-\n>  src/ipa/rkisp1/algorithms/agc.h          | 3 ++-\n>  src/ipa/rkisp1/algorithms/awb.cpp        | 1 +\n>  src/ipa/rkisp1/algorithms/awb.h          | 3 ++-\n>  src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>  16 files changed, 29 insertions(+), 13 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> index bc01b232ec59..b00a34f9e090 100644\n> --- a/src/ipa/ipu3/algorithms/af.cpp\n> +++ b/src/ipa/ipu3/algorithms/af.cpp\n> @@ -406,6 +406,7 @@ bool Af::afIsOutOfFocus(IPAContext &context)\n>  /**\n>   * \\brief Determine the max contrast image and lens position.\n>   * \\param[in] context The IPA context.\n> + * \\param[in] frame The frame context sequence number\n>   * \\param[in] frameContext The current frame context\n>   * \\param[in] stats The statistics buffer of IPU3.\n>   *\n> @@ -420,7 +421,8 @@ bool Af::afIsOutOfFocus(IPAContext &context)\n>   *\n>   * [1] Hill Climbing Algorithm, https://en.wikipedia.org/wiki/Hill_climbing\n>   */\n> -void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext &frameContext,\n> +void Af::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +                [[maybe_unused]] IPAFrameContext &frameContext,\n>                  const ipu3_uapi_stats_3a *stats)\n>  {\n>         /* Evaluate the AF buffer length */\n> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n> index fbfd171b6465..89d37ac18615 100644\n> --- a/src/ipa/ipu3/algorithms/af.h\n> +++ b/src/ipa/ipu3/algorithms/af.h\n> @@ -34,7 +34,8 @@ public:\n>         void prepare(IPAContext &context, const uint32_t frame,\n>                      IPAFrameContext &frameContext,\n>                      ipu3_uapi_params *params) override;\n> -       void process(IPAContext &context, IPAFrameContext &frameContext,\n> +       void process(IPAContext &context, const uint32_t frame,\n> +                    IPAFrameContext &frameContext,\n>                      const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index f8ca29640a44..a1a3c38ffe84 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -317,13 +317,15 @@ double Agc::estimateLuminance(IPAActiveState &activeState,\n>  /**\n>   * \\brief Process IPU3 statistics, and run AGC operations\n>   * \\param[in] context The shared IPA context\n> + * \\param[in] frame The current frame sequence number\n>   * \\param[in] frameContext The current frame context\n>   * \\param[in] stats The IPU3 statistics and ISP results\n>   *\n>   * Identify the current image brightness, and use that to estimate the optimal\n>   * new exposure and gain for the scene.\n>   */\n> -void Agc::process(IPAContext &context, IPAFrameContext &frameContext,\n> +void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +                 IPAFrameContext &frameContext,\n>                   const ipu3_uapi_stats_3a *stats)\n>  {\n>         /*\n> diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\n> index 876fbbb6b585..59b4b9843c2f 100644\n> --- a/src/ipa/ipu3/algorithms/agc.h\n> +++ b/src/ipa/ipu3/algorithms/agc.h\n> @@ -28,7 +28,8 @@ public:\n>         ~Agc() = default;\n>  \n>         int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n> -       void process(IPAContext &context, IPAFrameContext &frameContext,\n> +       void process(IPAContext &context, const uint32_t frame,\n> +                    IPAFrameContext &frameContext,\n>                      const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index e6e2951b8abb..0dbd7d4c374f 100644\n> --- a/src/ipa/ipu3/algorithms/awb.cpp\n> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n> @@ -387,7 +387,8 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::process\n>   */\n> -void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext &frameContext,\n> +void Awb::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +                 [[maybe_unused]] IPAFrameContext &frameContext,\n>                   const ipu3_uapi_stats_3a *stats)\n>  {\n>         calculateWBGains(stats);\n> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n> index e9e816928fb4..28e2d38a711c 100644\n> --- a/src/ipa/ipu3/algorithms/awb.h\n> +++ b/src/ipa/ipu3/algorithms/awb.h\n> @@ -42,7 +42,8 @@ public:\n>         void prepare(IPAContext &context, const uint32_t frame,\n>                      IPAFrameContext &frameContext,\n>                      ipu3_uapi_params *params) override;\n> -       void process(IPAContext &context, IPAFrameContext &frameContext,\n> +       void process(IPAContext &context, const uint32_t frame,\n> +                    IPAFrameContext &frameContext,\n>                      const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> index 10a2fb1935dc..eac3d4064443 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> @@ -76,13 +76,15 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>  /**\n>   * \\brief Calculate the tone mapping look up table\n>   * \\param[in] context The shared IPA context\n> + * \\param[in] frame The current frame sequence number\n>   * \\param[in] frameContext The current frame context\n>   * \\param[in] stats The IPU3 statistics and ISP results\n>   *\n>   * The tone mapping look up table is generated as an inverse power curve from\n>   * our gamma setting.\n>   */\n> -void ToneMapping::process(IPAContext &context, [[maybe_unused]] IPAFrameContext &frameContext,\n> +void ToneMapping::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +                         [[maybe_unused]] IPAFrameContext &frameContext,\n>                           [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n>  {\n>         /*\n> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h\n> index c24a7e485aaf..822e5168df82 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.h\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n> @@ -21,7 +21,8 @@ public:\n>         int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>         void prepare(IPAContext &context, const uint32_t frame,\n>                      IPAFrameContext &frameContext, ipu3_uapi_params *params) override;\n> -       void process(IPAContext &context, IPAFrameContext &frameContext,\n> +       void process(IPAContext &context, const uint32_t frame,\n> +                    IPAFrameContext &frameContext,\n>                      const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index ac6f66afecb5..e5a763fd2b08 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -618,7 +618,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n>         ControlList ctrls(controls::controls);\n>  \n>         for (auto const &algo : algorithms())\n> -               algo->process(context_, frameContext, stats);\n> +               algo->process(context_, frame, frameContext, stats);\n>  \n>         setControls(frame);\n>  \n> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n> index 0992e5de8dd5..30eab67f71fc 100644\n> --- a/src/ipa/libipa/algorithm.cpp\n> +++ b/src/ipa/libipa/algorithm.cpp\n> @@ -103,6 +103,7 @@ namespace ipa {\n>   * \\fn Algorithm::process()\n>   * \\brief Process ISP statistics, and run algorithm operations\n>   * \\param[in] context The shared IPA context\n> + * \\param[in] frame The frame context sequence number\n>   * \\param[in] frameContext The current frame's context\n>   * \\param[in] stats The IPA statistics and ISP results\n>   *\n> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n> index cde2e6399e8e..ee93d260ca3f 100644\n> --- a/src/ipa/libipa/algorithm.h\n> +++ b/src/ipa/libipa/algorithm.h\n> @@ -52,6 +52,7 @@ public:\n>         }\n>  \n>         virtual void process([[maybe_unused]] typename Module::Context &context,\n> +                            [[maybe_unused]] const uint32_t frame,\n>                              [[maybe_unused]] typename Module::FrameContext &frameContext,\n>                              [[maybe_unused]] const typename Module::Stats *stats)\n>         {\n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 0d22d9dc98fb..4c246d71a739 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -281,7 +281,7 @@ double Agc::measureBrightness(const rkisp1_cif_isp_hist_stat *hist) const\n>   * Identify the current image brightness, and use that to estimate the optimal\n>   * new exposure and gain for the scene.\n>   */\n> -void Agc::process(IPAContext &context,\n> +void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>                   [[maybe_unused]] IPAFrameContext &frameContext,\n>                   const rkisp1_stat_buffer *stats)\n>  {\n> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\n> index 8724cb602158..f115ba2ed85c 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.h\n> +++ b/src/ipa/rkisp1/algorithms/agc.h\n> @@ -29,7 +29,8 @@ public:\n>         void prepare(IPAContext &context, const uint32_t frame,\n>                      IPAFrameContext &frameContext,\n>                      rkisp1_params_cfg *params) override;\n> -       void process(IPAContext &context, IPAFrameContext &frameContext,\n> +       void process(IPAContext &context, const uint32_t frame,\n> +                    IPAFrameContext &frameContext,\n>                      const rkisp1_stat_buffer *stats) override;\n>  \n>  private:\n> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n> index da22a0970a4f..aefba6382807 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n> @@ -155,6 +155,7 @@ void Awb::queueRequest(IPAContext &context,\n>   * \\copydoc libcamera::ipa::Algorithm::process\n>   */\n>  void Awb::process([[maybe_unused]] IPAContext &context,\n> +                 [[maybe_unused]] const uint32_t frame,\n>                   [[maybe_unused]] IPAFrameContext &frameCtx,\n>                   const rkisp1_stat_buffer *stats)\n>  {\n> diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\n> index 7ae6c7a9bb10..806e11a2ec93 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.h\n> +++ b/src/ipa/rkisp1/algorithms/awb.h\n> @@ -25,7 +25,8 @@ public:\n>                      rkisp1_params_cfg *params) override;\n>         void queueRequest(IPAContext &context, const uint32_t frame,\n>                           const ControlList &controls) override;\n> -       void process(IPAContext &context, IPAFrameContext &frameCtx,\n> +       void process(IPAContext &context, const uint32_t frame,\n> +                    IPAFrameContext &frameCtx,\n>                      const rkisp1_stat_buffer *stats) override;\n>  \n>  private:\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 0932c73b14e4..b2593a584a1a 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -333,7 +333,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n>         IPAFrameContext frameContext;\n>  \n>         for (auto const &algo : algorithms())\n> -               algo->process(context_, frameContext, stats);\n> +               algo->process(context_, frame, frameContext, stats);\n>  \n>         setControls(frame);\n>  \n> -- \n> Regards,\n> \n> Laurent Pinchart\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 3B7F4C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Sep 2022 13:52:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A1840621B0;\n\tTue, 20 Sep 2022 15:52:27 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B5BE06218B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Sep 2022 15:52:26 +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 4042D6BE;\n\tTue, 20 Sep 2022 15:52:26 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663681947;\n\tbh=8u+vj8y6cvT6pAofBJbvLyBYkmbwRWfX15gc2V6llXE=;\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=DWG3d0ZaTas0U4Xd4LnSz1JNSptAU4VY2hROE+YUbhB6E4YnzxCAZm+Vb+i4lGeQi\n\tf4Gw7gPkE6c72O/AWwjO993f1DLs1hLzUVIZVlEwasIZv/UPVUp2gqB7qC6j/6fOw5\n\tiCwi+vbPBneZj5Woa7rQ3FB8Y59rErONsZHZzKqqgiH9KdGh3yRhfiCGMWmJAdENGH\n\tu4GI511y8Lr7byNnHWemp5C63yOXDOYzoKdkgc43W4OCYu2KSKhnZAA/NnISdq3Dz5\n\txSdix+YYF6HtrjIK++ekWsS3G5WubrxWVDBJmhO262VYYTzweim+GYBmxCkklIw4W0\n\tKpKTifYagjwGA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1663681946;\n\tbh=8u+vj8y6cvT6pAofBJbvLyBYkmbwRWfX15gc2V6llXE=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=UBYRK3xoJuhNtbxllMbCxnrPf91bLh/kYvSPDRpAMZ+HwTjdaSiNjPSGV6tQzGTL9\n\tQ5lQbOZzEWe/f/CEf3gU4b6F5KYY3FtkG/jsq7rTX4m1+x5TZl08kKua3b2USgTBc8\n\ts1cJKxFe6T9X3yL/AmDv5rTRDD81hViXyNRRNaig="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"UBYRK3xo\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220908014200.28728-8-laurent.pinchart@ideasonboard.com>","References":"<20220908014200.28728-1-laurent.pinchart@ideasonboard.com>\n\t<20220908014200.28728-8-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 20 Sep 2022 14:52:23 +0100","Message-ID":"<166368194358.3912877.3711252731039956260@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v4 07/32] ipa: libipa: algorithm:\n\tprocess(): Pass frame number","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":25054,"web_url":"https://patchwork.libcamera.org/comment/25054/","msgid":"<20220921180330.6vjuextovm2fd5k5@uno.localdomain>","date":"2022-09-21T18:03:30","subject":"Re: [libcamera-devel] [PATCH v4 07/32] ipa: libipa: algorithm:\n\tprocess(): Pass frame number","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Thu, Sep 08, 2022 at 04:41:35AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> From: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> Pass the frame number of the current frame being processed.\n>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n> Changes since v3:\n>\n> - Use a const uint32_t instead of an unsigned int for the frame number\n> - Update the documentation of ipa::rkisp1::Agc::process()\n\nLooks good\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> ---\n>  src/ipa/ipu3/algorithms/af.cpp           | 4 +++-\n>  src/ipa/ipu3/algorithms/af.h             | 3 ++-\n>  src/ipa/ipu3/algorithms/agc.cpp          | 4 +++-\n>  src/ipa/ipu3/algorithms/agc.h            | 3 ++-\n>  src/ipa/ipu3/algorithms/awb.cpp          | 3 ++-\n>  src/ipa/ipu3/algorithms/awb.h            | 3 ++-\n>  src/ipa/ipu3/algorithms/tone_mapping.cpp | 4 +++-\n>  src/ipa/ipu3/algorithms/tone_mapping.h   | 3 ++-\n>  src/ipa/ipu3/ipu3.cpp                    | 2 +-\n>  src/ipa/libipa/algorithm.cpp             | 1 +\n>  src/ipa/libipa/algorithm.h               | 1 +\n>  src/ipa/rkisp1/algorithms/agc.cpp        | 2 +-\n>  src/ipa/rkisp1/algorithms/agc.h          | 3 ++-\n>  src/ipa/rkisp1/algorithms/awb.cpp        | 1 +\n>  src/ipa/rkisp1/algorithms/awb.h          | 3 ++-\n>  src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>  16 files changed, 29 insertions(+), 13 deletions(-)\n>\n> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> index bc01b232ec59..b00a34f9e090 100644\n> --- a/src/ipa/ipu3/algorithms/af.cpp\n> +++ b/src/ipa/ipu3/algorithms/af.cpp\n> @@ -406,6 +406,7 @@ bool Af::afIsOutOfFocus(IPAContext &context)\n>  /**\n>   * \\brief Determine the max contrast image and lens position.\n>   * \\param[in] context The IPA context.\n> + * \\param[in] frame The frame context sequence number\n>   * \\param[in] frameContext The current frame context\n>   * \\param[in] stats The statistics buffer of IPU3.\n>   *\n> @@ -420,7 +421,8 @@ bool Af::afIsOutOfFocus(IPAContext &context)\n>   *\n>   * [1] Hill Climbing Algorithm, https://en.wikipedia.org/wiki/Hill_climbing\n>   */\n> -void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext &frameContext,\n> +void Af::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +\t\t [[maybe_unused]] IPAFrameContext &frameContext,\n>  \t\t const ipu3_uapi_stats_3a *stats)\n>  {\n>  \t/* Evaluate the AF buffer length */\n> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n> index fbfd171b6465..89d37ac18615 100644\n> --- a/src/ipa/ipu3/algorithms/af.h\n> +++ b/src/ipa/ipu3/algorithms/af.h\n> @@ -34,7 +34,8 @@ public:\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     ipu3_uapi_params *params) override;\n> -\tvoid process(IPAContext &context, IPAFrameContext &frameContext,\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     IPAFrameContext &frameContext,\n>  \t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index f8ca29640a44..a1a3c38ffe84 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -317,13 +317,15 @@ double Agc::estimateLuminance(IPAActiveState &activeState,\n>  /**\n>   * \\brief Process IPU3 statistics, and run AGC operations\n>   * \\param[in] context The shared IPA context\n> + * \\param[in] frame The current frame sequence number\n>   * \\param[in] frameContext The current frame context\n>   * \\param[in] stats The IPU3 statistics and ISP results\n>   *\n>   * Identify the current image brightness, and use that to estimate the optimal\n>   * new exposure and gain for the scene.\n>   */\n> -void Agc::process(IPAContext &context, IPAFrameContext &frameContext,\n> +void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +\t\t  IPAFrameContext &frameContext,\n>  \t\t  const ipu3_uapi_stats_3a *stats)\n>  {\n>  \t/*\n> diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\n> index 876fbbb6b585..59b4b9843c2f 100644\n> --- a/src/ipa/ipu3/algorithms/agc.h\n> +++ b/src/ipa/ipu3/algorithms/agc.h\n> @@ -28,7 +28,8 @@ public:\n>  \t~Agc() = default;\n>\n>  \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n> -\tvoid process(IPAContext &context, IPAFrameContext &frameContext,\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     IPAFrameContext &frameContext,\n>  \t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index e6e2951b8abb..0dbd7d4c374f 100644\n> --- a/src/ipa/ipu3/algorithms/awb.cpp\n> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n> @@ -387,7 +387,8 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::process\n>   */\n> -void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext &frameContext,\n> +void Awb::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +\t\t  [[maybe_unused]] IPAFrameContext &frameContext,\n>  \t\t  const ipu3_uapi_stats_3a *stats)\n>  {\n>  \tcalculateWBGains(stats);\n> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n> index e9e816928fb4..28e2d38a711c 100644\n> --- a/src/ipa/ipu3/algorithms/awb.h\n> +++ b/src/ipa/ipu3/algorithms/awb.h\n> @@ -42,7 +42,8 @@ public:\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     ipu3_uapi_params *params) override;\n> -\tvoid process(IPAContext &context, IPAFrameContext &frameContext,\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     IPAFrameContext &frameContext,\n>  \t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> index 10a2fb1935dc..eac3d4064443 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> @@ -76,13 +76,15 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>  /**\n>   * \\brief Calculate the tone mapping look up table\n>   * \\param[in] context The shared IPA context\n> + * \\param[in] frame The current frame sequence number\n>   * \\param[in] frameContext The current frame context\n>   * \\param[in] stats The IPU3 statistics and ISP results\n>   *\n>   * The tone mapping look up table is generated as an inverse power curve from\n>   * our gamma setting.\n>   */\n> -void ToneMapping::process(IPAContext &context, [[maybe_unused]] IPAFrameContext &frameContext,\n> +void ToneMapping::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n> +\t\t\t  [[maybe_unused]] IPAFrameContext &frameContext,\n>  \t\t\t  [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n>  {\n>  \t/*\n> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h\n> index c24a7e485aaf..822e5168df82 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.h\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n> @@ -21,7 +21,8 @@ public:\n>  \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext, ipu3_uapi_params *params) override;\n> -\tvoid process(IPAContext &context, IPAFrameContext &frameContext,\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     IPAFrameContext &frameContext,\n>  \t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index ac6f66afecb5..e5a763fd2b08 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -618,7 +618,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n>  \tControlList ctrls(controls::controls);\n>\n>  \tfor (auto const &algo : algorithms())\n> -\t\talgo->process(context_, frameContext, stats);\n> +\t\talgo->process(context_, frame, frameContext, stats);\n>\n>  \tsetControls(frame);\n>\n> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n> index 0992e5de8dd5..30eab67f71fc 100644\n> --- a/src/ipa/libipa/algorithm.cpp\n> +++ b/src/ipa/libipa/algorithm.cpp\n> @@ -103,6 +103,7 @@ namespace ipa {\n>   * \\fn Algorithm::process()\n>   * \\brief Process ISP statistics, and run algorithm operations\n>   * \\param[in] context The shared IPA context\n> + * \\param[in] frame The frame context sequence number\n>   * \\param[in] frameContext The current frame's context\n>   * \\param[in] stats The IPA statistics and ISP results\n>   *\n> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n> index cde2e6399e8e..ee93d260ca3f 100644\n> --- a/src/ipa/libipa/algorithm.h\n> +++ b/src/ipa/libipa/algorithm.h\n> @@ -52,6 +52,7 @@ public:\n>  \t}\n>\n>  \tvirtual void process([[maybe_unused]] typename Module::Context &context,\n> +\t\t\t     [[maybe_unused]] const uint32_t frame,\n>  \t\t\t     [[maybe_unused]] typename Module::FrameContext &frameContext,\n>  \t\t\t     [[maybe_unused]] const typename Module::Stats *stats)\n>  \t{\n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 0d22d9dc98fb..4c246d71a739 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -281,7 +281,7 @@ double Agc::measureBrightness(const rkisp1_cif_isp_hist_stat *hist) const\n>   * Identify the current image brightness, and use that to estimate the optimal\n>   * new exposure and gain for the scene.\n>   */\n> -void Agc::process(IPAContext &context,\n> +void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,\n>  \t\t  [[maybe_unused]] IPAFrameContext &frameContext,\n>  \t\t  const rkisp1_stat_buffer *stats)\n>  {\n> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\n> index 8724cb602158..f115ba2ed85c 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.h\n> +++ b/src/ipa/rkisp1/algorithms/agc.h\n> @@ -29,7 +29,8 @@ public:\n>  \tvoid prepare(IPAContext &context, const uint32_t frame,\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     rkisp1_params_cfg *params) override;\n> -\tvoid process(IPAContext &context, IPAFrameContext &frameContext,\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     IPAFrameContext &frameContext,\n>  \t\t     const rkisp1_stat_buffer *stats) override;\n>\n>  private:\n> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n> index da22a0970a4f..aefba6382807 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n> @@ -155,6 +155,7 @@ void Awb::queueRequest(IPAContext &context,\n>   * \\copydoc libcamera::ipa::Algorithm::process\n>   */\n>  void Awb::process([[maybe_unused]] IPAContext &context,\n> +\t\t  [[maybe_unused]] const uint32_t frame,\n>  \t\t  [[maybe_unused]] IPAFrameContext &frameCtx,\n>  \t\t  const rkisp1_stat_buffer *stats)\n>  {\n> diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\n> index 7ae6c7a9bb10..806e11a2ec93 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.h\n> +++ b/src/ipa/rkisp1/algorithms/awb.h\n> @@ -25,7 +25,8 @@ public:\n>  \t\t     rkisp1_params_cfg *params) override;\n>  \tvoid queueRequest(IPAContext &context, const uint32_t frame,\n>  \t\t\t  const ControlList &controls) override;\n> -\tvoid process(IPAContext &context, IPAFrameContext &frameCtx,\n> +\tvoid process(IPAContext &context, const uint32_t frame,\n> +\t\t     IPAFrameContext &frameCtx,\n>  \t\t     const rkisp1_stat_buffer *stats) override;\n>\n>  private:\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 0932c73b14e4..b2593a584a1a 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -333,7 +333,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n>  \tIPAFrameContext frameContext;\n>\n>  \tfor (auto const &algo : algorithms())\n> -\t\talgo->process(context_, frameContext, stats);\n> +\t\talgo->process(context_, frame, frameContext, stats);\n>\n>  \tsetControls(frame);\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\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 56F27C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Sep 2022 18:03:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 989E7621EB;\n\tWed, 21 Sep 2022 20:03:34 +0200 (CEST)","from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A189600AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Sep 2022 20:03:32 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id CC9571C000D;\n\tWed, 21 Sep 2022 18:03:31 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663783414;\n\tbh=xsjoSySQ/2uIUIpcWAPc2RviKQh0DlIoGJLwNVXVKxM=;\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=HoI5tAMhhtVIQRs9kbAdCdGbid/VJ1GWbankbE5bklwIJ8ApP9sIecJYX0WCL8e/p\n\tWhiLmOFIcMQNyuC0ENJ7aB6VckXGe0O9cHvYY9h/3Mkmsy7IaA1aAnSgURSmr3L0xd\n\tf/9zpT4148J6N6Czh2XVdhQtDAeweZ2zfZFZO3o2u+zeMP3Zkx6yCibankxFanEz3E\n\tbBz5VYCr6VBv3mjKRa1wmeHl8MEkrCggs7o9vb0nroQAUMyynlWCHdMX/Iaaa8jIfg\n\tNhiQgRQilKXOfWcuZdF7QiyeqMKChAwM1AKtg842kIZEQ3pHPnNEpjdJ+AWAwcfo16\n\tcpQdLtcA5Fdfg==","Date":"Wed, 21 Sep 2022 20:03:30 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20220921180330.6vjuextovm2fd5k5@uno.localdomain>","References":"<20220908014200.28728-1-laurent.pinchart@ideasonboard.com>\n\t<20220908014200.28728-8-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220908014200.28728-8-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 07/32] ipa: libipa: algorithm:\n\tprocess(): Pass frame number","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]