[{"id":32182,"web_url":"https://patchwork.libcamera.org/comment/32182/","msgid":"<173167206023.4187655.52889474979082915@ping.linuxembedded.co.uk>","date":"2024-11-15T12:01:00","subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Daniel Scally (2024-11-15 07:46:26)\n> Use the centralised libipa helpers rather than open coding common\n> functions.\n> \n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> ---\n> Changes in v3:\n> \n>         - None\n> \n> Changes in v2:\n> \n>         - None. Jacopo; this isn't in the libcamera::ipa namespace. As an\n>           alternative to the prefix I could \"using namespace libcamera::ipa\" if\n>           that's better?\n> \n>  src/ipa/rpi/controller/rpi/agc_channel.cpp | 10 ++++++----\n>  1 file changed, 6 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> index c9df9b5b..8583f4f3 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -12,6 +12,8 @@\n>  \n>  #include <libcamera/base/log.h>\n>  \n> +#include \"libipa/colours.h\"\n> +\n>  #include \"../awb_status.h\"\n>  #include \"../device_status.h\"\n>  #include \"../histogram.h\"\n> @@ -694,11 +696,11 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,\n>         double ySum;\n>         /* Factor in the AWB correction if needed. */\n>         if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb) {\n> -               ySum = rSum * awb.gainR * .299 +\n> -                      gSum * awb.gainG * .587 +\n> -                      bSum * awb.gainB * .114;\n> +               ySum = ipa::rec601LuminanceFromRGB(rSum * awb.gainR,\n> +                                                  gSum * awb.gainG,\n> +                                                  bSum * awb.gainB);\n>         } else\n> -               ySum = rSum * .299 + gSum * .587 + bSum * .114;\n> +               ySum = ipa::rec601LuminanceFromRGB(rSum, gSum, bSum);\n\nThis looks fine to me - but it needs an Ack from RPi.\n\nI think it's up to RPi whether to specify using namespace libcamera::ipa\nor not too.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  \n>         return ySum / pixelSum / (1 << 16);\n>  }\n> -- \n> 2.30.2\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 E5826C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Nov 2024 12:01:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EE6FE6587C;\n\tFri, 15 Nov 2024 13:01:04 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D74926580A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Nov 2024 13:01:03 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DEB06496;\n\tFri, 15 Nov 2024 13:00:48 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"n8Fsyv4k\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731672049;\n\tbh=4tjqECESyleKxF0DUPBHDJ1zObjpyaWq2nM6U0Cj+0E=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=n8Fsyv4k9cLmcRaeVR12DXv0NhQi+KXGLY2xzIU+P/J/7d3kSOGkTOlsRL/D+yNIg\n\tu0mXCIBMbwtFO8uqb5p8zwuYrpYiNEa2Jb56uOY2vv21s4I1ExRQGDNYRX01r7cYwK\n\t7hWa7zi5jV4CDRu/xbEP92BygRGL75Ttrta1jGHQ=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241115074628.417215-5-dan.scally@ideasonboard.com>","References":"<20241115074628.417215-1-dan.scally@ideasonboard.com>\n\t<20241115074628.417215-5-dan.scally@ideasonboard.com>","Subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"mike.rudenko@gmail.com, Daniel Scally <dan.scally@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 15 Nov 2024 12:01:00 +0000","Message-ID":"<173167206023.4187655.52889474979082915@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":32206,"web_url":"https://patchwork.libcamera.org/comment/32206/","msgid":"<20241118005422.GH30787@pendragon.ideasonboard.com>","date":"2024-11-18T00:54:22","subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Dabn\n\nThank you for the patch.\n\nOn Fri, Nov 15, 2024 at 07:46:26AM +0000, Daniel Scally wrote:\n> Use the centralised libipa helpers rather than open coding common\n> functions.\n> \n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> Changes in v3:\n> \n> \t- None\n> \n> Changes in v2:\n> \n> \t- None. Jacopo; this isn't in the libcamera::ipa namespace. As an\n> \t  alternative to the prefix I could \"using namespace libcamera::ipa\" if\n> \t  that's better?\n> \n>  src/ipa/rpi/controller/rpi/agc_channel.cpp | 10 ++++++----\n>  1 file changed, 6 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> index c9df9b5b..8583f4f3 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -12,6 +12,8 @@\n>  \n>  #include <libcamera/base/log.h>\n>  \n> +#include \"libipa/colours.h\"\n> +\n>  #include \"../awb_status.h\"\n>  #include \"../device_status.h\"\n>  #include \"../histogram.h\"\n> @@ -694,11 +696,11 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,\n>  \tdouble ySum;\n>  \t/* Factor in the AWB correction if needed. */\n>  \tif (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb) {\n> -\t\tySum = rSum * awb.gainR * .299 +\n> -\t\t       gSum * awb.gainG * .587 +\n> -\t\t       bSum * awb.gainB * .114;\n> +\t\tySum = ipa::rec601LuminanceFromRGB(rSum * awb.gainR,\n> +\t\t\t\t\t\t   gSum * awb.gainG,\n> +\t\t\t\t\t\t   bSum * awb.gainB);\n>  \t} else\n> -\t\tySum = rSum * .299 + gSum * .587 + bSum * .114;\n> +\t\tySum = ipa::rec601LuminanceFromRGB(rSum, gSum, bSum);\n>  \n>  \treturn ySum / pixelSum / (1 << 16);\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 6C94BC32DD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Nov 2024 00:54:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 62902658B5;\n\tMon, 18 Nov 2024 01:54:33 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A7AF0600F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2024 01:54:31 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1B9E375A;\n\tMon, 18 Nov 2024 01:54:15 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SPSbwfr0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731891255;\n\tbh=4qnwsdCwSc6XB4AeHXdRhEwMl13OpjD1uswPKPpekSs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SPSbwfr0z2k0B2NcloPYHIx6+ce3NYMZyNrmONs6rFX9O/P4Hev11aGoP6HvrXxmJ\n\tEvkbN0fMb8qmc2hxtAigyuG79DfvEuewn60JRD+Vjkebch9t48nWa87BZtsOeM+HZu\n\toyofAjjEALo8Z3U9OaI8MtTeT9cFIAGYtOAtdeAI=","Date":"Mon, 18 Nov 2024 02:54:22 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, mike.rudenko@gmail.com","Subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","Message-ID":"<20241118005422.GH30787@pendragon.ideasonboard.com>","References":"<20241115074628.417215-1-dan.scally@ideasonboard.com>\n\t<20241115074628.417215-5-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241115074628.417215-5-dan.scally@ideasonboard.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":32237,"web_url":"https://patchwork.libcamera.org/comment/32237/","msgid":"<5133394f-11dd-48ab-b55e-99ad4969ec27@ideasonboard.com>","date":"2024-11-18T15:27:30","subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"+CC to David & Naush\n\nOn 15/11/2024 12:01, Kieran Bingham wrote:\n> Quoting Daniel Scally (2024-11-15 07:46:26)\n>> Use the centralised libipa helpers rather than open coding common\n>> functions.\n>>\n>> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n>> ---\n>> Changes in v3:\n>>\n>>          - None\n>>\n>> Changes in v2:\n>>\n>>          - None. Jacopo; this isn't in the libcamera::ipa namespace. As an\n>>            alternative to the prefix I could \"using namespace libcamera::ipa\" if\n>>            that's better?\n>>\n>>   src/ipa/rpi/controller/rpi/agc_channel.cpp | 10 ++++++----\n>>   1 file changed, 6 insertions(+), 4 deletions(-)\n>>\n>> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n>> index c9df9b5b..8583f4f3 100644\n>> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n>> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n>> @@ -12,6 +12,8 @@\n>>   \n>>   #include <libcamera/base/log.h>\n>>   \n>> +#include \"libipa/colours.h\"\n>> +\n>>   #include \"../awb_status.h\"\n>>   #include \"../device_status.h\"\n>>   #include \"../histogram.h\"\n>> @@ -694,11 +696,11 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,\n>>          double ySum;\n>>          /* Factor in the AWB correction if needed. */\n>>          if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb) {\n>> -               ySum = rSum * awb.gainR * .299 +\n>> -                      gSum * awb.gainG * .587 +\n>> -                      bSum * awb.gainB * .114;\n>> +               ySum = ipa::rec601LuminanceFromRGB(rSum * awb.gainR,\n>> +                                                  gSum * awb.gainG,\n>> +                                                  bSum * awb.gainB);\n>>          } else\n>> -               ySum = rSum * .299 + gSum * .587 + bSum * .114;\n>> +               ySum = ipa::rec601LuminanceFromRGB(rSum, gSum, bSum);\n> This looks fine to me - but it needs an Ack from RPi.\n>\n> I think it's up to RPi whether to specify using namespace libcamera::ipa\n> or not too.\n\n\nSorry to chase but we wanted to try to merge this set to cut back the number of conflicting series \nin flight - is this change alright by you?\n\n\nThanks\n\nDan\n\n>\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n>>   \n>>          return ySum / pixelSum / (1 << 16);\n>>   }\n>> -- \n>> 2.30.2\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 B6EDAC32DD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Nov 2024 15:27:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C7350658E4;\n\tMon, 18 Nov 2024 16:27:35 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2B6A8658DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2024 16:27:34 +0100 (CET)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EF6DD34D;\n\tMon, 18 Nov 2024 16:27:16 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"BtEOuh0I\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731943637;\n\tbh=SCp1OG8TZI6AuOQLG0etsiitKhDc0pCvtA4Oiid41f0=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=BtEOuh0IZXTpb7XAveHxugfJa3MWeE16JQRZYiGgAmvSMr3fjBstaFlzULKv0y0a1\n\tmnUK5++gxYAVCzdQs9thlzHqogLPN8xVq4PBOfPDb9ToodW79qPMWh1ACb3EwYdp+I\n\tubPmvrtQE9c8jorjbVhWcGzGkSYHgOQEYEB519BM=","Message-ID":"<5133394f-11dd-48ab-b55e-99ad4969ec27@ideasonboard.com>","Date":"Mon, 18 Nov 2024 15:27:30 +0000","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"mike.rudenko@gmail.com, naush@raspberrypi.com,\n\tdavid.plowman@raspberrypi.com","References":"<20241115074628.417215-1-dan.scally@ideasonboard.com>\n\t<20241115074628.417215-5-dan.scally@ideasonboard.com>\n\t<173167206023.4187655.52889474979082915@ping.linuxembedded.co.uk>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","Autocrypt":"addr=dan.scally@ideasonboard.com; keydata=\n\txsFNBGLydlEBEADa5O2s0AbUguprfvXOQun/0a8y2Vk6BqkQALgeD6KnXSWwaoCULp18etYW\n\tB31bfgrdphXQ5kUQibB0ADK8DERB4wrzrUb5CMxLBFE7mQty+v5NsP0OFNK9XTaAOcmD+Ove\n\teIjYvqurAaro91jrRVrS1gBRxIFqyPgNvwwL+alMZhn3/2jU2uvBmuRrgnc/e9cHKiuT3Dtq\n\tMHGPKL2m+plk+7tjMoQFfexoQ1JKugHAjxAhJfrkXh6uS6rc01bYCyo7ybzg53m1HLFJdNGX\n\tsUKR+dQpBs3SY4s66tc1sREJqdYyTsSZf80HjIeJj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3YkVIj3p3gvfM\n\tRes4fGX94Ji599uLNrPoxKyaytC4R6BTxVriTJjWK8mbo9jZIRM4vkwkZZ2bu98EweSucxbp\n\tvjESsvMXGgxniqV/RQ/3T7LABYRoIUutARYq58p5HwSP0frF0fdFHYdTa2g7MYZl1ur2JzOC\n\tFHRpGadlNzKDE3fEdoMobxHB3Lm6FDml5GyBAA8+dQYVI0oDwJ3gpZPZ0J5Vx9RbqXe8RDuR\n\tdu90hvCJkq7/tzSQ0GeD3BwXb9/R/A4dVXhaDd91Q1qQXidI+2jwhx8iqiYxbT+DoAUkQRQy\n\txBtoCM1CxH7u45URUgD//fxYr3D4B1SlonA6vdaEdHZOGwECnDpTxecENMbz/Bx7qfrmd901\n\tD+N9SjIwrbVhhSyUXYnSUb8F+9g2RDY42Sk7GcYxIeON4VzKqWM7hpkXZ47pkK0YodO+dRKM\n\tyMcoUWrTK0Uz6UzUGKoJVbxmSW/EJLEGoI5p3NWxWtScEVv8mO49gqQdrRIOheZycDmHnItt\n\t9Qjv00uFhEwv2YfiyGk6iGF2W40s2pH2t6oeuGgmiZ7g6d0MEK8Ql/4zPItvr1c1rpwpXUC1\n\tu1kQWgtnNjFHX3KiYdqjcZeRBiry1X0zY+4Y24wUU0KsEewJwjhmCKAsju1RpdlPg2kC","In-Reply-To":"<173167206023.4187655.52889474979082915@ping.linuxembedded.co.uk>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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":32239,"web_url":"https://patchwork.libcamera.org/comment/32239/","msgid":"<CAEmqJPrZzHP=PusDWpKmyCngBbZiuNt4PtvA4eHuFPaPcAds9w@mail.gmail.com>","date":"2024-11-18T15:39:54","subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Dan,\n\n\nOn Fri, 15 Nov 2024 at 07:46, Daniel Scally <dan.scally@ideasonboard.com> wrote:\n>\n> Use the centralised libipa helpers rather than open coding common\n> functions.\n>\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n\nThis looks fine.\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n> ---\n> Changes in v3:\n>\n>         - None\n>\n> Changes in v2:\n>\n>         - None. Jacopo; this isn't in the libcamera::ipa namespace. As an\n>           alternative to the prefix I could \"using namespace libcamera::ipa\" if\n>           that's better?\n>\n>  src/ipa/rpi/controller/rpi/agc_channel.cpp | 10 ++++++----\n>  1 file changed, 6 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> index c9df9b5b..8583f4f3 100644\n> --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp\n> @@ -12,6 +12,8 @@\n>\n>  #include <libcamera/base/log.h>\n>\n> +#include \"libipa/colours.h\"\n> +\n>  #include \"../awb_status.h\"\n>  #include \"../device_status.h\"\n>  #include \"../histogram.h\"\n> @@ -694,11 +696,11 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,\n>         double ySum;\n>         /* Factor in the AWB correction if needed. */\n>         if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb) {\n> -               ySum = rSum * awb.gainR * .299 +\n> -                      gSum * awb.gainG * .587 +\n> -                      bSum * awb.gainB * .114;\n> +               ySum = ipa::rec601LuminanceFromRGB(rSum * awb.gainR,\n> +                                                  gSum * awb.gainG,\n> +                                                  bSum * awb.gainB);\n>         } else\n> -               ySum = rSum * .299 + gSum * .587 + bSum * .114;\n> +               ySum = ipa::rec601LuminanceFromRGB(rSum, gSum, bSum);\n>\n>         return ySum / pixelSum / (1 << 16);\n>  }\n> --\n> 2.30.2\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 E28A8C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 18 Nov 2024 15:40:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1245D658E6;\n\tMon, 18 Nov 2024 16:40:34 +0100 (CET)","from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com\n\t[IPv6:2607:f8b0:4864:20::1130])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D9070658E2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2024 16:40:31 +0100 (CET)","by mail-yw1-x1130.google.com with SMTP id\n\t00721157ae682-6eea5763561so408527b3.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 18 Nov 2024 07:40:31 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"MD+n4ENY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1731944430; x=1732549230;\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=eJaO6f02kBjhFTI9RNCHQcxUPP7x6DMTD65VoF3NaHQ=;\n\tb=MD+n4ENYC7oyC/zprr2aux7GBXE4SrBKvI0RZb/pmmAsNoIk7OPCqHeb8xHcS8k+Rx\n\trFHVcVh/uwjd2a/oxVl78hPM7jZ6DxMz0QYcDm2PtZPq3VLtu4+DthtXAbRdkGxci4sq\n\tq9uOebV5vgtZefphkploaGb2Nex6H2gkHFNfvtVEhsxXoWekfrzh5vSTJ36xLTOSKs/W\n\tHQvNcDWRoYfdJsZKaUgFZGt3toNtaClkSHH2ALf/0vq0D08VQzhnh23nBXj4ir6BsuRv\n\tdXgFAxvYhaIA0QrTwJxFVPcp/C1gBGJcTUm/6XpvLVEeHWOIV042DlFxEu73I9v7i5Fv\n\tFGEA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1731944430; x=1732549230;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=eJaO6f02kBjhFTI9RNCHQcxUPP7x6DMTD65VoF3NaHQ=;\n\tb=vbPbM7BFWS82Jtw29bit2T7cIeJNmhFsnEbg/G5APrQPbizIGzkeRtMknXmzsH+TJK\n\t1JH+9PTqQyZdHmsRmKAo4RQGRXmCZG0XtAwLsV7nEA5qcvODpb/Q/L84LetJ6vB61ekH\n\tHVEpB6rEWbnlLU8IT1E91yYAfrnUzHCOcvsyQOB8TT1dWTXwRVi/8zFqRpExnaIVLLJ/\n\twkz/fu8lGFqkLU0L27mPrz+EDNoZ9c9iZJUANV3xmfDo3VmhXbqUJOPvFyVAUcE6VoeR\n\tqsNUx/9WC+V5Hae2qtbKb+bEnjywNZrzeh0t7S1eA2sdALGZNwwU2dF7e/nxba3vjKyw\n\tizTw==","X-Gm-Message-State":"AOJu0YwuAMdGhEuAxNdgKFVSk20LJGPxdcia1kcU4oAHPsP+EEVAJOMV\n\tDWKjHmTRi7LnR57xqdqsSkUvaDouWp1vizcx/q4NHvcbCtEvXhB2TovHtGY6bz3CE9xQViZJxjH\n\tTPp6nCOHIxWagL7CvrSwcNA5+co9jlqBkrkuhfUS4fmKvJumK","X-Google-Smtp-Source":"AGHT+IFwwP2fU+9UKUj7muLMfdW4VVS3jIDMSxWm2kZ/g/rKAEsJq3vaDLlpCqEj8gF4wzEcWeuZaOeodxvtN26R5Qg=","X-Received":"by 2002:a05:690c:46c4:b0:6ea:8794:eab7 with SMTP id\n\t00721157ae682-6ee55a2f5f0mr50570397b3.2.1731944430600;\n\tMon, 18 Nov 2024 07:40:30 -0800 (PST)","MIME-Version":"1.0","References":"<20241115074628.417215-1-dan.scally@ideasonboard.com>\n\t<20241115074628.417215-5-dan.scally@ideasonboard.com>","In-Reply-To":"<20241115074628.417215-5-dan.scally@ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 18 Nov 2024 15:39:54 +0000","Message-ID":"<CAEmqJPrZzHP=PusDWpKmyCngBbZiuNt4PtvA4eHuFPaPcAds9w@mail.gmail.com>","Subject":"Re: [PATCH v3 4/6] ipa: rpi: Use centralised libipa helpers","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, mike.rudenko@gmail.com","Content-Type":"text/plain; charset=\"UTF-8\"","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>"}}]