[{"id":36022,"web_url":"https://patchwork.libcamera.org/comment/36022/","msgid":"<f8259b1c-37a3-4e72-9f55-6b190c9e91ce@ideasonboard.com>","date":"2025-09-29T10:14:26","subject":"Re: [PATCH v4 5/7] libcamera: simple: Avoid incorrect arithmetic in\n\tAWB","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 09. 25. 21:28 keltezéssel, Milan Zamazal írta:\n> The R/G/B sums computed in AWB simple IPA may be zero or perhaps even\n> negative.  Let's make sure the sums are always positive, to prevent\n> division by zero or completely nonsense results.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   src/ipa/simple/algorithms/awb.cpp | 10 ++++++----\n>   1 file changed, 6 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp\n> index cf567e894..8231a4968 100644\n> --- a/src/ipa/simple/algorithms/awb.cpp\n> +++ b/src/ipa/simple/algorithms/awb.cpp\n> @@ -7,6 +7,7 @@\n>   \n>   #include \"awb.h\"\n>   \n> +#include <algorithm>\n>   #include <numeric>\n>   #include <stdint.h>\n>   \n> @@ -68,10 +69,11 @@ void Awb::process(IPAContext &context,\n>   \t */\n>   \tconst uint64_t nPixels = std::accumulate(\n>   \t\thistogram.begin(), histogram.end(), 0);\n\nAn unrelated thing I noticed. I think the intention may have been to have something like\n\n   const uint64_t nPixels = std::accumulate(histogram.begin(), histogram.end(), uint64_t(0));\n\nbecause otherwise the summation will use the type of `0`, which is just `int`.\n\n\n> -\tconst uint64_t offset = blackLevel * nPixels;\n> -\tconst uint64_t sumR = stats->sumR_ - offset / 4;\n> -\tconst uint64_t sumG = stats->sumG_ - offset / 2;\n> -\tconst uint64_t sumB = stats->sumB_ - offset / 4;\n> +\tconst int64_t offset = blackLevel * nPixels;\n> +\tconst int64_t minValid = 1;\n> +\tconst uint64_t sumR = std::max(static_cast<int64_t>(stats->sumR_) - offset / 4, minValid);\n> +\tconst uint64_t sumG = std::max(static_cast<int64_t>(stats->sumG_) - offset / 2, minValid);\n> +\tconst uint64_t sumB = std::max(static_cast<int64_t>(stats->sumB_) - offset / 4, minValid);\n\nHave you seen this wrap-around in practice? In any case, the checks looks reasonable,\nbut I would potentially do the following to avoid going through a singed type:\n\n   sumR = stats->sumR_ > offset / 4 ? stats->sumR - offset / 4 : 1;\n\n\nReviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n\n\n>   \n>   \t/*\n>   \t * Calculate red and blue gains for AWB.","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 831C5C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Sep 2025 10:14:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0628D6B5F8;\n\tMon, 29 Sep 2025 12:14:33 +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 86E0A6B599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Sep 2025 12:14:30 +0200 (CEST)","from [192.168.33.13] (185.221.142.146.nat.pool.zt.hu\n\t[185.221.142.146])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8C8981121;\n\tMon, 29 Sep 2025 12:13:02 +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=\"DqYW1lbF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759140782;\n\tbh=8eVizgexGFIRuYpFEAxoItiQUOkj9gNjgVzVQyvUQLM=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=DqYW1lbFVkDDylqsGADcC8DZyZy/e9Z1BU3Etumf2QzTDFhjDbuMbzjcxu4OQQ09g\n\t3AEXDSdGVJCIV2uVx8G4UpGDT9ZNBSV/FeTntH3W6vQINx9cceGGKYsKCVR3D8BvYw\n\tIlSvHAeqvChso6CxPUN9BdiGXZUTmOw6sNBWFcws=","Message-ID":"<f8259b1c-37a3-4e72-9f55-6b190c9e91ce@ideasonboard.com>","Date":"Mon, 29 Sep 2025 12:14:26 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 5/7] libcamera: simple: Avoid incorrect arithmetic in\n\tAWB","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"mail@maciej.szmigiero.name, libcamera-devel@lists.libcamera.org","References":"<20250925192856.77881-1-mzamazal@redhat.com>\n\t<20250925192856.77881-6-mzamazal@redhat.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250925192856.77881-6-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":36033,"web_url":"https://patchwork.libcamera.org/comment/36033/","msgid":"<aaea5505-2838-4d80-83de-89efc58e49b6@kernel.org>","date":"2025-09-29T11:33:01","subject":"Re: [PATCH v4 5/7] libcamera: simple: Avoid incorrect arithmetic in\n\tAWB","submitter":{"id":239,"url":"https://patchwork.libcamera.org/api/people/239/","name":"Hans de Goede","email":"hansg@kernel.org"},"content":"Hi,\n\nOn 25-Sep-25 21:28, Milan Zamazal wrote:\n> The R/G/B sums computed in AWB simple IPA may be zero or perhaps even\n> negative.  Let's make sure the sums are always positive, to prevent\n> division by zero or completely nonsense results.\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nThanks, patch looks good to me:\n\nReviewed-by: Hans de Goede <hansg@kernel.org>\n\nRegards,\n\nHans\n\n\n\n> ---\n>  src/ipa/simple/algorithms/awb.cpp | 10 ++++++----\n>  1 file changed, 6 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp\n> index cf567e894..8231a4968 100644\n> --- a/src/ipa/simple/algorithms/awb.cpp\n> +++ b/src/ipa/simple/algorithms/awb.cpp\n> @@ -7,6 +7,7 @@\n>  \n>  #include \"awb.h\"\n>  \n> +#include <algorithm>\n>  #include <numeric>\n>  #include <stdint.h>\n>  \n> @@ -68,10 +69,11 @@ void Awb::process(IPAContext &context,\n>  \t */\n>  \tconst uint64_t nPixels = std::accumulate(\n>  \t\thistogram.begin(), histogram.end(), 0);\n> -\tconst uint64_t offset = blackLevel * nPixels;\n> -\tconst uint64_t sumR = stats->sumR_ - offset / 4;\n> -\tconst uint64_t sumG = stats->sumG_ - offset / 2;\n> -\tconst uint64_t sumB = stats->sumB_ - offset / 4;\n> +\tconst int64_t offset = blackLevel * nPixels;\n> +\tconst int64_t minValid = 1;\n> +\tconst uint64_t sumR = std::max(static_cast<int64_t>(stats->sumR_) - offset / 4, minValid);\n> +\tconst uint64_t sumG = std::max(static_cast<int64_t>(stats->sumG_) - offset / 2, minValid);\n> +\tconst uint64_t sumB = std::max(static_cast<int64_t>(stats->sumB_) - offset / 4, minValid);\n>  \n>  \t/*\n>  \t * Calculate red and blue gains for AWB.","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 0401DC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Sep 2025 11:33:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C73D6B5F8;\n\tMon, 29 Sep 2025 13:33:06 +0200 (CEST)","from sea.source.kernel.org (sea.source.kernel.org\n\t[IPv6:2600:3c0a:e001:78e:0:1991:8:25])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EAA026B599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Sep 2025 13:33:04 +0200 (CEST)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby sea.source.kernel.org (Postfix) with ESMTP id C40C640271;\n\tMon, 29 Sep 2025 11:33:03 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id A7F11C4CEF4;\n\tMon, 29 Sep 2025 11:33:02 +0000 (UTC)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=kernel.org header.i=@kernel.org\n\theader.b=\"tA4XSFi9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1759145583;\n\tbh=bfNxf0+fNEbiULtLFKTW+jhIsj8eavq7lxEYaXlCSyE=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=tA4XSFi9MA8qO40sHdMgjdU7Xg1V/NGhZUEa427oHzYPM2kMbhZSPHFcLJKwXdXzv\n\tweoG/GzN9NGCBY07pG1zkinXvuPerm3Pm4QqQMuhslcuz29IaFoN7RBqEXkK/MqhmT\n\tDQckHUDGsegT21d5JJZ0W9Cx43FHlLDxTYu5iVgKO5Fkj4Mxj0+qsVCDmAibgfE+Hv\n\tSGT0jpGgR00Cyvj+K/Vwh3uFBVg3vKMA2Xpz9ONklOJ3G3zLZHxBnJefXCDAVaRBEs\n\tB4wEds6A3VNr4zTFUC7eiFoAs7EI35QEH8oUxMOm9oHInalvCxHcy6a9BOqyInV30r\n\tZXT6bhKDLbmIw==","Message-ID":"<aaea5505-2838-4d80-83de-89efc58e49b6@kernel.org>","Date":"Mon, 29 Sep 2025 13:33:01 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v4 5/7] libcamera: simple: Avoid incorrect arithmetic in\n\tAWB","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"pobrn@protonmail.com, mail@maciej.szmigiero.name","References":"<20250925192856.77881-1-mzamazal@redhat.com>\n\t<20250925192856.77881-6-mzamazal@redhat.com>","From":"Hans de Goede <hansg@kernel.org>","Content-Language":"en-US, nl","In-Reply-To":"<20250925192856.77881-6-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8","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":36039,"web_url":"https://patchwork.libcamera.org/comment/36039/","msgid":"<85tt0lpf88.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-09-29T13:20:39","subject":"Re: [PATCH v4 5/7] libcamera: simple: Avoid incorrect arithmetic in\n\tAWB","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> Hi\n>\n> 2025. 09. 25. 21:28 keltezéssel, Milan Zamazal írta:\n>> The R/G/B sums computed in AWB simple IPA may be zero or perhaps even\n>> negative.  Let's make sure the sums are always positive, to prevent\n>> division by zero or completely nonsense results.\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   src/ipa/simple/algorithms/awb.cpp | 10 ++++++----\n>>   1 file changed, 6 insertions(+), 4 deletions(-)\n>> diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp\n>> index cf567e894..8231a4968 100644\n>> --- a/src/ipa/simple/algorithms/awb.cpp\n>> +++ b/src/ipa/simple/algorithms/awb.cpp\n>> @@ -7,6 +7,7 @@\n>>     #include \"awb.h\"\n>>   +#include <algorithm>\n>>   #include <numeric>\n>>   #include <stdint.h>\n>>   @@ -68,10 +69,11 @@ void Awb::process(IPAContext &context,\n>>   \t */\n>>   \tconst uint64_t nPixels = std::accumulate(\n>>   \t\thistogram.begin(), histogram.end(), 0);\n>\n> An unrelated thing I noticed. I think the intention may have been to have something like\n>\n>   const uint64_t nPixels = std::accumulate(histogram.begin(), histogram.end(), uint64_t(0));\n>\n> because otherwise the summation will use the type of `0`, which is just `int`.\n\nOh, thanks for catching this.\n\n>> -\tconst uint64_t offset = blackLevel * nPixels;\n>> -\tconst uint64_t sumR = stats->sumR_ - offset / 4;\n>> -\tconst uint64_t sumG = stats->sumG_ - offset / 2;\n>> -\tconst uint64_t sumB = stats->sumB_ - offset / 4;\n>> +\tconst int64_t offset = blackLevel * nPixels;\n>> +\tconst int64_t minValid = 1;\n>> +\tconst uint64_t sumR = std::max(static_cast<int64_t>(stats->sumR_) - offset / 4, minValid);\n>> +\tconst uint64_t sumG = std::max(static_cast<int64_t>(stats->sumG_) - offset / 2, minValid);\n>> +\tconst uint64_t sumB = std::max(static_cast<int64_t>(stats->sumB_) - offset / 4, minValid);\n>\n> Have you seen this wrap-around in practice? \n\nNo.  But it could happen at least if the black level value was wrong.\nOr if the black level values were different for R, G, B.  In which cases\nthe computations here would be generally wrong but at least not\ncompletely crazy.  Better to be on the safe side.\n\n> In any case, the checks looks reasonable, but I would potentially do\n> the following to avoid going through a singed type:\n>\n>   sumR = stats->sumR_ > offset / 4 ? stats->sumR - offset / 4 : 1;\n\nOK.\n\n> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>\n>\n>>     \t/*\n>>   \t * Calculate red and blue gains for AWB.","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 6299FC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Sep 2025 13:20:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 20D656B5F8;\n\tMon, 29 Sep 2025 15:20:49 +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 D30B76B599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Sep 2025 15:20:46 +0200 (CEST)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-103-gjVd4C-sMXK7_RBnuFO4bQ-1; Mon, 29 Sep 2025 09:20:43 -0400","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-46e36f9c651so38562005e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Sep 2025 06:20:42 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-46e2ab48c28sm224859005e9.18.2025.09.29.06.20.40\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 29 Sep 2025 06:20:40 -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=\"MVJnsgii\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1759152045;\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\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=y88TKIray4NbgUWC1L1MtOokWd/t1MOwgWjrM6cmi3k=;\n\tb=MVJnsgiiuJc0bGKtupe9D1HnWnRRjYv2rEvwngLdj14QRLnkN3ZuKeYb7DjMrVeRwsrAh1\n\t5vutjnsSzBo3jMoqGz/pkt6cdU4pO/XZhDFFjzOtflSxfJR4Zy0UzVzztVmPBznrnuT+QA\n\tC/wFbNYQTFk3j5ZJzUOk8qMCiKu7Gl8=","X-MC-Unique":"gjVd4C-sMXK7_RBnuFO4bQ-1","X-Mimecast-MFC-AGG-ID":"gjVd4C-sMXK7_RBnuFO4bQ_1759152042","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1759152041; x=1759756841;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=VC2Uxk9OO5bRMhGGZVXFrKVwH3ccieQNDfcQJLQULd4=;\n\tb=QZ4danKJ9+nRtW1fCPLY4jj6XBmoBwFBITc6uzOXVzxNtK4mOLxvmCmjY08TGMQGOJ\n\t8wTkOPkWS+I1TPo5L+HmmMssphuu4hRyd+gHMIooUGo/OUVhOSHzuqiSPWWMJO2PruGC\n\tIu/kVuBQTAmfSuuFv166LpeDDn8W6SgXvX7u3Gv8aexwboH17GQ5+kOp0u7jLDB6+dd/\n\teTVpQPD3Nu7YkskbsFVr7QDLBfkE9006p4giBS2wIz/KIMWQcdZ8/zrizHX/DhsgqjCB\n\teVA9tAMtfIyy+ROZg4Wh0r1k8c0sC3ojygifls39OXTYNDxoNsBLMaft8JTBIGAQOr3b\n\thKsA==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCX1FL4AIgHa6x31pQQlIGjx1E/fD3vnFabb7h/DW6jQHjcBdpYvmzUlXE6z1FlZqb6CW+OlbPa8aWKpcq409zU=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YzerDZJIFMdEa6HaY6ENyeJMXz2l1nm714x3gE381HmOda4n1qm\n\tTCzfjdIyyWUXxJeUDAA4w29hLbRGBaE5rHFTURrJx8z0z7ceFqkK948ihL8nibbU3HIKod4Alhw\n\tGsWD4LYbqCMzIToRWym5aii9NdeqsaczCIHJqrdoBOaLXr7Uq3tXx/MknqowizbNiBDmbVJlZFD\n\tXhuox5cWJ8x+CfyAB4JXQDs8S/WJwkL1F9zA4Y/YMuePVK5UQ+a+7b0770PVs=","X-Gm-Gg":"ASbGncto5jPCqzXDJdUs28afT9KTtfQ7LIm5nNgZNEOXyQXYvnJsQPNJhWW//Z7ey6r\n\tE/kUACZuMAcCZ7EBGNY4qtmKBWET/hEr386Tgp/cCDac1bXJImYMY95pKEkfWieLHEO3pTaNbJp\n\tgefWi5hxi2tgyw840fEWNrhOc4hwn6txE6UQl/Wrsb//hnkj30HT5ZFwW7iEocQIzJTFi1LNxIO\n\tAcIh+MniV4lrM9oqNZTq9fJX6Mb/bHh+KxJvMTVEipMll0HvEbHop9g7A+52l7bZ9MM27bkw5tT\n\t6WdngK2+WgivLIqRoIPaj/kTsHzHS2m+6YmcXikO9lqd7qy7e5oBjClYyx8dwWtozcyNSCYQHgD\n\ts4oheQbcG/eVONdm69g==","X-Received":["by 2002:a05:600c:6303:b0:46e:37a3:3ec1 with SMTP id\n\t5b1f17b1804b1-46e37a34304mr142450945e9.24.1759152041434; \n\tMon, 29 Sep 2025 06:20:41 -0700 (PDT)","by 2002:a05:600c:6303:b0:46e:37a3:3ec1 with SMTP id\n\t5b1f17b1804b1-46e37a34304mr142450645e9.24.1759152040902; \n\tMon, 29 Sep 2025 06:20:40 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGDZZNGEw9tB06TXAaISRE9rMrd7rzUXln1AH3MNl8quRqrilZnaK6GoovzF3F7tcXJ2wViXw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"mail@maciej.szmigiero.name,  libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v4 5/7] libcamera: simple: Avoid incorrect arithmetic in\n\tAWB","In-Reply-To":"<f8259b1c-37a3-4e72-9f55-6b190c9e91ce@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Mon,\n\t29 Sep 2025  12:14:26 +0200\")","References":"<20250925192856.77881-1-mzamazal@redhat.com>\n\t<20250925192856.77881-6-mzamazal@redhat.com>\n\t<f8259b1c-37a3-4e72-9f55-6b190c9e91ce@ideasonboard.com>","Date":"Mon, 29 Sep 2025 15:20:39 +0200","Message-ID":"<85tt0lpf88.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":"8R2SGDwjoPQPWt5Lb-qVvw2epgR0WNkbl6y4mcnE2OY_1759152042","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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>"}}]