[{"id":20039,"web_url":"https://patchwork.libcamera.org/comment/20039/","msgid":"<YVuj2HHcBQFGsrCT@pendragon.ideasonboard.com>","date":"2021-10-05T01:01:12","subject":"Re: [libcamera-devel] [PATCH v2 03/12] ipa: ipu3: Change\n\tAccumulator structure layout","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nOn Thu, Sep 30, 2021 at 11:37:06AM +0200, Jean-Michel Hautbois wrote:\n> The pixel component sums for the Accumulator are inconsistent with other\n> similar structures such as the IPAFrameContext::awb::gains. Group the\n> red, green, and blue sums together in a struct and store them as\n> uint64_t to reduce potential architectural differences.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/ipu3/algorithms/awb.cpp | 24 ++++++++++++------------\n>  src/ipa/ipu3/algorithms/awb.h   |  8 +++++---\n>  2 files changed, 17 insertions(+), 15 deletions(-)\n> \n> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> index fd2f12ca..5f61cb89 100644\n> --- a/src/ipa/ipu3/algorithms/awb.cpp\n> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n> @@ -75,13 +75,13 @@ static constexpr uint32_t kMinGreenLevelInZone = 32;\n>   * \\var Accumulator::counted\n>   * \\brief Number of unsaturated cells used to calculate the sums\n>   *\n> - * \\var Accumulator::rSum\n> + * \\var Accumulator::red\n\nThis was Accumulator::sum::red in v1, why has it changed ?\n\n>   * \\brief Sum of the average red values of each unsaturated cell in the zone\n>   *\n> - * \\var Accumulator::gSum\n> + * \\var Accumulator::green\n>   * \\brief Sum of the average green values of each unsaturated cell in the zone\n>   *\n> - * \\var Accumulator::bSum\n> + * \\var Accumulator::blue\n>   * \\brief Sum of the average blue values of each unsaturated cell in the zone\n>   */\n>  \n> @@ -206,10 +206,10 @@ void Awb::generateZones(std::vector<RGB> &zones)\n>  \t\tRGB zone;\n>  \t\tdouble counted = awbStats_[i].counted;\n>  \t\tif (counted >= kMinZonesCounted) {\n> -\t\t\tzone.G = awbStats_[i].gSum / counted;\n> +\t\t\tzone.G = awbStats_[i].sum.green / counted;\n>  \t\t\tif (zone.G >= kMinGreenLevelInZone) {\n> -\t\t\t\tzone.R = awbStats_[i].rSum / counted;\n> -\t\t\t\tzone.B = awbStats_[i].bSum / counted;\n> +\t\t\t\tzone.R = awbStats_[i].sum.red / counted;\n> +\t\t\t\tzone.B = awbStats_[i].sum.blue / counted;\n>  \t\t\t\tzones.push_back(zone);\n>  \t\t\t}\n>  \t\t}\n> @@ -242,9 +242,9 @@ void Awb::generateAwbStats(const ipu3_uapi_stats_3a *stats,\n>  \t\t\t\t/* The cell is not saturated, use the current cell */\n>  \t\t\t\tawbStats_[awbRegionPosition].counted++;\n>  \t\t\t\tuint32_t greenValue = currentCell->greenRedAvg + currentCell->greenBlueAvg;\n> -\t\t\t\tawbStats_[awbRegionPosition].gSum += greenValue / 2;\n> -\t\t\t\tawbStats_[awbRegionPosition].rSum += currentCell->redAvg;\n> -\t\t\t\tawbStats_[awbRegionPosition].bSum += currentCell->blueAvg;\n> +\t\t\t\tawbStats_[awbRegionPosition].sum.green += greenValue / 2;\n> +\t\t\t\tawbStats_[awbRegionPosition].sum.red += currentCell->redAvg;\n> +\t\t\t\tawbStats_[awbRegionPosition].sum.blue += currentCell->blueAvg;\n>  \t\t\t}\n>  \t\t}\n>  \t}\n> @@ -253,9 +253,9 @@ void Awb::generateAwbStats(const ipu3_uapi_stats_3a *stats,\n>  void Awb::clearAwbStats()\n>  {\n>  \tfor (unsigned int i = 0; i < kAwbStatsSizeX * kAwbStatsSizeY; i++) {\n> -\t\tawbStats_[i].bSum = 0;\n> -\t\tawbStats_[i].rSum = 0;\n> -\t\tawbStats_[i].gSum = 0;\n> +\t\tawbStats_[i].sum.blue = 0;\n> +\t\tawbStats_[i].sum.red = 0;\n> +\t\tawbStats_[i].sum.green = 0;\n>  \t\tawbStats_[i].counted = 0;\n>  \t}\n>  }\n> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n> index ac8ccc84..3385ebe7 100644\n> --- a/src/ipa/ipu3/algorithms/awb.h\n> +++ b/src/ipa/ipu3/algorithms/awb.h\n> @@ -35,9 +35,11 @@ struct Ipu3AwbCell {\n>  \n>  struct Accumulator {\n>  \tunsigned int counted;\n> -\tunsigned long long rSum;\n> -\tunsigned long long gSum;\n> -\tunsigned long long bSum;\n> +\tstruct {\n> +\t\tuint64_t red;\n> +\t\tuint64_t green;\n> +\t\tuint64_t blue;\n> +\t} sum;\n>  };\n>  \n>  class Awb : public Algorithm","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 2FDE3C3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Oct 2021 01:01:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 83A926918F;\n\tTue,  5 Oct 2021 03:01:20 +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 A02A369189\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Oct 2021 03:01:19 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EF42625B;\n\tTue,  5 Oct 2021 03:01:18 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"uB5e5DSe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633395679;\n\tbh=kx6m77ieFpWNeXiD2aWxMnWMhRUbUtci2cywYI80xo8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uB5e5DSewGmEvErX8URDwixFHFw1V9rJ1h6oM4l1BQgDM5MnYgLmRm+8bj5ZEEEhx\n\tp1AanXrMP52mCviFRjQIZXop3jVhLa3ozRZu8fqVnl+RRIHVDxCWuRUWOV4ZZM9umw\n\tRM0HYfLgQCRsL85H/7Ehaq9T/vOANG6a4hQquuFY=","Date":"Tue, 5 Oct 2021 04:01:12 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YVuj2HHcBQFGsrCT@pendragon.ideasonboard.com>","References":"<20210930093715.73293-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210930093715.73293-4-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210930093715.73293-4-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 03/12] ipa: ipu3: Change\n\tAccumulator structure layout","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20048,"web_url":"https://patchwork.libcamera.org/comment/20048/","msgid":"<b6c360f5-a40b-22e0-7da7-403455b075e4@ideasonboard.com>","date":"2021-10-05T05:34:33","subject":"Re: [libcamera-devel] [PATCH v2 03/12] ipa: ipu3: Change\n\tAccumulator structure layout","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 05/10/2021 03:01, Laurent Pinchart wrote:\n> Hi Jean-Michel,\n> \n> On Thu, Sep 30, 2021 at 11:37:06AM +0200, Jean-Michel Hautbois wrote:\n>> The pixel component sums for the Accumulator are inconsistent with other\n>> similar structures such as the IPAFrameContext::awb::gains. Group the\n>> red, green, and blue sums together in a struct and store them as\n>> uint64_t to reduce potential architectural differences.\n>>\n>> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n>> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>> ---\n>>  src/ipa/ipu3/algorithms/awb.cpp | 24 ++++++++++++------------\n>>  src/ipa/ipu3/algorithms/awb.h   |  8 +++++---\n>>  2 files changed, 17 insertions(+), 15 deletions(-)\n>>\n>> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n>> index fd2f12ca..5f61cb89 100644\n>> --- a/src/ipa/ipu3/algorithms/awb.cpp\n>> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n>> @@ -75,13 +75,13 @@ static constexpr uint32_t kMinGreenLevelInZone = 32;\n>>   * \\var Accumulator::counted\n>>   * \\brief Number of unsaturated cells used to calculate the sums\n>>   *\n>> - * \\var Accumulator::rSum\n>> + * \\var Accumulator::red\n> \n> This was Accumulator::sum::red in v1, why has it changed ?\n\nThis is an anticipation on the Documentation series because Doxygen\ncan't find Accumulator::sum::red because we use unamed structures to\ngroup items. I can keep the sum:: here and fix it in the next series if\nyou prefer ?\n\n> \n>>   * \\brief Sum of the average red values of each unsaturated cell in the zone\n>>   *\n>> - * \\var Accumulator::gSum\n>> + * \\var Accumulator::green\n>>   * \\brief Sum of the average green values of each unsaturated cell in the zone\n>>   *\n>> - * \\var Accumulator::bSum\n>> + * \\var Accumulator::blue\n>>   * \\brief Sum of the average blue values of each unsaturated cell in the zone\n>>   */\n>>  \n>> @@ -206,10 +206,10 @@ void Awb::generateZones(std::vector<RGB> &zones)\n>>  \t\tRGB zone;\n>>  \t\tdouble counted = awbStats_[i].counted;\n>>  \t\tif (counted >= kMinZonesCounted) {\n>> -\t\t\tzone.G = awbStats_[i].gSum / counted;\n>> +\t\t\tzone.G = awbStats_[i].sum.green / counted;\n>>  \t\t\tif (zone.G >= kMinGreenLevelInZone) {\n>> -\t\t\t\tzone.R = awbStats_[i].rSum / counted;\n>> -\t\t\t\tzone.B = awbStats_[i].bSum / counted;\n>> +\t\t\t\tzone.R = awbStats_[i].sum.red / counted;\n>> +\t\t\t\tzone.B = awbStats_[i].sum.blue / counted;\n>>  \t\t\t\tzones.push_back(zone);\n>>  \t\t\t}\n>>  \t\t}\n>> @@ -242,9 +242,9 @@ void Awb::generateAwbStats(const ipu3_uapi_stats_3a *stats,\n>>  \t\t\t\t/* The cell is not saturated, use the current cell */\n>>  \t\t\t\tawbStats_[awbRegionPosition].counted++;\n>>  \t\t\t\tuint32_t greenValue = currentCell->greenRedAvg + currentCell->greenBlueAvg;\n>> -\t\t\t\tawbStats_[awbRegionPosition].gSum += greenValue / 2;\n>> -\t\t\t\tawbStats_[awbRegionPosition].rSum += currentCell->redAvg;\n>> -\t\t\t\tawbStats_[awbRegionPosition].bSum += currentCell->blueAvg;\n>> +\t\t\t\tawbStats_[awbRegionPosition].sum.green += greenValue / 2;\n>> +\t\t\t\tawbStats_[awbRegionPosition].sum.red += currentCell->redAvg;\n>> +\t\t\t\tawbStats_[awbRegionPosition].sum.blue += currentCell->blueAvg;\n>>  \t\t\t}\n>>  \t\t}\n>>  \t}\n>> @@ -253,9 +253,9 @@ void Awb::generateAwbStats(const ipu3_uapi_stats_3a *stats,\n>>  void Awb::clearAwbStats()\n>>  {\n>>  \tfor (unsigned int i = 0; i < kAwbStatsSizeX * kAwbStatsSizeY; i++) {\n>> -\t\tawbStats_[i].bSum = 0;\n>> -\t\tawbStats_[i].rSum = 0;\n>> -\t\tawbStats_[i].gSum = 0;\n>> +\t\tawbStats_[i].sum.blue = 0;\n>> +\t\tawbStats_[i].sum.red = 0;\n>> +\t\tawbStats_[i].sum.green = 0;\n>>  \t\tawbStats_[i].counted = 0;\n>>  \t}\n>>  }\n>> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n>> index ac8ccc84..3385ebe7 100644\n>> --- a/src/ipa/ipu3/algorithms/awb.h\n>> +++ b/src/ipa/ipu3/algorithms/awb.h\n>> @@ -35,9 +35,11 @@ struct Ipu3AwbCell {\n>>  \n>>  struct Accumulator {\n>>  \tunsigned int counted;\n>> -\tunsigned long long rSum;\n>> -\tunsigned long long gSum;\n>> -\tunsigned long long bSum;\n>> +\tstruct {\n>> +\t\tuint64_t red;\n>> +\t\tuint64_t green;\n>> +\t\tuint64_t blue;\n>> +\t} sum;\n>>  };\n>>  \n>>  class Awb : public Algorithm\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 BAA56C3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Oct 2021 05:34:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2E18D691B6;\n\tTue,  5 Oct 2021 07:34:39 +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 CD70A6023D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Oct 2021 07:34:36 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:87c1:5a4a:3543:636a])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 54F5D25B;\n\tTue,  5 Oct 2021 07:34:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cgERAbs5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633412076;\n\tbh=VBjmqv+8p6CTSw9hJ7RTTbx91GWytVYtbb/LzqgjP1c=;\n\th=Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=cgERAbs5Bvh7XWsqcK8vjQs77AVhxJjlvNcf0pF2mNEuAvL2QlXZc4YvrjmoS/XJy\n\tdFz9iAuOy0rct6rWJkcBeGMZ/RvojjP1ExB/q6f/ZjvCDk8jS/P3lg4ZpJFvQAMssP\n\tD03GcbgLswO8YLh9u6S0XrvgvM+ZPUmX115THb0U=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20210930093715.73293-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210930093715.73293-4-jeanmichel.hautbois@ideasonboard.com>\n\t<YVuj2HHcBQFGsrCT@pendragon.ideasonboard.com>","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<b6c360f5-a40b-22e0-7da7-403455b075e4@ideasonboard.com>","Date":"Tue, 5 Oct 2021 07:34:33 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.13.0","MIME-Version":"1.0","In-Reply-To":"<YVuj2HHcBQFGsrCT@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 03/12] ipa: ipu3: Change\n\tAccumulator structure layout","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20052,"web_url":"https://patchwork.libcamera.org/comment/20052/","msgid":"<YVwRmb15sUmdN5qB@pendragon.ideasonboard.com>","date":"2021-10-05T08:49:29","subject":"Re: [libcamera-devel] [PATCH v2 03/12] ipa: ipu3: Change\n\tAccumulator structure layout","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nOn Tue, Oct 05, 2021 at 07:34:33AM +0200, Jean-Michel Hautbois wrote:\n> On 05/10/2021 03:01, Laurent Pinchart wrote:\n> > On Thu, Sep 30, 2021 at 11:37:06AM +0200, Jean-Michel Hautbois wrote:\n> >> The pixel component sums for the Accumulator are inconsistent with other\n> >> similar structures such as the IPAFrameContext::awb::gains. Group the\n> >> red, green, and blue sums together in a struct and store them as\n> >> uint64_t to reduce potential architectural differences.\n> >>\n> >> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> >> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >> ---\n> >>  src/ipa/ipu3/algorithms/awb.cpp | 24 ++++++++++++------------\n> >>  src/ipa/ipu3/algorithms/awb.h   |  8 +++++---\n> >>  2 files changed, 17 insertions(+), 15 deletions(-)\n> >>\n> >> diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\n> >> index fd2f12ca..5f61cb89 100644\n> >> --- a/src/ipa/ipu3/algorithms/awb.cpp\n> >> +++ b/src/ipa/ipu3/algorithms/awb.cpp\n> >> @@ -75,13 +75,13 @@ static constexpr uint32_t kMinGreenLevelInZone = 32;\n> >>   * \\var Accumulator::counted\n> >>   * \\brief Number of unsaturated cells used to calculate the sums\n> >>   *\n> >> - * \\var Accumulator::rSum\n> >> + * \\var Accumulator::red\n> > \n> > This was Accumulator::sum::red in v1, why has it changed ?\n> \n> This is an anticipation on the Documentation series because Doxygen\n> can't find Accumulator::sum::red because we use unamed structures to\n> group items. I can keep the sum:: here and fix it in the next series if\n> you prefer ?\n\nIf you look at the generated documentation without sum::, it's not good\neither. Let's keep it and please doxygen later.\n\n> >>   * \\brief Sum of the average red values of each unsaturated cell in the zone\n> >>   *\n> >> - * \\var Accumulator::gSum\n> >> + * \\var Accumulator::green\n> >>   * \\brief Sum of the average green values of each unsaturated cell in the zone\n> >>   *\n> >> - * \\var Accumulator::bSum\n> >> + * \\var Accumulator::blue\n> >>   * \\brief Sum of the average blue values of each unsaturated cell in the zone\n> >>   */\n> >>  \n> >> @@ -206,10 +206,10 @@ void Awb::generateZones(std::vector<RGB> &zones)\n> >>  \t\tRGB zone;\n> >>  \t\tdouble counted = awbStats_[i].counted;\n> >>  \t\tif (counted >= kMinZonesCounted) {\n> >> -\t\t\tzone.G = awbStats_[i].gSum / counted;\n> >> +\t\t\tzone.G = awbStats_[i].sum.green / counted;\n> >>  \t\t\tif (zone.G >= kMinGreenLevelInZone) {\n> >> -\t\t\t\tzone.R = awbStats_[i].rSum / counted;\n> >> -\t\t\t\tzone.B = awbStats_[i].bSum / counted;\n> >> +\t\t\t\tzone.R = awbStats_[i].sum.red / counted;\n> >> +\t\t\t\tzone.B = awbStats_[i].sum.blue / counted;\n> >>  \t\t\t\tzones.push_back(zone);\n> >>  \t\t\t}\n> >>  \t\t}\n> >> @@ -242,9 +242,9 @@ void Awb::generateAwbStats(const ipu3_uapi_stats_3a *stats,\n> >>  \t\t\t\t/* The cell is not saturated, use the current cell */\n> >>  \t\t\t\tawbStats_[awbRegionPosition].counted++;\n> >>  \t\t\t\tuint32_t greenValue = currentCell->greenRedAvg + currentCell->greenBlueAvg;\n> >> -\t\t\t\tawbStats_[awbRegionPosition].gSum += greenValue / 2;\n> >> -\t\t\t\tawbStats_[awbRegionPosition].rSum += currentCell->redAvg;\n> >> -\t\t\t\tawbStats_[awbRegionPosition].bSum += currentCell->blueAvg;\n> >> +\t\t\t\tawbStats_[awbRegionPosition].sum.green += greenValue / 2;\n> >> +\t\t\t\tawbStats_[awbRegionPosition].sum.red += currentCell->redAvg;\n> >> +\t\t\t\tawbStats_[awbRegionPosition].sum.blue += currentCell->blueAvg;\n> >>  \t\t\t}\n> >>  \t\t}\n> >>  \t}\n> >> @@ -253,9 +253,9 @@ void Awb::generateAwbStats(const ipu3_uapi_stats_3a *stats,\n> >>  void Awb::clearAwbStats()\n> >>  {\n> >>  \tfor (unsigned int i = 0; i < kAwbStatsSizeX * kAwbStatsSizeY; i++) {\n> >> -\t\tawbStats_[i].bSum = 0;\n> >> -\t\tawbStats_[i].rSum = 0;\n> >> -\t\tawbStats_[i].gSum = 0;\n> >> +\t\tawbStats_[i].sum.blue = 0;\n> >> +\t\tawbStats_[i].sum.red = 0;\n> >> +\t\tawbStats_[i].sum.green = 0;\n> >>  \t\tawbStats_[i].counted = 0;\n> >>  \t}\n> >>  }\n> >> diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\n> >> index ac8ccc84..3385ebe7 100644\n> >> --- a/src/ipa/ipu3/algorithms/awb.h\n> >> +++ b/src/ipa/ipu3/algorithms/awb.h\n> >> @@ -35,9 +35,11 @@ struct Ipu3AwbCell {\n> >>  \n> >>  struct Accumulator {\n> >>  \tunsigned int counted;\n> >> -\tunsigned long long rSum;\n> >> -\tunsigned long long gSum;\n> >> -\tunsigned long long bSum;\n> >> +\tstruct {\n> >> +\t\tuint64_t red;\n> >> +\t\tuint64_t green;\n> >> +\t\tuint64_t blue;\n> >> +\t} sum;\n> >>  };\n> >>  \n> >>  class Awb : public Algorithm","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 2BA67BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 Oct 2021 08:49:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 90A2D691AD;\n\tTue,  5 Oct 2021 10:49:38 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E4FE5684C6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Oct 2021 10:49:36 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BD15A2A;\n\tTue,  5 Oct 2021 10:49:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"nekLSqn+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633423776;\n\tbh=L1xHLkl3q+L4jm8oIyDZe4MEC2SrtYRqQ4R+UwbR0Lo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nekLSqn+VaEiasae3R3Ug1dLH93dPY5XIzfQpZzEeveelrEUHoieqbN854VRLWYVq\n\tZqBZOSN4Mr0m2DP2T+D8u7kVD+plW6k8IoKGN/UdnJjstQ5APEgZtqOGm+l+z3++B5\n\tPJ2QwlY0ZuqT2+h+s+9v4/QmC5qZ/fQXAP7ii26Q=","Date":"Tue, 5 Oct 2021 11:49:29 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YVwRmb15sUmdN5qB@pendragon.ideasonboard.com>","References":"<20210930093715.73293-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20210930093715.73293-4-jeanmichel.hautbois@ideasonboard.com>\n\t<YVuj2HHcBQFGsrCT@pendragon.ideasonboard.com>\n\t<b6c360f5-a40b-22e0-7da7-403455b075e4@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<b6c360f5-a40b-22e0-7da7-403455b075e4@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 03/12] ipa: ipu3: Change\n\tAccumulator structure layout","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]