[{"id":38723,"web_url":"https://patchwork.libcamera.org/comment/38723/","msgid":"<854ikm3v9w.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2026-05-05T12:17:47","subject":"Re: [PATCH] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi,\n\nthank you for the patches.\n\n(It would be better to send the patches as a series next time so that\ntheir ordering is clear.)\n\nd3vv3 <devve.3@gmail.com> writes:\n\n> Add configurable YAML parameters maxGainR, maxGainB, and speed to AWB.\n> Replace the single hardcoded max gain (4.0x) with per-channel limits,\n> and apply exponential moving average smoothing to reduce colour\n> temperature oscillation between frames.\n>\n> Signed-off-by: d3vv3 <devve.3@gmail.com>\n> ---\n>  src/ipa/simple/algorithms/awb.cpp | 34 ++++++++++++++++++++++++++-----\n>  src/ipa/simple/algorithms/awb.h   |  6 ++++++\n>  2 files changed, 35 insertions(+), 5 deletions(-)\n>\n> diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp\n> index f5c88ea6..0f9964a4 100644\n> --- a/src/ipa/simple/algorithms/awb.cpp\n> +++ b/src/ipa/simple/algorithms/awb.cpp\n> @@ -14,6 +14,8 @@\n>  \n>  #include <libcamera/control_ids.h>\n>  \n> +#include \"libcamera/internal/yaml_parser.h\"\n> +\n>  #include \"libipa/colours.h\"\n>  #include \"simple/ipa_context.h\"\n>  \n> @@ -23,6 +25,21 @@ LOG_DEFINE_CATEGORY(IPASoftAwb)\n>  \n>  namespace ipa::soft::algorithms {\n>  \n> +int Awb::init([[maybe_unused]] IPAContext &context,\n> +\t      const ValueNode &tuningData)\n> +{\n> +\tmaxGainR_ = tuningData[\"maxGainR\"].get<float>().value_or(4.0f);\n> +\tmaxGainB_ = tuningData[\"maxGainB\"].get<float>().value_or(4.0f);\n> +\tspeed_ = tuningData[\"speed\"].get<float>().value_or(1.0f);\n> +\n> +\tLOG(IPASoftAwb, Info)\n\nMaybe Debug would be sufficient here?\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> +\t\t<< \"AWB: maxGainR \" << maxGainR_\n> +\t\t<< \", maxGainB \" << maxGainB_\n> +\t\t<< \", speed \" << speed_;\n> +\n> +\treturn 0;\n> +}\n> +\n>  int Awb::configure(IPAContext &context,\n>  \t\t   [[maybe_unused]] const IPAConfigInfo &configInfo)\n>  {\n> @@ -84,14 +101,21 @@ void Awb::process(IPAContext &context,\n>  \tconst RGB<uint64_t> sum = stats->sum_.max(offset + minValid) - offset;\n>  \n>  \t/*\n> -\t * Calculate red and blue gains for AWB.\n> -\t * Clamp max gain at 4.0, this also avoids 0 division.\n> +\t * Calculate red and blue gains for AWB. Clamp max gain to avoid\n> +\t * division by zero and extreme color casts.\n>  \t */\n>  \tauto &gains = context.activeState.awb.gains;\n> +\tfloat rawRGain = sum.r() <= sum.g() / maxGainR_ ? maxGainR_ :\n> +\t\t\t\tstatic_cast<float>(sum.g()) / sum.r();\n> +\tfloat rawBGain = sum.b() <= sum.g() / maxGainB_ ? maxGainB_ :\n> +\t\t\t\tstatic_cast<float>(sum.g()) / sum.b();\n> +\n> +\t/* Apply temporal smoothing to avoid rapid white balance changes. */\n> +\tfloat alpha = std::clamp(speed_, 0.01f, 1.0f);\n>  \tgains = { {\n> -\t\tsum.r() <= sum.g() / 4 ? 4.0f : static_cast<float>(sum.g()) / sum.r(),\n> -\t\t1.0,\n> -\t\tsum.b() <= sum.g() / 4 ? 4.0f : static_cast<float>(sum.g()) / sum.b(),\n> +\t\tgains.r() * (1.0f - alpha) + rawRGain * alpha,\n> +\t\t1.0f,\n> +\t\tgains.b() * (1.0f - alpha) + rawBGain * alpha,\n>  \t} };\n>  \n>  \tRGB<double> rgbGains{ { 1 / gains.r(), 1 / gains.g(), 1 / gains.b() } };\n> diff --git a/src/ipa/simple/algorithms/awb.h b/src/ipa/simple/algorithms/awb.h\n> index ad993f39..0aedc1d1 100644\n> --- a/src/ipa/simple/algorithms/awb.h\n> +++ b/src/ipa/simple/algorithms/awb.h\n> @@ -19,6 +19,7 @@ public:\n>  \tAwb() = default;\n>  \t~Awb() = default;\n>  \n> +\tint init(IPAContext &context, const ValueNode &tuningData) override;\n>  \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context,\n>  \t\t     const uint32_t frame,\n> @@ -29,6 +30,11 @@ public:\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     const SwIspStats *stats,\n>  \t\t     ControlList &metadata) override;\n> +\n> +private:\n> +\tfloat maxGainR_;\n> +\tfloat maxGainB_;\n> +\tfloat speed_;\n>  };\n>  \n>  } /* namespace ipa::soft::algorithms */","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 02A98BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 May 2026 12:17:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BB1B962FE8;\n\tTue,  5 May 2026 14:17:55 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6FD9B62E9D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 May 2026 14:17:53 +0200 (CEST)","from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n\t[209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-627-ItpsXem3P82vLj2Tzks-Kw-1; Tue, 05 May 2026 08:17:50 -0400","by mail-wm1-f71.google.com with SMTP id\n\t5b1f17b1804b1-488c0fcc6deso29541235e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 May 2026 05:17:50 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb ([213.175.46.86])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-48a8eb75fc1sm356819575e9.7.2026.05.05.05.17.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 05 May 2026 05:17:48 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"Sq2DigHY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1777983472;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=wdD1g9JgMeGaXZZqhlUT9E1iYZuohAjAC5vz1BQtgz4=;\n\tb=Sq2DigHYMBDGNUWHiUdG+1xKHiGSDCCoSJjAFX4tvu9coVqmNBocJIOJv7CNwTI+efjoap\n\tzeql9+Ox4GHDbb27OHFDn+PeRamXwyOYjWGQr84f3AAOfeUGBJDCq/MS6HpmG7FFolnpJC\n\tPoQlAXnhPVt94dGbchhXM9R01STmvhI=","X-MC-Unique":"ItpsXem3P82vLj2Tzks-Kw-1","X-Mimecast-MFC-AGG-ID":"ItpsXem3P82vLj2Tzks-Kw_1777983470","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1777983469; x=1778588269;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject\n\t:date:message-id:reply-to;\n\tbh=wdD1g9JgMeGaXZZqhlUT9E1iYZuohAjAC5vz1BQtgz4=;\n\tb=PAKoh7DmzX4XYBIVCvH0RF9sqrC8gWyHMKuNNd5tabXx9jWc3ArFsnao3kNdUkhHoU\n\tJVs8weyeD3LcPCC3I9VFuh9nNL6eJ1OdB9wuGb/mWPtA7sgbpkedqATojFPK+/9vY6f0\n\tAqMgA9hM0BS1t53jHli3eHN2s/W5iBYGbtx0fzH4rPL+eLEUk16yxitCdJmBDhbWpgH8\n\tm361FFQtCzm133yTIm+QubXOCRZRb7CBmb7S3SIZHhqc/vTNNh9IXKSss/UVY2MjAzjU\n\tB3U96U1iDPk3hj1fQeUwAYeVlKJICcxMdKc3BkY/GsRu9lz6ySkeoI/6tyIZEfprjvQ4\n\t9omg==","X-Gm-Message-State":"AOJu0YyjRgWLWbk47P87V6JdQV6MkqrJXCkWRZ7HFE9ULgBgMO8QE+Yo\n\tmoxgpkpdvrYqzyXE4snRLo4hnEFNoAqPWC70w7aa+t5oljXmgzIrtL8xwTlPtjEz2kYWQfCX0D/\n\tMuvl+FPS85BAI4kZfYBx47kFe+lqxnpnJhk3VeaLFHFvDVYKaa/b7sGxlYK2yGTBSABRUxoGVU6\n\tcYbjVPH+2hcfQEqII9cd7zPCHDgaVOPSJG/5ozoA/EW26aRozBOvBkcfUsixc=","X-Gm-Gg":"AeBDieuYyRX3qcDAXB5nW31octyMnezmgMJmzEp1Z8DPCg0J7AybmDQqK3MeuvJxEtb\n\t2Y6wgFTURKMyEMQRo9RT10tDHDBcZ9Zjt0U3GZ4V3c+QVCjw3aP8ok3nArqgxCvUgNQWDPfmozI\n\tajgrxTMNlangZ0IxdHfQtnCCAFqm/T7A21DARV5Vp3c2uwPEBwU/PVULsV5FPN2UVwU9akXs5HX\n\tj0uDhlUJtuhp1qiBBAcEgoArOw4ZrggYgfb1AfiheteFOGVGRlow/LMZ6kJAMRN2G3DU4FEx4L9\n\tLV4gP94blEggjctlItL1qyoy5RUfGNPcdEWWYi5YcxB9jWkDhLE3Tjp3BIEHy5jAQsedLid0Wq/\n\t89Hnuw7kxbd6mxetCRUw5oZ8+g/Hqdo7iEGBjsa1L8Qc5e6Gp","X-Received":["by 2002:a05:600c:4f8e:b0:486:fbdb:b718 with SMTP id\n\t5b1f17b1804b1-48d18ce4b2amr44220375e9.25.1777983469260; \n\tTue, 05 May 2026 05:17:49 -0700 (PDT)","by 2002:a05:600c:4f8e:b0:486:fbdb:b718 with SMTP id\n\t5b1f17b1804b1-48d18ce4b2amr44219785e9.25.1777983468737; \n\tTue, 05 May 2026 05:17:48 -0700 (PDT)"],"From":"Milan Zamazal <mzamazal@redhat.com>","To":"d3vv3 <devve.3@gmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","In-Reply-To":"<20260501191400.985920-1-devve.3@gmail.com> (d3vv3's message of\n\t\"Fri, 1 May 2026 21:13:09 +0200\")","References":"<20260501191400.985920-1-devve.3@gmail.com>","Date":"Tue, 05 May 2026 14:17:47 +0200","Message-ID":"<854ikm3v9w.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"uPXr_6dg_8SkJ60KFAKe3tHwKqnECrd1gpREj5VsAlk_1777983470","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38748,"web_url":"https://patchwork.libcamera.org/comment/38748/","msgid":"<20260506224452.GC1778786@killaraus.ideasonboard.com>","date":"2026-05-06T22:44:52","subject":"Re: [PATCH v2 1/9] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Could you please resend v2 as a separate patch series, not in reply to\nv1 ? I see three patches named \"v2 1/9\", \"v2 2/9\" and \"v2 3/9\", as well\nas two other patches simply named \"v2\", all interleaved in the first\nversion of the series. It's hard to tell what to review.\n\nPlease format a complete series with git-format-patch, specify the \"-v2\"\nargument to properly indicate the version in the subject lines, and send\nall patches in one go, numbered 1/N to N/N. If applicable, a cover\nletter can be useful, you can generate the template by specifying the\n\"--cover-letter\" argument to git-send-email.\n\nOn Wed, May 06, 2026 at 11:58:22PM +0200, d3vv3 wrote:\n> Add configurable YAML parameters maxGainR, maxGainB, and speed to AWB.\n> Replace the single hardcoded max gain (4.0x) with per-channel limits,\n> and apply exponential moving average smoothing to reduce colour\n> temperature oscillation between frames.\n> \n> Signed-off-by: d3vv3 <devve.3@gmail.com>\n> ---\n> Hi, thanks for the review. These is were my first email patches ever. I\n> will learn how to send them as series for the next time.\n> \n> Changed log level in init() from Info to Debug as suggested.\n> \n>  src/ipa/simple/algorithms/awb.cpp | 34 ++++++++++++++++++++++++++-----\n>  src/ipa/simple/algorithms/awb.h   |  6 ++++++\n>  2 files changed, 35 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp\n> index f5c88ea6..937aabc8 100644\n> --- a/src/ipa/simple/algorithms/awb.cpp\n> +++ b/src/ipa/simple/algorithms/awb.cpp\n> @@ -14,6 +14,8 @@\n>  \n>  #include <libcamera/control_ids.h>\n>  \n> +#include \"libcamera/internal/yaml_parser.h\"\n> +\n>  #include \"libipa/colours.h\"\n>  #include \"simple/ipa_context.h\"\n>  \n> @@ -23,6 +25,21 @@ LOG_DEFINE_CATEGORY(IPASoftAwb)\n>  \n>  namespace ipa::soft::algorithms {\n>  \n> +int Awb::init([[maybe_unused]] IPAContext &context,\n> +\t      const ValueNode &tuningData)\n> +{\n> +\tmaxGainR_ = tuningData[\"maxGainR\"].get<float>().value_or(4.0f);\n> +\tmaxGainB_ = tuningData[\"maxGainB\"].get<float>().value_or(4.0f);\n> +\tspeed_ = tuningData[\"speed\"].get<float>().value_or(1.0f);\n> +\n> +\tLOG(IPASoftAwb, Debug)\n> +\t\t<< \"AWB: maxGainR \" << maxGainR_\n> +\t\t<< \", maxGainB \" << maxGainB_\n> +\t\t<< \", speed \" << speed_;\n> +\n> +\treturn 0;\n> +}\n> +\n>  int Awb::configure(IPAContext &context,\n>  \t\t   [[maybe_unused]] const IPAConfigInfo &configInfo)\n>  {\n> @@ -84,14 +101,21 @@ void Awb::process(IPAContext &context,\n>  \tconst RGB<uint64_t> sum = stats->sum_.max(offset + minValid) - offset;\n>  \n>  \t/*\n> -\t * Calculate red and blue gains for AWB.\n> -\t * Clamp max gain at 4.0, this also avoids 0 division.\n> +\t * Calculate red and blue gains for AWB. Clamp max gain to avoid\n> +\t * division by zero and extreme color casts.\n>  \t */\n>  \tauto &gains = context.activeState.awb.gains;\n> +\tfloat rawRGain = sum.r() <= sum.g() / maxGainR_ ? maxGainR_ :\n> +\t\t\t\tstatic_cast<float>(sum.g()) / sum.r();\n> +\tfloat rawBGain = sum.b() <= sum.g() / maxGainB_ ? maxGainB_ :\n> +\t\t\t\tstatic_cast<float>(sum.g()) / sum.b();\n> +\n> +\t/* Apply temporal smoothing to avoid rapid white balance changes. */\n> +\tfloat alpha = std::clamp(speed_, 0.01f, 1.0f);\n>  \tgains = { {\n> -\t\tsum.r() <= sum.g() / 4 ? 4.0f : static_cast<float>(sum.g()) / sum.r(),\n> -\t\t1.0,\n> -\t\tsum.b() <= sum.g() / 4 ? 4.0f : static_cast<float>(sum.g()) / sum.b(),\n> +\t\tgains.r() * (1.0f - alpha) + rawRGain * alpha,\n> +\t\t1.0f,\n> +\t\tgains.b() * (1.0f - alpha) + rawBGain * alpha,\n>  \t} };\n>  \n>  \tRGB<double> rgbGains{ { 1 / gains.r(), 1 / gains.g(), 1 / gains.b() } };\n> diff --git a/src/ipa/simple/algorithms/awb.h b/src/ipa/simple/algorithms/awb.h\n> index ad993f39..0aedc1d1 100644\n> --- a/src/ipa/simple/algorithms/awb.h\n> +++ b/src/ipa/simple/algorithms/awb.h\n> @@ -19,6 +19,7 @@ public:\n>  \tAwb() = default;\n>  \t~Awb() = default;\n>  \n> +\tint init(IPAContext &context, const ValueNode &tuningData) override;\n>  \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n>  \tvoid prepare(IPAContext &context,\n>  \t\t     const uint32_t frame,\n> @@ -29,6 +30,11 @@ public:\n>  \t\t     IPAFrameContext &frameContext,\n>  \t\t     const SwIspStats *stats,\n>  \t\t     ControlList &metadata) override;\n> +\n> +private:\n> +\tfloat maxGainR_;\n> +\tfloat maxGainB_;\n> +\tfloat speed_;\n>  };\n>  \n>  } /* namespace ipa::soft::algorithms */","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 96622BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 May 2026 22:44:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EAC4063025;\n\tThu,  7 May 2026 00:44:55 +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 AB34A6271A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 May 2026 00:44:54 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D6CA9493;\n\tThu,  7 May 2026 00:44:50 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jTuzteQP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778107491;\n\tbh=GyioJwOmpbw8n4lf+IEy3KuMmRkNwR67U6IwDYmyVTs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jTuzteQPMDhUBjswbbLs3XTu1OVK0xXz1Kf6Md7MW0jZp7TBrauxdYvDBT6pGvNvU\n\tqGU2VkTMF4VpQ40yZW//riZrMccHZ7M30WlrIe2mfl2/n2db+jAVuh05wCrCBc5tRN\n\tzkiFlptjKNVtGohogDc02G8CNLeZV/eyUrFe5AKI=","Date":"Thu, 7 May 2026 01:44:52 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"d3vv3 <devve.3@gmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 1/9] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","Message-ID":"<20260506224452.GC1778786@killaraus.ideasonboard.com>","References":"<20260501191400.985920-1-devve.3@gmail.com>\n\t<20260506215822.849020-1-devve.3@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20260506215822.849020-1-devve.3@gmail.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38749,"web_url":"https://patchwork.libcamera.org/comment/38749/","msgid":"<CAM8KDPMybVPYpG+CVdzPD+sbLzSuXtTUBbPPTCu3ntOY5Pc4aw@mail.gmail.com>","date":"2026-05-06T23:09:40","subject":"Re: [PATCH v2 1/9] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","submitter":{"id":271,"url":"https://patchwork.libcamera.org/api/people/271/","name":"devve","email":"devve.3@gmail.com"},"content":"Thanks for the feedback and patience, Laurent. I have now sent all as a\npatch series. I do not know how to handle patches from other people that I\nhave built on, so I sent them as well.\n\nEl jue, 7 may 2026 a las 0:44, Laurent Pinchart (<\nlaurent.pinchart@ideasonboard.com>) escribió:\n\n> Could you please resend v2 as a separate patch series, not in reply to\n> v1 ? I see three patches named \"v2 1/9\", \"v2 2/9\" and \"v2 3/9\", as well\n> as two other patches simply named \"v2\", all interleaved in the first\n> version of the series. It's hard to tell what to review.\n>\n> Please format a complete series with git-format-patch, specify the \"-v2\"\n> argument to properly indicate the version in the subject lines, and send\n> all patches in one go, numbered 1/N to N/N. If applicable, a cover\n> letter can be useful, you can generate the template by specifying the\n> \"--cover-letter\" argument to git-send-email.\n>\n> On Wed, May 06, 2026 at 11:58:22PM +0200, d3vv3 wrote:\n> > Add configurable YAML parameters maxGainR, maxGainB, and speed to AWB.\n> > Replace the single hardcoded max gain (4.0x) with per-channel limits,\n> > and apply exponential moving average smoothing to reduce colour\n> > temperature oscillation between frames.\n> >\n> > Signed-off-by: d3vv3 <devve.3@gmail.com>\n> > ---\n> > Hi, thanks for the review. These is were my first email patches ever. I\n> > will learn how to send them as series for the next time.\n> >\n> > Changed log level in init() from Info to Debug as suggested.\n> >\n> >  src/ipa/simple/algorithms/awb.cpp | 34 ++++++++++++++++++++++++++-----\n> >  src/ipa/simple/algorithms/awb.h   |  6 ++++++\n> >  2 files changed, 35 insertions(+), 5 deletions(-)\n> >\n> > diff --git a/src/ipa/simple/algorithms/awb.cpp\n> b/src/ipa/simple/algorithms/awb.cpp\n> > index f5c88ea6..937aabc8 100644\n> > --- a/src/ipa/simple/algorithms/awb.cpp\n> > +++ b/src/ipa/simple/algorithms/awb.cpp\n> > @@ -14,6 +14,8 @@\n> >\n> >  #include <libcamera/control_ids.h>\n> >\n> > +#include \"libcamera/internal/yaml_parser.h\"\n> > +\n> >  #include \"libipa/colours.h\"\n> >  #include \"simple/ipa_context.h\"\n> >\n> > @@ -23,6 +25,21 @@ LOG_DEFINE_CATEGORY(IPASoftAwb)\n> >\n> >  namespace ipa::soft::algorithms {\n> >\n> > +int Awb::init([[maybe_unused]] IPAContext &context,\n> > +           const ValueNode &tuningData)\n> > +{\n> > +     maxGainR_ = tuningData[\"maxGainR\"].get<float>().value_or(4.0f);\n> > +     maxGainB_ = tuningData[\"maxGainB\"].get<float>().value_or(4.0f);\n> > +     speed_ = tuningData[\"speed\"].get<float>().value_or(1.0f);\n> > +\n> > +     LOG(IPASoftAwb, Debug)\n> > +             << \"AWB: maxGainR \" << maxGainR_\n> > +             << \", maxGainB \" << maxGainB_\n> > +             << \", speed \" << speed_;\n> > +\n> > +     return 0;\n> > +}\n> > +\n> >  int Awb::configure(IPAContext &context,\n> >                  [[maybe_unused]] const IPAConfigInfo &configInfo)\n> >  {\n> > @@ -84,14 +101,21 @@ void Awb::process(IPAContext &context,\n> >       const RGB<uint64_t> sum = stats->sum_.max(offset + minValid) -\n> offset;\n> >\n> >       /*\n> > -      * Calculate red and blue gains for AWB.\n> > -      * Clamp max gain at 4.0, this also avoids 0 division.\n> > +      * Calculate red and blue gains for AWB. Clamp max gain to avoid\n> > +      * division by zero and extreme color casts.\n> >        */\n> >       auto &gains = context.activeState.awb.gains;\n> > +     float rawRGain = sum.r() <= sum.g() / maxGainR_ ? maxGainR_ :\n> > +                             static_cast<float>(sum.g()) / sum.r();\n> > +     float rawBGain = sum.b() <= sum.g() / maxGainB_ ? maxGainB_ :\n> > +                             static_cast<float>(sum.g()) / sum.b();\n> > +\n> > +     /* Apply temporal smoothing to avoid rapid white balance changes.\n> */\n> > +     float alpha = std::clamp(speed_, 0.01f, 1.0f);\n> >       gains = { {\n> > -             sum.r() <= sum.g() / 4 ? 4.0f :\n> static_cast<float>(sum.g()) / sum.r(),\n> > -             1.0,\n> > -             sum.b() <= sum.g() / 4 ? 4.0f :\n> static_cast<float>(sum.g()) / sum.b(),\n> > +             gains.r() * (1.0f - alpha) + rawRGain * alpha,\n> > +             1.0f,\n> > +             gains.b() * (1.0f - alpha) + rawBGain * alpha,\n> >       } };\n> >\n> >       RGB<double> rgbGains{ { 1 / gains.r(), 1 / gains.g(), 1 /\n> gains.b() } };\n> > diff --git a/src/ipa/simple/algorithms/awb.h\n> b/src/ipa/simple/algorithms/awb.h\n> > index ad993f39..0aedc1d1 100644\n> > --- a/src/ipa/simple/algorithms/awb.h\n> > +++ b/src/ipa/simple/algorithms/awb.h\n> > @@ -19,6 +19,7 @@ public:\n> >       Awb() = default;\n> >       ~Awb() = default;\n> >\n> > +     int init(IPAContext &context, const ValueNode &tuningData)\n> override;\n> >       int configure(IPAContext &context, const IPAConfigInfo\n> &configInfo) override;\n> >       void prepare(IPAContext &context,\n> >                    const uint32_t frame,\n> > @@ -29,6 +30,11 @@ public:\n> >                    IPAFrameContext &frameContext,\n> >                    const SwIspStats *stats,\n> >                    ControlList &metadata) override;\n> > +\n> > +private:\n> > +     float maxGainR_;\n> > +     float maxGainB_;\n> > +     float speed_;\n> >  };\n> >\n> >  } /* namespace ipa::soft::algorithms */\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 160A7BDCB5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 May 2026 23:09:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3709163022;\n\tThu,  7 May 2026 01:09:55 +0200 (CEST)","from mail-lf1-x130.google.com (mail-lf1-x130.google.com\n\t[IPv6:2a00:1450:4864:20::130])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F14F63021\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 May 2026 01:09:53 +0200 (CEST)","by mail-lf1-x130.google.com with SMTP id\n\t2adb3069b0e04-59dcdf60427so153827e87.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 06 May 2026 16:09:53 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"hYHD9Lwa\"; dkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1778108992; cv=none;\n\td=google.com; s=arc-20240605;\n\tb=agAL5pC9g9q+hI8fN6JVvYgOry4pquIu6SOJQz6L0WAPzirIzK1qAOYlSnOUEGHzTj\n\tvjvx2Fhm/+S1txyweO5/BIGpm1N3sjNlUWbyRX8OksQX88Zm3ecYIWxKIQ+ozvUIDJKJ\n\tzMTlxGDOvaWQwGngDgM5BkipfihEJLfWo9HViBlDJ7LDA0p0S5kCXu6/+cozB7OKevhV\n\tlWSysI26zOcTKRddo2G8oFvt2WJAoDfonMPeR3c/+0Riy2QK3AuWMyiAcAU24kJJVwf6\n\tZOupkvgxhzAZCtB/F2lLbnMObQenZZqtSQHV1nhFxLDYQbp7NPA+YErzqPN/6H6dKaF8\n\trwuw==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=arc-20240605; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:dkim-signature;\n\tbh=Lh62nV4G+5m42CpLY0nXeELAXG1zzcijYvfrl7HnL9Q=;\n\tfh=kAwbguIY0wmqf1QQypnTiLH20ruRu7+JSSp6fzxLlN4=;\n\tb=Fs7rUQm7WIu2uJRUA3+s0IjLxKAlziBM/jw3EM6VUEacxb8CSiMXC95fsmV4qh08+g\n\tNWuameTLDuha9iaw1g5EbsR2ZMFAPGaMKXrExp+cZnSpOmI4CVzWB2M8TTV3k+P1FpsS\n\tmMngqdbWAeiU5omGDSr0s0zZkluWI+MBWh2Dto4xlJtvZBRsyxznfcvNh9wQ0ZVtNBlT\n\tfVX5JSGdNG7FJJD9Cin9kznAUz/6x4Xeu6pT8IMWJL4/PtR4sO+vFAyrpZgu0pw0pSf6\n\tRqfG33EybcDyvgQ/l5D03tNXGxO4lNDuIxbGA1VKQRUWuaUlBPW6yLZc8Ph6qOmcuzIE\n\tFNMA==; darn=lists.libcamera.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20251104; t=1778108992; x=1778713792;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=Lh62nV4G+5m42CpLY0nXeELAXG1zzcijYvfrl7HnL9Q=;\n\tb=hYHD9Lwathp8HftqNYrP+/2BlIb5vcRlvCiIx+uUBMvVNAC0Ie1na2dhapyq+vRie3\n\tKRAiD22APjIBBfoBxS3NlQQIVt52FWswecTB4ViuGwDIOc89LW/mhZ4EdgpJA6EbyDaw\n\tFe4JMFE+zE8cqBDUnUdGD9M/8AvjqtGuwshBRG+4kby3m/Ne/jQnw3Ha/HHoGuKDZMM6\n\t+C9n8VvvDowVGqv56rjWNnPX5nD1YyaZRc4pFOg0I/4UAZU2Oe+GcmJ1pRoTt3Z1UDJq\n\tR/IlJGhChOT8y2wm3bCi+AEVE0w3AnGCLgOEYlZ5HpovTkFOL2kaCCJQzWesh/hMJWGp\n\tOqwg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1778108992; x=1778713792;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=Lh62nV4G+5m42CpLY0nXeELAXG1zzcijYvfrl7HnL9Q=;\n\tb=OpcbkKR7L8EjLYYt4wduPstWcKv7zoz9tqVAZMjymw/QGpBQ+CCK6TMUpHUohGTzAf\n\ti22XzArI58LO2EYfgQXQ4umkvs1tAqJFQ5qv2xCT2hyS/tcz0JdoTyPGGQV2KkClYGXb\n\tcnJGNfMdfOEfQKgy5NYIz5+ldk+tTekY9GFMFbJLeg43A3SdEDG4chD0vg9nRKLxIGQp\n\tlVIUNEcXd43iLXFDsBdOGcSbi2aQbsQF61nfsx/veScJUSQ3Wx0YUss50nqEUv6d72UO\n\tM5j9/sRznixi92gMWUj+Far4K6GMW6lOzhhhOzaNqkaFYwDZz2tknG37Naung1IP+5dT\n\tb3aA==","X-Gm-Message-State":"AOJu0Yw7frvkLQVOFjtOUcqtFFP0c9awvN9ECW6gS/iPCdVxwk9fhXL7\n\toYllbJObyXLwrEY/hhCS1C4XVfH6++zug8QXWVf1Rq/wayEe4nfW+ONbHdTgWUu0CXx1EMp8BOB\n\tOKnj6GzITV0FYluShQX7JiDM2eDbFbqMRdQ==","X-Gm-Gg":"AeBDietg92qDfyTGGaCR8C1Pbmn19kgdNno0zS3LPPJMItsPLiBtwocpjqmprzZxFRU\n\tg5eti5Ni40vIMDuAQGmWjP+Cgiifw7HZqLH6escLVPFDaSQqa44Flw2BwhmM6LNTm/xcBgDX3Uy\n\t5mVCO9PlLHAXDovb/6FzG/haUDY249/b+S1TQ3xyb7yojq5z7DCQnKCF1f6EJUp+OjtxGmqXiOv\n\t5xY93YRimYBiINGG1liHxnEUzamn2rdHv4h+11XpK14TQpwj8fAorc9z8IMqJzzWDWjIVgMVRW4\n\tRfPStqgjltUveUzrwnXYPSKQWso9ubwmprdS7hN7E2qohVdFNSXRew3RrjZp","X-Received":"by 2002:a05:6512:3e1e:b0:5a8:6383:eb1d with SMTP id\n\t2adb3069b0e04-5a887a9a1f8mr1882100e87.0.1778108991999;\n\tWed, 06 May 2026 16:09:51 -0700 (PDT)","MIME-Version":"1.0","References":"<20260501191400.985920-1-devve.3@gmail.com>\n\t<20260506215822.849020-1-devve.3@gmail.com>\n\t<20260506224452.GC1778786@killaraus.ideasonboard.com>","In-Reply-To":"<20260506224452.GC1778786@killaraus.ideasonboard.com>","From":"devve <devve.3@gmail.com>","Date":"Thu, 7 May 2026 01:09:40 +0200","X-Gm-Features":"AVHnY4JIaGse1Yv0tKIKwzBcPqqSPnahh2WBJyhqsMlhouG4uFA4XHA5eO5KAiM","Message-ID":"<CAM8KDPMybVPYpG+CVdzPD+sbLzSuXtTUBbPPTCu3ntOY5Pc4aw@mail.gmail.com>","Subject":"Re: [PATCH v2 1/9] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"multipart/alternative; boundary=\"000000000000d7142706512e42d9\"","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38789,"web_url":"https://patchwork.libcamera.org/comment/38789/","msgid":"<20260507144012.GN1938994@killaraus.ideasonboard.com>","date":"2026-05-07T14:40:12","subject":"Re: [PATCH v2 1/9] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, May 07, 2026 at 01:09:40AM +0200, devve wrote:\n> Thanks for the feedback and patience, Laurent. I have now sent all as a\n> patch series. I do not know how to handle patches from other people that I\n> have built on, so I sent them as well.\n\nUsually you would mention the dependencies in the cover letter,\nincluding links (to patchwork.libcamera.org for instance). If you depend\non patches posted separately from each other, including them in your\nseries can be fine too to simplify the review. It should then be\nmentioned in the cover letter.\n\n> El jue, 7 may 2026 a las 0:44, Laurent Pinchart escribió:\n> \n> > Could you please resend v2 as a separate patch series, not in reply to\n> > v1 ? I see three patches named \"v2 1/9\", \"v2 2/9\" and \"v2 3/9\", as well\n> > as two other patches simply named \"v2\", all interleaved in the first\n> > version of the series. It's hard to tell what to review.\n> >\n> > Please format a complete series with git-format-patch, specify the \"-v2\"\n> > argument to properly indicate the version in the subject lines, and send\n> > all patches in one go, numbered 1/N to N/N. If applicable, a cover\n> > letter can be useful, you can generate the template by specifying the\n> > \"--cover-letter\" argument to git-send-email.\n> >\n> > On Wed, May 06, 2026 at 11:58:22PM +0200, d3vv3 wrote:\n> > > Add configurable YAML parameters maxGainR, maxGainB, and speed to AWB.\n> > > Replace the single hardcoded max gain (4.0x) with per-channel limits,\n> > > and apply exponential moving average smoothing to reduce colour\n> > > temperature oscillation between frames.\n> > >\n> > > Signed-off-by: d3vv3 <devve.3@gmail.com>\n> > > ---\n> > > Hi, thanks for the review. These is were my first email patches ever. I\n> > > will learn how to send them as series for the next time.\n> > >\n> > > Changed log level in init() from Info to Debug as suggested.\n> > >\n> > >  src/ipa/simple/algorithms/awb.cpp | 34 ++++++++++++++++++++++++++-----\n> > >  src/ipa/simple/algorithms/awb.h   |  6 ++++++\n> > >  2 files changed, 35 insertions(+), 5 deletions(-)\n> > >\n> > > diff --git a/src/ipa/simple/algorithms/awb.cpp\n> > b/src/ipa/simple/algorithms/awb.cpp\n> > > index f5c88ea6..937aabc8 100644\n> > > --- a/src/ipa/simple/algorithms/awb.cpp\n> > > +++ b/src/ipa/simple/algorithms/awb.cpp\n> > > @@ -14,6 +14,8 @@\n> > >\n> > >  #include <libcamera/control_ids.h>\n> > >\n> > > +#include \"libcamera/internal/yaml_parser.h\"\n> > > +\n> > >  #include \"libipa/colours.h\"\n> > >  #include \"simple/ipa_context.h\"\n> > >\n> > > @@ -23,6 +25,21 @@ LOG_DEFINE_CATEGORY(IPASoftAwb)\n> > >\n> > >  namespace ipa::soft::algorithms {\n> > >\n> > > +int Awb::init([[maybe_unused]] IPAContext &context,\n> > > +           const ValueNode &tuningData)\n> > > +{\n> > > +     maxGainR_ = tuningData[\"maxGainR\"].get<float>().value_or(4.0f);\n> > > +     maxGainB_ = tuningData[\"maxGainB\"].get<float>().value_or(4.0f);\n> > > +     speed_ = tuningData[\"speed\"].get<float>().value_or(1.0f);\n> > > +\n> > > +     LOG(IPASoftAwb, Debug)\n> > > +             << \"AWB: maxGainR \" << maxGainR_\n> > > +             << \", maxGainB \" << maxGainB_\n> > > +             << \", speed \" << speed_;\n> > > +\n> > > +     return 0;\n> > > +}\n> > > +\n> > >  int Awb::configure(IPAContext &context,\n> > >                  [[maybe_unused]] const IPAConfigInfo &configInfo)\n> > >  {\n> > > @@ -84,14 +101,21 @@ void Awb::process(IPAContext &context,\n> > >       const RGB<uint64_t> sum = stats->sum_.max(offset + minValid) -\n> > offset;\n> > >\n> > >       /*\n> > > -      * Calculate red and blue gains for AWB.\n> > > -      * Clamp max gain at 4.0, this also avoids 0 division.\n> > > +      * Calculate red and blue gains for AWB. Clamp max gain to avoid\n> > > +      * division by zero and extreme color casts.\n> > >        */\n> > >       auto &gains = context.activeState.awb.gains;\n> > > +     float rawRGain = sum.r() <= sum.g() / maxGainR_ ? maxGainR_ :\n> > > +                             static_cast<float>(sum.g()) / sum.r();\n> > > +     float rawBGain = sum.b() <= sum.g() / maxGainB_ ? maxGainB_ :\n> > > +                             static_cast<float>(sum.g()) / sum.b();\n> > > +\n> > > +     /* Apply temporal smoothing to avoid rapid white balance changes.\n> > */\n> > > +     float alpha = std::clamp(speed_, 0.01f, 1.0f);\n> > >       gains = { {\n> > > -             sum.r() <= sum.g() / 4 ? 4.0f :\n> > static_cast<float>(sum.g()) / sum.r(),\n> > > -             1.0,\n> > > -             sum.b() <= sum.g() / 4 ? 4.0f :\n> > static_cast<float>(sum.g()) / sum.b(),\n> > > +             gains.r() * (1.0f - alpha) + rawRGain * alpha,\n> > > +             1.0f,\n> > > +             gains.b() * (1.0f - alpha) + rawBGain * alpha,\n> > >       } };\n> > >\n> > >       RGB<double> rgbGains{ { 1 / gains.r(), 1 / gains.g(), 1 /\n> > gains.b() } };\n> > > diff --git a/src/ipa/simple/algorithms/awb.h\n> > b/src/ipa/simple/algorithms/awb.h\n> > > index ad993f39..0aedc1d1 100644\n> > > --- a/src/ipa/simple/algorithms/awb.h\n> > > +++ b/src/ipa/simple/algorithms/awb.h\n> > > @@ -19,6 +19,7 @@ public:\n> > >       Awb() = default;\n> > >       ~Awb() = default;\n> > >\n> > > +     int init(IPAContext &context, const ValueNode &tuningData)\n> > override;\n> > >       int configure(IPAContext &context, const IPAConfigInfo\n> > &configInfo) override;\n> > >       void prepare(IPAContext &context,\n> > >                    const uint32_t frame,\n> > > @@ -29,6 +30,11 @@ public:\n> > >                    IPAFrameContext &frameContext,\n> > >                    const SwIspStats *stats,\n> > >                    ControlList &metadata) override;\n> > > +\n> > > +private:\n> > > +     float maxGainR_;\n> > > +     float maxGainB_;\n> > > +     float speed_;\n> > >  };\n> > >\n> > >  } /* namespace ipa::soft::algorithms */","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 25024BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 May 2026 14:40:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A117F63033;\n\tThu,  7 May 2026 16:40:15 +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 4419263020\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 May 2026 16:40:14 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-70f3-e800--a06.rev.dnainternet.fi\n\t[IPv6:2001:14ba:70f3:e800::a06])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F3DD1664;\n\tThu,  7 May 2026 16:40:09 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"p2oCbiTO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778164810;\n\tbh=pxDyKTWsevoEyWieaNfRUOAtrZC/8G7DTdzFe+HjDxA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=p2oCbiTOOuNT/VQpfLW0w9eMofRCZITgMdrXAYM7fDh8MJvFbKkSYi12qGEdJ/qlQ\n\txdbB2B2WuatcEX5cCIhz2pz4VNXhfc7ZVz9CTZteFbMG4NIZu7N5BLcsScvJlpQ8Vi\n\tdRN+XqP82bGA+1X4x64ncTrQhYrvQaCwYDdOleZY=","Date":"Thu, 7 May 2026 17:40:12 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"devve <devve.3@gmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 1/9] ipa: simple: awb: Add temporal smoothing and\n\tper-channel gain limits","Message-ID":"<20260507144012.GN1938994@killaraus.ideasonboard.com>","References":"<20260501191400.985920-1-devve.3@gmail.com>\n\t<20260506215822.849020-1-devve.3@gmail.com>\n\t<20260506224452.GC1778786@killaraus.ideasonboard.com>\n\t<CAM8KDPMybVPYpG+CVdzPD+sbLzSuXtTUBbPPTCu3ntOY5Pc4aw@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CAM8KDPMybVPYpG+CVdzPD+sbLzSuXtTUBbPPTCu3ntOY5Pc4aw@mail.gmail.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]