[{"id":23033,"web_url":"https://patchwork.libcamera.org/comment/23033/","msgid":"<20220518074755.lak7awnst5gvfy7k@uno.localdomain>","date":"2022-05-18T07:47:55","subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Umang\n\nOn Tue, May 17, 2022 at 09:18:32PM +0200, Umang Jain via libcamera-devel wrote:\n> Currently we have a single structure of IPAFrameContext but\n> subsequently, we shall have a ring buffer (or similar) container\n> to keep IPAFrameContext structures for each frame.\n>\n> It would be a hassle to query out the frame context required for\n> process() (since they will reside in a ring buffer) by the IPA\n> for each process. Hence, prepare the process() libipa template to\n> accept a particular IPAFrameContext early on.\n>\n> As for this patch, we shall pass in the pointer as nullptr, so\n> that the changes compile and keep working as-is.\n>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n\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/algorithm.h      | 4 +++-\n>  src/ipa/ipu3/algorithms/awb.cpp          | 3 ++-\n>  src/ipa/ipu3/algorithms/awb.h            | 3 ++-\n>  src/ipa/ipu3/algorithms/tone_mapping.cpp | 3 ++-\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               | 4 +++-\n>  src/ipa/rkisp1/algorithms/agc.cpp        | 4 +++-\n>  src/ipa/rkisp1/algorithms/agc.h          | 3 ++-\n>  src/ipa/rkisp1/algorithms/algorithm.h    | 4 +++-\n>  src/ipa/rkisp1/algorithms/awb.cpp        | 4 +++-\n>  src/ipa/rkisp1/algorithms/awb.h          | 3 ++-\n>  src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>  18 files changed, 40 insertions(+), 17 deletions(-)\n>\n> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> index 8a5a6b1a..d07521a0 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] frameContext The current frame context\n>   * \\param[in] stats The statistics buffer of IPU3.\n>   *\n>   * Ideally, a clear image also has a relatively higher contrast. So, every\n> @@ -419,7 +420,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, const ipu3_uapi_stats_3a *stats)\n> +void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n> +\t\t const ipu3_uapi_stats_3a *stats)\n>  {\n>  \t/* Evaluate the AF buffer length */\n>  \tuint32_t afRawBufferLen = context.configuration.af.afGrid.width *\n> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n> index b85cf941..ccf015f3 100644\n> --- a/src/ipa/ipu3/algorithms/af.h\n> +++ b/src/ipa/ipu3/algorithms/af.h\n> @@ -32,7 +32,8 @@ public:\n>\n>  \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>  \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n> -\tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n>  \tvoid afCoarseScan(IPAContext &context);\n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index fdeec09d..383a8deb 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -318,12 +318,14 @@ 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] 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, const ipu3_uapi_stats_3a *stats)\n> +void Agc::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n> +\t\t  const ipu3_uapi_stats_3a *stats)\n>  {\n>  \t/*\n>  \t * Estimate the gain needed to have the proportion of pixels in a given\n> diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\n> index 31420841..219a1a96 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, const ipu3_uapi_stats_3a *stats) override;\n> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n>  \tdouble measureBrightness(const ipu3_uapi_stats_3a *stats,\n> diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h\n> index d2eecc78..234b2bd7 100644\n> --- a/src/ipa/ipu3/algorithms/algorithm.h\n> +++ b/src/ipa/ipu3/algorithms/algorithm.h\n> @@ -17,7 +17,9 @@ namespace libcamera {\n>\n>  namespace ipa::ipu3 {\n>\n> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAConfigInfo, ipu3_uapi_params, ipu3_uapi_stats_3a>;\n> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n> +\t\t\t\t\t    IPAConfigInfo, ipu3_uapi_params,\n> +\t\t\t\t\t    ipu3_uapi_stats_3a>;\n>\n>  } /* namespace ipa::ipu3 */\n>\n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index ab6924eb..5c232d92 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, const ipu3_uapi_stats_3a *stats)\n> +void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n> +\t\t  const ipu3_uapi_stats_3a *stats)\n>  {\n>  \tcalculateWBGains(stats);\n>\n> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n> index ab4b0a33..9a50a985 100644\n> --- a/src/ipa/ipu3/algorithms/awb.h\n> +++ b/src/ipa/ipu3/algorithms/awb.h\n> @@ -40,7 +40,8 @@ public:\n>\n>  \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n> -\tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n>  \t/* \\todo Make these structs available to all the ISPs ? */\n> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> index 7c78d0d9..f86e79b2 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> @@ -72,12 +72,13 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>  /**\n>   * \\brief Calculate the tone mapping look up table\n>   * \\param context The shared IPA context\n> + * \\param frameContext The current frame context\n>   * \\param 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,\n> +void ToneMapping::process(IPAContext &context, [[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 b727ab1e..d7d48006 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.h\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n> @@ -20,7 +20,8 @@ public:\n>\n>  \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n> -\tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>\n>  private:\n>  \tdouble gamma_;\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 3b4fc911..16e5028f 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -576,7 +576,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_, stats);\n> +\t\talgo->process(context_, nullptr, stats);\n>\n>  \tsetControls(frame);\n>\n> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n> index 398d5372..cce2ed62 100644\n> --- a/src/ipa/libipa/algorithm.cpp\n> +++ b/src/ipa/libipa/algorithm.cpp\n> @@ -64,6 +64,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] frameContext The current frame's context\n>   * \\param[in] stats The IPA statistics and ISP results\n>   *\n>   * This function is called while camera is running for every frame processed by\n> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n> index 766aee5d..032a05b5 100644\n> --- a/src/ipa/libipa/algorithm.h\n> +++ b/src/ipa/libipa/algorithm.h\n> @@ -10,7 +10,8 @@ namespace libcamera {\n>\n>  namespace ipa {\n>\n> -template<typename Context, typename Config, typename Params, typename Stats>\n> +template<typename Context, typename FrameContext, typename Config,\n> +\t typename Params, typename Stats>\n>  class Algorithm\n>  {\n>  public:\n> @@ -28,6 +29,7 @@ public:\n>  \t}\n>\n>  \tvirtual void process([[maybe_unused]] Context &context,\n> +\t\t\t     [[maybe_unused]] FrameContext *frameContext,\n>  \t\t\t     [[maybe_unused]] const Stats *stats)\n>  \t{\n>  \t}\n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 5f4c3f93..b5a184d9 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -280,7 +280,9 @@ 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, const rkisp1_stat_buffer *stats)\n> +void Agc::process(IPAContext &context,\n> +\t\t  [[maybe_unused]] IPAFrameContext *frameContext,\n> +\t\t  const rkisp1_stat_buffer *stats)\n>  {\n>  \tconst rkisp1_cif_isp_stat *params = &stats->params;\n>  \tASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\n> index ce1adf27..22c02779 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.h\n> +++ b/src/ipa/rkisp1/algorithms/agc.h\n> @@ -29,7 +29,8 @@ public:\n>\n>  \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n> -\tvoid process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n> +\t\t     const rkisp1_stat_buffer *stats) override;\n>\n>  private:\n>  \tvoid computeExposure(IPAContext &Context, double yGain, double iqMeanGain);\n> diff --git a/src/ipa/rkisp1/algorithms/algorithm.h b/src/ipa/rkisp1/algorithms/algorithm.h\n> index d46c3188..68e3a44e 100644\n> --- a/src/ipa/rkisp1/algorithms/algorithm.h\n> +++ b/src/ipa/rkisp1/algorithms/algorithm.h\n> @@ -19,7 +19,9 @@ namespace libcamera {\n>\n>  namespace ipa::rkisp1 {\n>\n> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPACameraSensorInfo, rkisp1_params_cfg, rkisp1_stat_buffer>;\n> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n> +\t\t\t\t\t    IPACameraSensorInfo, rkisp1_params_cfg,\n> +\t\t\t\t\t    rkisp1_stat_buffer>;\n>\n>  } /* namespace ipa::rkisp1 */\n>\n> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n> index be4585c6..88441382 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n> @@ -119,7 +119,9 @@ void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params)\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::process\n>   */\n> -void Awb::process([[maybe_unused]] IPAContext &context, const rkisp1_stat_buffer *stats)\n> +void Awb::process([[maybe_unused]] IPAContext &context,\n> +\t\t  [[maybe_unused]] IPAFrameContext *frameCtx,\n> +\t\t  const rkisp1_stat_buffer *stats)\n>  {\n>  \tconst rkisp1_cif_isp_stat *params = &stats->params;\n>  \tconst rkisp1_cif_isp_awb_stat *awb = &params->awb;\n> diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\n> index 11946643..7647842f 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.h\n> +++ b/src/ipa/rkisp1/algorithms/awb.h\n> @@ -23,7 +23,8 @@ public:\n>\n>  \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n> -\tvoid process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n> +\tvoid process(IPAContext &context, IPAFrameContext *frameCtx,\n> +\t\t     const rkisp1_stat_buffer *stats) override;\n>\n>  private:\n>  \tuint32_t estimateCCT(double red, double green, double blue);\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index ef1f0d56..c818a6d7 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -272,7 +272,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n>  \tunsigned int aeState = 0;\n>\n>  \tfor (auto const &algo : algorithms_)\n> -\t\talgo->process(context_, stats);\n> +\t\talgo->process(context_, nullptr, stats);\n>\n>  \tsetControls(frame);\n>\n> --\n> 2.31.0\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 7509FC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 07:48:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 233AE6565B;\n\tWed, 18 May 2022 09:48:00 +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 599A761FB9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 09:47:58 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 7FCA81C000E;\n\tWed, 18 May 2022 07:47:57 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652860080;\n\tbh=RNFuJp2gLY+hUwVm+4Y4/5EMfvk1QCKJuf21hwJohbY=;\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=Od4w0J7wCJpwvi1oHvqvZ0/mYkjuFXz0eJwhEoSAVZm5pLTsGmK7S6W6ZPShyb1EN\n\tljKVTOKY1BNLniEAfbTXrquufBtZ3tx6Y3u388rCOjEiDuPDPcFUdeqJ5ye1nfZ0O8\n\tsW8mSJuv+v9ErxNg0kx+QuI9iHQdnL01DYDYygXzFTXUJL+dEL3c87sbesjWik4THe\n\tmK8aAPLqn8AS40r0oQQKJOqq7vb88nNUMZUWIxsDpSW+4cUZXsSX6FKbj9riNA/mye\n\t0wsdE7U1fSfJRXIaW0qvEc6husSOdlRBArokBSFtXMssREHt0fiy5f2Sn/iI8jUMo5\n\tpwT3lU8BMyqNQ==","Date":"Wed, 18 May 2022 09:47:55 +0200","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<20220518074755.lak7awnst5gvfy7k@uno.localdomain>","References":"<20220517191833.333122-1-umang.jain@ideasonboard.com>\n\t<20220517191833.333122-3-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220517191833.333122-3-umang.jain@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","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>"}},{"id":23035,"web_url":"https://patchwork.libcamera.org/comment/23035/","msgid":"<3a370b38-e886-455f-1799-40d428b8d038@ideasonboard.com>","date":"2022-05-18T09:00:45","subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"Hi Umang,\n\nOn 18/05/2022 09:47, Jacopo Mondi via libcamera-devel wrote:\n> Hi Umang\n> \n> On Tue, May 17, 2022 at 09:18:32PM +0200, Umang Jain via libcamera-devel wrote:\n>> Currently we have a single structure of IPAFrameContext but\n>> subsequently, we shall have a ring buffer (or similar) container\n>> to keep IPAFrameContext structures for each frame.\n>>\n>> It would be a hassle to query out the frame context required for\n>> process() (since they will reside in a ring buffer) by the IPA\n>> for each process. Hence, prepare the process() libipa template to\n>> accept a particular IPAFrameContext early on.\n>>\n>> As for this patch, we shall pass in the pointer as nullptr, so\n>> that the changes compile and keep working as-is.\n>>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> \n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n> \n> Thanks\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/algorithm.h      | 4 +++-\n>>   src/ipa/ipu3/algorithms/awb.cpp          | 3 ++-\n>>   src/ipa/ipu3/algorithms/awb.h            | 3 ++-\n>>   src/ipa/ipu3/algorithms/tone_mapping.cpp | 3 ++-\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               | 4 +++-\n>>   src/ipa/rkisp1/algorithms/agc.cpp        | 4 +++-\n>>   src/ipa/rkisp1/algorithms/agc.h          | 3 ++-\n>>   src/ipa/rkisp1/algorithms/algorithm.h    | 4 +++-\n>>   src/ipa/rkisp1/algorithms/awb.cpp        | 4 +++-\n>>   src/ipa/rkisp1/algorithms/awb.h          | 3 ++-\n>>   src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>>   18 files changed, 40 insertions(+), 17 deletions(-)\n>>\n>> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n>> index 8a5a6b1a..d07521a0 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] frameContext The current frame context\n>>    * \\param[in] stats The statistics buffer of IPU3.\n>>    *\n>>    * Ideally, a clear image also has a relatively higher contrast. So, every\n>> @@ -419,7 +420,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, const ipu3_uapi_stats_3a *stats)\n>> +void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n>> +\t\t const ipu3_uapi_stats_3a *stats)\n>>   {\n>>   \t/* Evaluate the AF buffer length */\n>>   \tuint32_t afRawBufferLen = context.configuration.af.afGrid.width *\n>> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n>> index b85cf941..ccf015f3 100644\n>> --- a/src/ipa/ipu3/algorithms/af.h\n>> +++ b/src/ipa/ipu3/algorithms/af.h\n>> @@ -32,7 +32,8 @@ public:\n>>\n>>   \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>>   \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>> -\tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n>> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>>\n>>   private:\n>>   \tvoid afCoarseScan(IPAContext &context);\n>> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n>> index fdeec09d..383a8deb 100644\n>> --- a/src/ipa/ipu3/algorithms/agc.cpp\n>> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n>> @@ -318,12 +318,14 @@ 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] 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, const ipu3_uapi_stats_3a *stats)\n>> +void Agc::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n>> +\t\t  const ipu3_uapi_stats_3a *stats)\n>>   {\n>>   \t/*\n>>   \t * Estimate the gain needed to have the proportion of pixels in a given\n>> diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\n>> index 31420841..219a1a96 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, const ipu3_uapi_stats_3a *stats) override;\n>> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n>> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>>\n>>   private:\n>>   \tdouble measureBrightness(const ipu3_uapi_stats_3a *stats,\n>> diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h\n>> index d2eecc78..234b2bd7 100644\n>> --- a/src/ipa/ipu3/algorithms/algorithm.h\n>> +++ b/src/ipa/ipu3/algorithms/algorithm.h\n>> @@ -17,7 +17,9 @@ namespace libcamera {\n>>\n>>   namespace ipa::ipu3 {\n>>\n>> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAConfigInfo, ipu3_uapi_params, ipu3_uapi_stats_3a>;\n>> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n>> +\t\t\t\t\t    IPAConfigInfo, ipu3_uapi_params,\n>> +\t\t\t\t\t    ipu3_uapi_stats_3a>;\n>>\n>>   } /* namespace ipa::ipu3 */\n>>\n>> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n>> index ab6924eb..5c232d92 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, const ipu3_uapi_stats_3a *stats)\n>> +void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n>> +\t\t  const ipu3_uapi_stats_3a *stats)\n>>   {\n>>   \tcalculateWBGains(stats);\n>>\n>> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n>> index ab4b0a33..9a50a985 100644\n>> --- a/src/ipa/ipu3/algorithms/awb.h\n>> +++ b/src/ipa/ipu3/algorithms/awb.h\n>> @@ -40,7 +40,8 @@ public:\n>>\n>>   \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>>   \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>> -\tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n>> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>>\n>>   private:\n>>   \t/* \\todo Make these structs available to all the ISPs ? */\n>> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n>> index 7c78d0d9..f86e79b2 100644\n>> --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n>> +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n>> @@ -72,12 +72,13 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>>   /**\n>>    * \\brief Calculate the tone mapping look up table\n>>    * \\param context The shared IPA context\n>> + * \\param frameContext The current frame context\n>>    * \\param 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,\n>> +void ToneMapping::process(IPAContext &context, [[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 b727ab1e..d7d48006 100644\n>> --- a/src/ipa/ipu3/algorithms/tone_mapping.h\n>> +++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n>> @@ -20,7 +20,8 @@ public:\n>>\n>>   \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>>   \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>> -\tvoid process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n>> +\t\t     const ipu3_uapi_stats_3a *stats) override;\n>>\n>>   private:\n>>   \tdouble gamma_;\n>> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n>> index 3b4fc911..16e5028f 100644\n>> --- a/src/ipa/ipu3/ipu3.cpp\n>> +++ b/src/ipa/ipu3/ipu3.cpp\n>> @@ -576,7 +576,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_, stats);\n>> +\t\talgo->process(context_, nullptr, stats);\n>>\n>>   \tsetControls(frame);\n>>\n>> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n>> index 398d5372..cce2ed62 100644\n>> --- a/src/ipa/libipa/algorithm.cpp\n>> +++ b/src/ipa/libipa/algorithm.cpp\n>> @@ -64,6 +64,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] frameContext The current frame's context\n>>    * \\param[in] stats The IPA statistics and ISP results\n>>    *\n>>    * This function is called while camera is running for every frame processed by\n>> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n>> index 766aee5d..032a05b5 100644\n>> --- a/src/ipa/libipa/algorithm.h\n>> +++ b/src/ipa/libipa/algorithm.h\n>> @@ -10,7 +10,8 @@ namespace libcamera {\n>>\n>>   namespace ipa {\n>>\n>> -template<typename Context, typename Config, typename Params, typename Stats>\n>> +template<typename Context, typename FrameContext, typename Config,\n>> +\t typename Params, typename Stats>\n\nI am wondering if these namings could be confusing. Maybe Context should \nbe called State and then, you would  get the FrameContext of this State \npassed down to the algorithm ?\n\nNevertheless,\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\n>>   class Algorithm\n>>   {\n>>   public:\n>> @@ -28,6 +29,7 @@ public:\n>>   \t}\n>>\n>>   \tvirtual void process([[maybe_unused]] Context &context,\n>> +\t\t\t     [[maybe_unused]] FrameContext *frameContext,\n>>   \t\t\t     [[maybe_unused]] const Stats *stats)\n>>   \t{\n>>   \t}\n>> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n>> index 5f4c3f93..b5a184d9 100644\n>> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n>> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n>> @@ -280,7 +280,9 @@ 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, const rkisp1_stat_buffer *stats)\n>> +void Agc::process(IPAContext &context,\n>> +\t\t  [[maybe_unused]] IPAFrameContext *frameContext,\n>> +\t\t  const rkisp1_stat_buffer *stats)\n>>   {\n>>   \tconst rkisp1_cif_isp_stat *params = &stats->params;\n>>   \tASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n>> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\n>> index ce1adf27..22c02779 100644\n>> --- a/src/ipa/rkisp1/algorithms/agc.h\n>> +++ b/src/ipa/rkisp1/algorithms/agc.h\n>> @@ -29,7 +29,8 @@ public:\n>>\n>>   \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>>   \tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n>> -\tvoid process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n>> +\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n>> +\t\t     const rkisp1_stat_buffer *stats) override;\n>>\n>>   private:\n>>   \tvoid computeExposure(IPAContext &Context, double yGain, double iqMeanGain);\n>> diff --git a/src/ipa/rkisp1/algorithms/algorithm.h b/src/ipa/rkisp1/algorithms/algorithm.h\n>> index d46c3188..68e3a44e 100644\n>> --- a/src/ipa/rkisp1/algorithms/algorithm.h\n>> +++ b/src/ipa/rkisp1/algorithms/algorithm.h\n>> @@ -19,7 +19,9 @@ namespace libcamera {\n>>\n>>   namespace ipa::rkisp1 {\n>>\n>> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPACameraSensorInfo, rkisp1_params_cfg, rkisp1_stat_buffer>;\n>> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n>> +\t\t\t\t\t    IPACameraSensorInfo, rkisp1_params_cfg,\n>> +\t\t\t\t\t    rkisp1_stat_buffer>;\n>>\n>>   } /* namespace ipa::rkisp1 */\n>>\n>> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n>> index be4585c6..88441382 100644\n>> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n>> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n>> @@ -119,7 +119,9 @@ void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params)\n>>   /**\n>>    * \\copydoc libcamera::ipa::Algorithm::process\n>>    */\n>> -void Awb::process([[maybe_unused]] IPAContext &context, const rkisp1_stat_buffer *stats)\n>> +void Awb::process([[maybe_unused]] IPAContext &context,\n>> +\t\t  [[maybe_unused]] IPAFrameContext *frameCtx,\n>> +\t\t  const rkisp1_stat_buffer *stats)\n>>   {\n>>   \tconst rkisp1_cif_isp_stat *params = &stats->params;\n>>   \tconst rkisp1_cif_isp_awb_stat *awb = &params->awb;\n>> diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\n>> index 11946643..7647842f 100644\n>> --- a/src/ipa/rkisp1/algorithms/awb.h\n>> +++ b/src/ipa/rkisp1/algorithms/awb.h\n>> @@ -23,7 +23,8 @@ public:\n>>\n>>   \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>>   \tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n>> -\tvoid process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n>> +\tvoid process(IPAContext &context, IPAFrameContext *frameCtx,\n>> +\t\t     const rkisp1_stat_buffer *stats) override;\n>>\n>>   private:\n>>   \tuint32_t estimateCCT(double red, double green, double blue);\n>> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n>> index ef1f0d56..c818a6d7 100644\n>> --- a/src/ipa/rkisp1/rkisp1.cpp\n>> +++ b/src/ipa/rkisp1/rkisp1.cpp\n>> @@ -272,7 +272,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n>>   \tunsigned int aeState = 0;\n>>\n>>   \tfor (auto const &algo : algorithms_)\n>> -\t\talgo->process(context_, stats);\n>> +\t\talgo->process(context_, nullptr, stats);\n>>\n>>   \tsetControls(frame);\n>>\n>> --\n>> 2.31.0\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 B3AF3C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 09:00:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9683E65655;\n\tWed, 18 May 2022 11:00:52 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9564A61FB9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 11:00:50 +0200 (CEST)","from [192.168.106.15] (unknown [37.171.4.20])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4928548F;\n\tWed, 18 May 2022 11:00:49 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652864452;\n\tbh=v+KIfFv5hG7UFiKEuaNAHCtVj6/qTkEW8cyAHEpkr3A=;\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=tWOANdCPLf9jvizoJoOAJqPXfs3Sz1wILPh0XdQp1Oo098QXN5KOfbZrgKlXBaqWl\n\tXgyrgcQhieqeDSK1j6xh/wDEBDKSjZts/mTdKXSTuSAnfgK8PlaC5GUGCjxNZYtt5s\n\t6iH2jmZ02mHsKEjtr0G5Xhu+4gTuTWcEGt5RkUKrENFnhe/w6z119Ojh06DS9hXUqA\n\tcWeW9BOPh1yj+mVmUGkibfZJDyDsnsJl8LLondbYD67QC+xU44qQOEEgY35tS9+plN\n\tMYZPfpKoYOmMfAaaFdxT2XqGW/N30D44zZVPbpzFIgcsG+a/ytGkc2AG4NBOMEaOY1\n\tmd3apJs8nTmYQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652864450;\n\tbh=v+KIfFv5hG7UFiKEuaNAHCtVj6/qTkEW8cyAHEpkr3A=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=tXTthAfvwmbBwJR7cPebe50zgIYUMX1YetNo5rhn8ZdyUxPd5xonO2k808h6OZvKu\n\tBPldyd7u3efvpg9TXVm0oabRt306RHovX1EyIh5pc1aW0bz6oIK4U+jeGfusTuGosA\n\tn4ebivf1ZPw4rpDoKSdPu5PhIswXUz9IXViIgatc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"tXTthAfv\"; dkim-atps=neutral","Message-ID":"<3a370b38-e886-455f-1799-40d428b8d038@ideasonboard.com>","Date":"Wed, 18 May 2022 11:00:45 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.8.1","Content-Language":"en-US","To":"Jacopo Mondi <jacopo@jmondi.org>,\n\tUmang Jain <umang.jain@ideasonboard.com>","References":"<20220517191833.333122-1-umang.jain@ideasonboard.com>\n\t<20220517191833.333122-3-umang.jain@ideasonboard.com>\n\t<20220518074755.lak7awnst5gvfy7k@uno.localdomain>","In-Reply-To":"<20220518074755.lak7awnst5gvfy7k@uno.localdomain>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","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":"Jean-Michel Hautbois via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23042,"web_url":"https://patchwork.libcamera.org/comment/23042/","msgid":"<165287011794.368702.2139365513535205752@Monstersaurus>","date":"2022-05-18T10:35:17","subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Umang Jain via libcamera-devel (2022-05-17 20:18:32)\n> Currently we have a single structure of IPAFrameContext but\n> subsequently, we shall have a ring buffer (or similar) container\n> to keep IPAFrameContext structures for each frame.\n> \n> It would be a hassle to query out the frame context required for\n> process() (since they will reside in a ring buffer) by the IPA\n> for each process. Hence, prepare the process() libipa template to\n> accept a particular IPAFrameContext early on.\n> \n> As for this patch, we shall pass in the pointer as nullptr, so\n> that the changes compile and keep working as-is.\n> \n\nGreat, yes this simplifies getting this done for IPU3.\n\nI believe the FrameContext will become an inherent design requirement\nfor the IPA and algorithm class when libipa is used, so I would expect\nthat once IPU3 is done, we should add the same to the RKISP, and then\nconvert this paramter from a pointer to a reference to enforce that any\nnew implementation should implement a ring buffer for the contexts from\nthe start. (but with two existing implementations, that's fine).\n\nAs JM says, now we have context and frameContext, but I'm not sure how\nto make that clearer yet. But that could also be updated on top.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\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/algorithm.h      | 4 +++-\n>  src/ipa/ipu3/algorithms/awb.cpp          | 3 ++-\n>  src/ipa/ipu3/algorithms/awb.h            | 3 ++-\n>  src/ipa/ipu3/algorithms/tone_mapping.cpp | 3 ++-\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               | 4 +++-\n>  src/ipa/rkisp1/algorithms/agc.cpp        | 4 +++-\n>  src/ipa/rkisp1/algorithms/agc.h          | 3 ++-\n>  src/ipa/rkisp1/algorithms/algorithm.h    | 4 +++-\n>  src/ipa/rkisp1/algorithms/awb.cpp        | 4 +++-\n>  src/ipa/rkisp1/algorithms/awb.h          | 3 ++-\n>  src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>  18 files changed, 40 insertions(+), 17 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n> index 8a5a6b1a..d07521a0 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] frameContext The current frame context\n>   * \\param[in] stats The statistics buffer of IPU3.\n>   *\n>   * Ideally, a clear image also has a relatively higher contrast. So, every\n> @@ -419,7 +420,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, const ipu3_uapi_stats_3a *stats)\n> +void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n> +                const ipu3_uapi_stats_3a *stats)\n>  {\n>         /* Evaluate the AF buffer length */\n>         uint32_t afRawBufferLen = context.configuration.af.afGrid.width *\n> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n> index b85cf941..ccf015f3 100644\n> --- a/src/ipa/ipu3/algorithms/af.h\n> +++ b/src/ipa/ipu3/algorithms/af.h\n> @@ -32,7 +32,8 @@ public:\n>  \n>         void prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>         int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n> -       void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n> +                    const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n>         void afCoarseScan(IPAContext &context);\n> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n> index fdeec09d..383a8deb 100644\n> --- a/src/ipa/ipu3/algorithms/agc.cpp\n> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n> @@ -318,12 +318,14 @@ 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] 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, const ipu3_uapi_stats_3a *stats)\n> +void Agc::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n> +                 const ipu3_uapi_stats_3a *stats)\n>  {\n>         /*\n>          * Estimate the gain needed to have the proportion of pixels in a given\n> diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\n> index 31420841..219a1a96 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, const ipu3_uapi_stats_3a *stats) override;\n> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n> +                    const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n>         double measureBrightness(const ipu3_uapi_stats_3a *stats,\n> diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h\n> index d2eecc78..234b2bd7 100644\n> --- a/src/ipa/ipu3/algorithms/algorithm.h\n> +++ b/src/ipa/ipu3/algorithms/algorithm.h\n> @@ -17,7 +17,9 @@ namespace libcamera {\n>  \n>  namespace ipa::ipu3 {\n>  \n> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAConfigInfo, ipu3_uapi_params, ipu3_uapi_stats_3a>;\n> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n> +                                           IPAConfigInfo, ipu3_uapi_params,\n> +                                           ipu3_uapi_stats_3a>;\n>  \n>  } /* namespace ipa::ipu3 */\n>  \n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index ab6924eb..5c232d92 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, const ipu3_uapi_stats_3a *stats)\n> +void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n> +                 const ipu3_uapi_stats_3a *stats)\n>  {\n>         calculateWBGains(stats);\n>  \n> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n> index ab4b0a33..9a50a985 100644\n> --- a/src/ipa/ipu3/algorithms/awb.h\n> +++ b/src/ipa/ipu3/algorithms/awb.h\n> @@ -40,7 +40,8 @@ public:\n>  \n>         int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>         void prepare(IPAContext &context, ipu3_uapi_params *params) override;\n> -       void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n> +                    const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n>         /* \\todo Make these structs available to all the ISPs ? */\n> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> index 7c78d0d9..f86e79b2 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n> @@ -72,12 +72,13 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>  /**\n>   * \\brief Calculate the tone mapping look up table\n>   * \\param context The shared IPA context\n> + * \\param frameContext The current frame context\n>   * \\param 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,\n> +void ToneMapping::process(IPAContext &context, [[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 b727ab1e..d7d48006 100644\n> --- a/src/ipa/ipu3/algorithms/tone_mapping.h\n> +++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n> @@ -20,7 +20,8 @@ public:\n>  \n>         int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>         void prepare(IPAContext &context, ipu3_uapi_params *params) override;\n> -       void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n> +                    const ipu3_uapi_stats_3a *stats) override;\n>  \n>  private:\n>         double gamma_;\n> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n> index 3b4fc911..16e5028f 100644\n> --- a/src/ipa/ipu3/ipu3.cpp\n> +++ b/src/ipa/ipu3/ipu3.cpp\n> @@ -576,7 +576,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n>         ControlList ctrls(controls::controls);\n>  \n>         for (auto const &algo : algorithms_)\n> -               algo->process(context_, stats);\n> +               algo->process(context_, nullptr, stats);\n>  \n>         setControls(frame);\n>  \n> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n> index 398d5372..cce2ed62 100644\n> --- a/src/ipa/libipa/algorithm.cpp\n> +++ b/src/ipa/libipa/algorithm.cpp\n> @@ -64,6 +64,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] frameContext The current frame's context\n>   * \\param[in] stats The IPA statistics and ISP results\n>   *\n>   * This function is called while camera is running for every frame processed by\n> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n> index 766aee5d..032a05b5 100644\n> --- a/src/ipa/libipa/algorithm.h\n> +++ b/src/ipa/libipa/algorithm.h\n> @@ -10,7 +10,8 @@ namespace libcamera {\n>  \n>  namespace ipa {\n>  \n> -template<typename Context, typename Config, typename Params, typename Stats>\n> +template<typename Context, typename FrameContext, typename Config,\n> +        typename Params, typename Stats>\n>  class Algorithm\n>  {\n>  public:\n> @@ -28,6 +29,7 @@ public:\n>         }\n>  \n>         virtual void process([[maybe_unused]] Context &context,\n> +                            [[maybe_unused]] FrameContext *frameContext,\n>                              [[maybe_unused]] const Stats *stats)\n>         {\n>         }\n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index 5f4c3f93..b5a184d9 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -280,7 +280,9 @@ 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, const rkisp1_stat_buffer *stats)\n> +void Agc::process(IPAContext &context,\n> +                 [[maybe_unused]] IPAFrameContext *frameContext,\n> +                 const rkisp1_stat_buffer *stats)\n>  {\n>         const rkisp1_cif_isp_stat *params = &stats->params;\n>         ASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\n> index ce1adf27..22c02779 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.h\n> +++ b/src/ipa/rkisp1/algorithms/agc.h\n> @@ -29,7 +29,8 @@ public:\n>  \n>         int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>         void prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n> -       void process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n> +                    const rkisp1_stat_buffer *stats) override;\n>  \n>  private:\n>         void computeExposure(IPAContext &Context, double yGain, double iqMeanGain);\n> diff --git a/src/ipa/rkisp1/algorithms/algorithm.h b/src/ipa/rkisp1/algorithms/algorithm.h\n> index d46c3188..68e3a44e 100644\n> --- a/src/ipa/rkisp1/algorithms/algorithm.h\n> +++ b/src/ipa/rkisp1/algorithms/algorithm.h\n> @@ -19,7 +19,9 @@ namespace libcamera {\n>  \n>  namespace ipa::rkisp1 {\n>  \n> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPACameraSensorInfo, rkisp1_params_cfg, rkisp1_stat_buffer>;\n> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n> +                                           IPACameraSensorInfo, rkisp1_params_cfg,\n> +                                           rkisp1_stat_buffer>;\n>  \n>  } /* namespace ipa::rkisp1 */\n>  \n> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n> index be4585c6..88441382 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n> @@ -119,7 +119,9 @@ void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params)\n>  /**\n>   * \\copydoc libcamera::ipa::Algorithm::process\n>   */\n> -void Awb::process([[maybe_unused]] IPAContext &context, const rkisp1_stat_buffer *stats)\n> +void Awb::process([[maybe_unused]] IPAContext &context,\n> +                 [[maybe_unused]] IPAFrameContext *frameCtx,\n> +                 const rkisp1_stat_buffer *stats)\n>  {\n>         const rkisp1_cif_isp_stat *params = &stats->params;\n>         const rkisp1_cif_isp_awb_stat *awb = &params->awb;\n> diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\n> index 11946643..7647842f 100644\n> --- a/src/ipa/rkisp1/algorithms/awb.h\n> +++ b/src/ipa/rkisp1/algorithms/awb.h\n> @@ -23,7 +23,8 @@ public:\n>  \n>         int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>         void prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n> -       void process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n> +       void process(IPAContext &context, IPAFrameContext *frameCtx,\n> +                    const rkisp1_stat_buffer *stats) override;\n>  \n>  private:\n>         uint32_t estimateCCT(double red, double green, double blue);\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index ef1f0d56..c818a6d7 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -272,7 +272,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n>         unsigned int aeState = 0;\n>  \n>         for (auto const &algo : algorithms_)\n> -               algo->process(context_, stats);\n> +               algo->process(context_, nullptr, stats);\n>  \n>         setControls(frame);\n>  \n> -- \n> 2.31.0\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 89D92C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 10:35:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 40E7565659;\n\tWed, 18 May 2022 12:35:22 +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 9BD2965656\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 12:35:20 +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 529249F7;\n\tWed, 18 May 2022 12:35:20 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652870122;\n\tbh=7GLMmi7+eQiciTJn5mGreD3PqKZWBbKOv8kPXtlkdGI=;\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=rf+W+Hq7PD2co9igLxq5z8ZFOyvZnUXpq9bKGTj5t0Psu/hQEvZcUZD5ilfE9btHn\n\tc7t2i28E/p9XY8Z/bN6CZPy3ksBJuuvBFAcjLF/3jkmELSfwehK7291mvQZH280IIT\n\twJ2+YqxDeMx43LaMzvALUlZXeAwssVv7Imi3lrAxKqhTTKnYfgakwUkv2r9/f7tzkg\n\t95Co4N68dB1J25V3Qe00GD2/Z5IkeM+vJtSxpO/zRI3oxODNv0ELtSDb4I4buxPBug\n\tVmF3Fx0wQf/y4vCMfcSE/uLyEdQ5v7Q6Jx4ZEWyS1RY5fw3EwN0gsCkSO5czxjdKmW\n\teBFtMc4U0CnTA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652870120;\n\tbh=7GLMmi7+eQiciTJn5mGreD3PqKZWBbKOv8kPXtlkdGI=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=DD9g5l0AqBBELzzDM71aNWUkgcbhF7lvHt991BTqiEQyKyHC8DMP7anOCi/3BkZX7\n\tN4vUMZsGR9G2O5SbqKPNdXx0qfSm/DrHc1QdmYoLtag/DCxfAWWcddOmFfqfGPn7ZG\n\tI+o9LQPkJbJfTh1MUTaPsBr77NCMEVBQm1K7txH0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DD9g5l0A\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220517191833.333122-3-umang.jain@ideasonboard.com>","References":"<20220517191833.333122-1-umang.jain@ideasonboard.com>\n\t<20220517191833.333122-3-umang.jain@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 18 May 2022 11:35:17 +0100","Message-ID":"<165287011794.368702.2139365513535205752@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","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":23047,"web_url":"https://patchwork.libcamera.org/comment/23047/","msgid":"<9f5b5024-4e0c-6bd7-b5e8-4de0b8b287a2@ideasonboard.com>","date":"2022-05-18T11:21:17","subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Kieran,\n\nOn 5/18/22 12:35, Kieran Bingham wrote:\n> Quoting Umang Jain via libcamera-devel (2022-05-17 20:18:32)\n>> Currently we have a single structure of IPAFrameContext but\n>> subsequently, we shall have a ring buffer (or similar) container\n>> to keep IPAFrameContext structures for each frame.\n>>\n>> It would be a hassle to query out the frame context required for\n>> process() (since they will reside in a ring buffer) by the IPA\n>> for each process. Hence, prepare the process() libipa template to\n>> accept a particular IPAFrameContext early on.\n>>\n>> As for this patch, we shall pass in the pointer as nullptr, so\n>> that the changes compile and keep working as-is.\n>>\n> Great, yes this simplifies getting this done for IPU3.\n>\n> I believe the FrameContext will become an inherent design requirement\n> for the IPA and algorithm class when libipa is used, so I would expect\n> that once IPU3 is done, we should add the same to the RKISP, and then\n> convert this paramter from a pointer to a reference to enforce that any\n> new implementation should implement a ring buffer for the contexts from\n> the start. (but with two existing implementations, that's fine).\n>\n> As JM says, now we have context and frameContext, but I'm not sure how\n> to make that clearer yet. But that could also be updated on top.\n\n\nIf we want to bikeshed the names of various context structures, a good \ntime will be after we land this series but before I start implementing \nall this stuff for RkISP.\n\n>\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n>\n>> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\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/algorithm.h      | 4 +++-\n>>   src/ipa/ipu3/algorithms/awb.cpp          | 3 ++-\n>>   src/ipa/ipu3/algorithms/awb.h            | 3 ++-\n>>   src/ipa/ipu3/algorithms/tone_mapping.cpp | 3 ++-\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               | 4 +++-\n>>   src/ipa/rkisp1/algorithms/agc.cpp        | 4 +++-\n>>   src/ipa/rkisp1/algorithms/agc.h          | 3 ++-\n>>   src/ipa/rkisp1/algorithms/algorithm.h    | 4 +++-\n>>   src/ipa/rkisp1/algorithms/awb.cpp        | 4 +++-\n>>   src/ipa/rkisp1/algorithms/awb.h          | 3 ++-\n>>   src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>>   18 files changed, 40 insertions(+), 17 deletions(-)\n>>\n>> diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\n>> index 8a5a6b1a..d07521a0 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] frameContext The current frame context\n>>    * \\param[in] stats The statistics buffer of IPU3.\n>>    *\n>>    * Ideally, a clear image also has a relatively higher contrast. So, every\n>> @@ -419,7 +420,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, const ipu3_uapi_stats_3a *stats)\n>> +void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n>> +                const ipu3_uapi_stats_3a *stats)\n>>   {\n>>          /* Evaluate the AF buffer length */\n>>          uint32_t afRawBufferLen = context.configuration.af.afGrid.width *\n>> diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\n>> index b85cf941..ccf015f3 100644\n>> --- a/src/ipa/ipu3/algorithms/af.h\n>> +++ b/src/ipa/ipu3/algorithms/af.h\n>> @@ -32,7 +32,8 @@ public:\n>>   \n>>          void prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>>          int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>> -       void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n>> +                    const ipu3_uapi_stats_3a *stats) override;\n>>   \n>>   private:\n>>          void afCoarseScan(IPAContext &context);\n>> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\n>> index fdeec09d..383a8deb 100644\n>> --- a/src/ipa/ipu3/algorithms/agc.cpp\n>> +++ b/src/ipa/ipu3/algorithms/agc.cpp\n>> @@ -318,12 +318,14 @@ 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] 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, const ipu3_uapi_stats_3a *stats)\n>> +void Agc::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n>> +                 const ipu3_uapi_stats_3a *stats)\n>>   {\n>>          /*\n>>           * Estimate the gain needed to have the proportion of pixels in a given\n>> diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\n>> index 31420841..219a1a96 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, const ipu3_uapi_stats_3a *stats) override;\n>> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n>> +                    const ipu3_uapi_stats_3a *stats) override;\n>>   \n>>   private:\n>>          double measureBrightness(const ipu3_uapi_stats_3a *stats,\n>> diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h\n>> index d2eecc78..234b2bd7 100644\n>> --- a/src/ipa/ipu3/algorithms/algorithm.h\n>> +++ b/src/ipa/ipu3/algorithms/algorithm.h\n>> @@ -17,7 +17,9 @@ namespace libcamera {\n>>   \n>>   namespace ipa::ipu3 {\n>>   \n>> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAConfigInfo, ipu3_uapi_params, ipu3_uapi_stats_3a>;\n>> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n>> +                                           IPAConfigInfo, ipu3_uapi_params,\n>> +                                           ipu3_uapi_stats_3a>;\n>>   \n>>   } /* namespace ipa::ipu3 */\n>>   \n>> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n>> index ab6924eb..5c232d92 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, const ipu3_uapi_stats_3a *stats)\n>> +void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n>> +                 const ipu3_uapi_stats_3a *stats)\n>>   {\n>>          calculateWBGains(stats);\n>>   \n>> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n>> index ab4b0a33..9a50a985 100644\n>> --- a/src/ipa/ipu3/algorithms/awb.h\n>> +++ b/src/ipa/ipu3/algorithms/awb.h\n>> @@ -40,7 +40,8 @@ public:\n>>   \n>>          int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>>          void prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>> -       void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n>> +                    const ipu3_uapi_stats_3a *stats) override;\n>>   \n>>   private:\n>>          /* \\todo Make these structs available to all the ISPs ? */\n>> diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n>> index 7c78d0d9..f86e79b2 100644\n>> --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n>> +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n>> @@ -72,12 +72,13 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n>>   /**\n>>    * \\brief Calculate the tone mapping look up table\n>>    * \\param context The shared IPA context\n>> + * \\param frameContext The current frame context\n>>    * \\param 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,\n>> +void ToneMapping::process(IPAContext &context, [[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 b727ab1e..d7d48006 100644\n>> --- a/src/ipa/ipu3/algorithms/tone_mapping.h\n>> +++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n>> @@ -20,7 +20,8 @@ public:\n>>   \n>>          int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>>          void prepare(IPAContext &context, ipu3_uapi_params *params) override;\n>> -       void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;\n>> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n>> +                    const ipu3_uapi_stats_3a *stats) override;\n>>   \n>>   private:\n>>          double gamma_;\n>> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\n>> index 3b4fc911..16e5028f 100644\n>> --- a/src/ipa/ipu3/ipu3.cpp\n>> +++ b/src/ipa/ipu3/ipu3.cpp\n>> @@ -576,7 +576,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n>>          ControlList ctrls(controls::controls);\n>>   \n>>          for (auto const &algo : algorithms_)\n>> -               algo->process(context_, stats);\n>> +               algo->process(context_, nullptr, stats);\n>>   \n>>          setControls(frame);\n>>   \n>> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp\n>> index 398d5372..cce2ed62 100644\n>> --- a/src/ipa/libipa/algorithm.cpp\n>> +++ b/src/ipa/libipa/algorithm.cpp\n>> @@ -64,6 +64,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] frameContext The current frame's context\n>>    * \\param[in] stats The IPA statistics and ISP results\n>>    *\n>>    * This function is called while camera is running for every frame processed by\n>> diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\n>> index 766aee5d..032a05b5 100644\n>> --- a/src/ipa/libipa/algorithm.h\n>> +++ b/src/ipa/libipa/algorithm.h\n>> @@ -10,7 +10,8 @@ namespace libcamera {\n>>   \n>>   namespace ipa {\n>>   \n>> -template<typename Context, typename Config, typename Params, typename Stats>\n>> +template<typename Context, typename FrameContext, typename Config,\n>> +        typename Params, typename Stats>\n>>   class Algorithm\n>>   {\n>>   public:\n>> @@ -28,6 +29,7 @@ public:\n>>          }\n>>   \n>>          virtual void process([[maybe_unused]] Context &context,\n>> +                            [[maybe_unused]] FrameContext *frameContext,\n>>                               [[maybe_unused]] const Stats *stats)\n>>          {\n>>          }\n>> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n>> index 5f4c3f93..b5a184d9 100644\n>> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n>> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n>> @@ -280,7 +280,9 @@ 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, const rkisp1_stat_buffer *stats)\n>> +void Agc::process(IPAContext &context,\n>> +                 [[maybe_unused]] IPAFrameContext *frameContext,\n>> +                 const rkisp1_stat_buffer *stats)\n>>   {\n>>          const rkisp1_cif_isp_stat *params = &stats->params;\n>>          ASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);\n>> diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\n>> index ce1adf27..22c02779 100644\n>> --- a/src/ipa/rkisp1/algorithms/agc.h\n>> +++ b/src/ipa/rkisp1/algorithms/agc.h\n>> @@ -29,7 +29,8 @@ public:\n>>   \n>>          int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>>          void prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n>> -       void process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n>> +       void process(IPAContext &context, IPAFrameContext *frameContext,\n>> +                    const rkisp1_stat_buffer *stats) override;\n>>   \n>>   private:\n>>          void computeExposure(IPAContext &Context, double yGain, double iqMeanGain);\n>> diff --git a/src/ipa/rkisp1/algorithms/algorithm.h b/src/ipa/rkisp1/algorithms/algorithm.h\n>> index d46c3188..68e3a44e 100644\n>> --- a/src/ipa/rkisp1/algorithms/algorithm.h\n>> +++ b/src/ipa/rkisp1/algorithms/algorithm.h\n>> @@ -19,7 +19,9 @@ namespace libcamera {\n>>   \n>>   namespace ipa::rkisp1 {\n>>   \n>> -using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPACameraSensorInfo, rkisp1_params_cfg, rkisp1_stat_buffer>;\n>> +using Algorithm = libcamera::ipa::Algorithm<IPAContext, IPAFrameContext,\n>> +                                           IPACameraSensorInfo, rkisp1_params_cfg,\n>> +                                           rkisp1_stat_buffer>;\n>>   \n>>   } /* namespace ipa::rkisp1 */\n>>   \n>> diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\n>> index be4585c6..88441382 100644\n>> --- a/src/ipa/rkisp1/algorithms/awb.cpp\n>> +++ b/src/ipa/rkisp1/algorithms/awb.cpp\n>> @@ -119,7 +119,9 @@ void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params)\n>>   /**\n>>    * \\copydoc libcamera::ipa::Algorithm::process\n>>    */\n>> -void Awb::process([[maybe_unused]] IPAContext &context, const rkisp1_stat_buffer *stats)\n>> +void Awb::process([[maybe_unused]] IPAContext &context,\n>> +                 [[maybe_unused]] IPAFrameContext *frameCtx,\n>> +                 const rkisp1_stat_buffer *stats)\n>>   {\n>>          const rkisp1_cif_isp_stat *params = &stats->params;\n>>          const rkisp1_cif_isp_awb_stat *awb = &params->awb;\n>> diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\n>> index 11946643..7647842f 100644\n>> --- a/src/ipa/rkisp1/algorithms/awb.h\n>> +++ b/src/ipa/rkisp1/algorithms/awb.h\n>> @@ -23,7 +23,8 @@ public:\n>>   \n>>          int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n>>          void prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n>> -       void process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n>> +       void process(IPAContext &context, IPAFrameContext *frameCtx,\n>> +                    const rkisp1_stat_buffer *stats) override;\n>>   \n>>   private:\n>>          uint32_t estimateCCT(double red, double green, double blue);\n>> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n>> index ef1f0d56..c818a6d7 100644\n>> --- a/src/ipa/rkisp1/rkisp1.cpp\n>> +++ b/src/ipa/rkisp1/rkisp1.cpp\n>> @@ -272,7 +272,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n>>          unsigned int aeState = 0;\n>>   \n>>          for (auto const &algo : algorithms_)\n>> -               algo->process(context_, stats);\n>> +               algo->process(context_, nullptr, stats);\n>>   \n>>          setControls(frame);\n>>   \n>> -- \n>> 2.31.0\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 36E1CC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 11:21:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7A26165657;\n\tWed, 18 May 2022 13:21:24 +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 5BF3A65656\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 13:21:22 +0200 (CEST)","from [192.168.1.164] (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C717DE50;\n\tWed, 18 May 2022 13:21:21 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652872884;\n\tbh=tnnbfPX9T8qzhmZizbSoMWJqSh85bXFVpNZaASDsLtk=;\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=GqkYfpG7WCyWqMMRwU8E9YsvhVTATbEleMpcOXFGfx6Q/unvjR3OIOV/wsm65NRYo\n\tLQVt0K6DIUH7Ar0JBzomJYTGUZ822u5N/D6wdURvwt7fpUoCbcBHAPvvL0SKUBUKvO\n\tftYX4FT4CRkw8I+ZLQx+WdJfgZfn0eQUTEIqkFPMQlRn23sB7kdxM+ltUCXIhIHdww\n\tC54AuDKrCTXBLkE4AWSjBiv5LENB/DGMEQ947UOzE1I+Eyfc0YgQVjTVhbSQPD/TAT\n\tLULjnRAdjjpbt0/dQU7ZQRk52AkiJrvzVe46e/L5fxdmO5FOARDhjdR9IMCfwvL8+d\n\tdIYQ0E65RgEYw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652872882;\n\tbh=tnnbfPX9T8qzhmZizbSoMWJqSh85bXFVpNZaASDsLtk=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=L3etpz0JlCneSmuCvqv4ekeyvP5VZqtCL7OTtzR4ChH8BpGHtGPy9c+GSxVii73qO\n\taUJTqCnaO0XzSz3k1Ra7VEvETPTE5tUi1rC4Nct/YBZTjmp0aGQ7nc/xye+f0gcCTD\n\txT0GIWD5Bpwy/sYL30Y4jNKdBf0B/wL3zg/zQI7Q="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"L3etpz0J\"; dkim-atps=neutral","Message-ID":"<9f5b5024-4e0c-6bd7-b5e8-4de0b8b287a2@ideasonboard.com>","Date":"Wed, 18 May 2022 13:21:17 +0200","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":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220517191833.333122-1-umang.jain@ideasonboard.com>\n\t<20220517191833.333122-3-umang.jain@ideasonboard.com>\n\t<165287011794.368702.2139365513535205752@Monstersaurus>","In-Reply-To":"<165287011794.368702.2139365513535205752@Monstersaurus>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3 2/3] ipa: libipa: Add frame context\n\tpointer in process()","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>"}}]