[{"id":32078,"web_url":"https://patchwork.libcamera.org/comment/32078/","msgid":"<toidl7jr3vqyc5oprjqdauza4alxxrmoackbhhzrq56dgifbup@uctotunskdzw>","date":"2024-11-08T15:19:29","subject":"Re: [PATCH v2 4/6] ipa: rpi: Use centralised libipa helpers","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Dan\n\nOn Thu, Nov 07, 2024 at 10:25:06AM +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> ---\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\nIf that's not in the ipa:: namespace then it's fine to specify it\n\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..30e94b9b 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/helpers.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      gSum * awb.gainG,\n> +\t\t\t\t\t      bSum * awb.gainB);\n\nAlgined to the open ( ?\n\nThanks\n  j\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>  }\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 C4C41C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  8 Nov 2024 15:19:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7DDD9657AC;\n\tFri,  8 Nov 2024 16:19:34 +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 9D58E6546C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  8 Nov 2024 16:19:32 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 00D3D2E0;\n\tFri,  8 Nov 2024 16:19:22 +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=\"kuROcRH/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731079163;\n\tbh=LzVlq1L2bN3Ij+4qFAnKsmUEBL7XoBgsVZtF1KeWXX4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=kuROcRH/ddXLkMTD2Bo8wsnexsRhr+SKponPxxNiIyxQjjLOb4SukmI3vdjidLcBz\n\tgfouWnEtqUSw1dV+SsHkYFJDFE3FgKOIG6iZFrsVi8dGI5mhueviSDWq0s3EWbkmKW\n\tuYJxj0PMOozqqos02LMMd10Vw3fxILVVdbZAh7yo=","Date":"Fri, 8 Nov 2024 16:19:29 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, mike.rudenko@gmail.com","Subject":"Re: [PATCH v2 4/6] ipa: rpi: Use centralised libipa helpers","Message-ID":"<toidl7jr3vqyc5oprjqdauza4alxxrmoackbhhzrq56dgifbup@uctotunskdzw>","References":"<20241107102508.48322-1-dan.scally@ideasonboard.com>\n\t<20241107102508.48322-5-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241107102508.48322-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>"}}]