[{"id":24833,"web_url":"https://patchwork.libcamera.org/comment/24833/","msgid":"<9af90d24-f2ca-0f05-fd2e-86c7d14cee9f@ideasonboard.com>","date":"2022-08-30T10:32:57","subject":"Re: [libcamera-devel] [PATCH] ipa: rkisp1: lsc: Use double instead\n\tof float to accumulate vector of doubles","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Marvin\n\nThank you for the patch\n\nOn 8/29/22 11:58 PM, Marvin Schmidt via libcamera-devel wrote:\n> clang-tidy's bugprone-fold-init-type check warns about this:\n>\n>> ../src/ipa/rkisp1/algorithms/lsc.cpp:61:14: warning: folding type 'double' into type 'float' might result in loss of precision [bugprone-fold-init-type]\n>>          float sum = std::accumulate(sizes.begin(), sizes.end(), 0.0f);\n>>                      ^\n> Fixes: b3e96411 (\"ipa: rkisp1: Add support of Lens Shading Correction control\")\n\n12-letters commit-id, can be fixed up while applying\n>\n> Signed-off-by: Marvin Schmidt <marvin.schmidt1987@gmail.com>\n\n  Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>   src/ipa/rkisp1/algorithms/lsc.cpp | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> index da287ac7..b9efc063 100644\n> --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> @@ -58,7 +58,7 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,\n>   \t * prevent an exact match (further adjustments will be performed in\n>   \t * LensShadingCorrection::prepare()).\n>   \t */\n> -\tfloat sum = std::accumulate(sizes.begin(), sizes.end(), 0.0f);\n> +\tdouble sum = std::accumulate(sizes.begin(), sizes.end(), 0.0);\n>   \tif (sum < 0.495 || sum > 0.505) {\n>   \t\tLOG(RkISP1Lsc, Error)\n>   \t\t\t<< \"Invalid '\" << prop << \"' values: sum of the elements\"","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 98723C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Aug 2022 10:33:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0A27461FBD;\n\tTue, 30 Aug 2022 12:33:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B0A8F61F9C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Aug 2022 12:33:03 +0200 (CEST)","from [IPV6:2401:4900:1f3f:1548:78ac:4a3:edc3:c28a] (unknown\n\t[IPv6:2401:4900:1f3f:1548:78ac:4a3:edc3:c28a])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5FE11481;\n\tTue, 30 Aug 2022 12:33:02 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661855586;\n\tbh=Y5BVs8rN0N4mYMIC3q4ESZDDaxSmW9WL7iAjmJ78DPY=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=PDy3uXS2sso71RFxHnCTG/oeHeKWzN/spkFmIaureOtFZ7IFQ5UiVJ57mYijxMIEa\n\tIBqy+o00skW8lFDgXYZmjT7b/JMiWkdi1O1pgRL1gK9o0AyGBX76O8Dylv4q3kUP+B\n\tRyvJxxla1wXkKGnJHQM6cGGjV8URExVBVhhvo4E3yrQhjTKJwuu0gquMvfBQMCKyoA\n\tvPER5i48BSCt/H9jAF4XKgHmJsgJ4wjTP8VxG/n8JM2bi2jX2Ap2VS/fQgH+KZt2pu\n\tc/oj8W0c/XOeLW04pfGLV6iG5zWyXGPFQaUf2zbSUquBLL/r6cjqPDXWSOOoyT8zCw\n\te1qgdWfvnCDvg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1661855583;\n\tbh=Y5BVs8rN0N4mYMIC3q4ESZDDaxSmW9WL7iAjmJ78DPY=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=h73U5EOJOpYafd8Yo0VXGucWi6KpnOkuuB4JIKed74giBSB9T5ODVUfnpCyUhJZog\n\tvvsI0CCSs4QJcL0e2exvpNFgBEzXIeD4jqrdoLkb4xTnFW/2ql+fE4r7aLDLkg3EPH\n\tDlmICM6mdFMfpP7c8J30D+UK8+MQPxOM5YRCeTp8="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"h73U5EOJ\"; dkim-atps=neutral","Message-ID":"<9af90d24-f2ca-0f05-fd2e-86c7d14cee9f@ideasonboard.com>","Date":"Tue, 30 Aug 2022 16:02:57 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.12.0","Content-Language":"en-US","To":"Marvin Schmidt <marvin.schmidt1987@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220829182846.1227824-1-marvin.schmidt1987@gmail.com>","In-Reply-To":"<20220829182846.1227824-1-marvin.schmidt1987@gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] ipa: rkisp1: lsc: Use double instead\n\tof float to accumulate vector of doubles","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24843,"web_url":"https://patchwork.libcamera.org/comment/24843/","msgid":"<Yw5f9fZAT2+WGTfn@pendragon.ideasonboard.com>","date":"2022-08-30T19:07:33","subject":"Re: [libcamera-devel] [PATCH] ipa: rkisp1: lsc: Use double instead\n\tof float to accumulate vector of doubles","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Aug 30, 2022 at 04:02:57PM +0530, Umang Jain via libcamera-devel wrote:\n> Hi Marvin\n> \n> Thank you for the patch\n> \n> On 8/29/22 11:58 PM, Marvin Schmidt via libcamera-devel wrote:\n> > clang-tidy's bugprone-fold-init-type check warns about this:\n> >\n> >> ../src/ipa/rkisp1/algorithms/lsc.cpp:61:14: warning: folding type 'double' into type 'float' might result in loss of precision [bugprone-fold-init-type]\n> >>          float sum = std::accumulate(sizes.begin(), sizes.end(), 0.0f);\n> >>                      ^\n> > Fixes: b3e96411 (\"ipa: rkisp1: Add support of Lens Shading Correction control\")\n> \n> 12-letters commit-id, can be fixed up while applying\n\nWill do\n\n> > Signed-off-by: Marvin Schmidt <marvin.schmidt1987@gmail.com>\n> \n> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > ---\n> >   src/ipa/rkisp1/algorithms/lsc.cpp | 2 +-\n> >   1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > index da287ac7..b9efc063 100644\n> > --- a/src/ipa/rkisp1/algorithms/lsc.cpp\n> > +++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n> > @@ -58,7 +58,7 @@ static std::vector<double> parseSizes(const YamlObject &tuningData,\n> >   \t * prevent an exact match (further adjustments will be performed in\n> >   \t * LensShadingCorrection::prepare()).\n> >   \t */\n> > -\tfloat sum = std::accumulate(sizes.begin(), sizes.end(), 0.0f);\n> > +\tdouble sum = std::accumulate(sizes.begin(), sizes.end(), 0.0);\n> >   \tif (sum < 0.495 || sum > 0.505) {\n> >   \t\tLOG(RkISP1Lsc, Error)\n> >   \t\t\t<< \"Invalid '\" << prop << \"' values: sum of the elements\"\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 765C2C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Aug 2022 19:07:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B00CB61FBD;\n\tTue, 30 Aug 2022 21:07:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8528F61F9C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Aug 2022 21:07:43 +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 D4978481;\n\tTue, 30 Aug 2022 21:07:42 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661886465;\n\tbh=5Xc3WRqtsxCtsY38ZEsIWtJD9FP+uwLd7AVChMPKz4c=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=fnWCee83sIHnpi697mMDsIYdD4pGEtwrMaZm1B/+187aUl6FDlWD37xEcWj9SC1gB\n\tM0sApl8wdhEcI4OoWtdNFDzZZVkZlkAWduCr+CDZILYjtu0pfyV2ZydDq6HVWgvCmN\n\ttWSaw9GiSDB217uJZ1XK/Wbo+2f+xBxRsjodMgzerJLt5gfnxOWPTDb0nE++HR/C59\n\tzcFYeKwAqW499tA382LUfqEK7/W8wSUUhkyfP40Q2d7NjZy5Nf/6AozXvYy52ftoRP\n\tZ+FjDHd6X4OffZs7JGng2YogT0P5hZEfPnTH95PZjZpQSO7Y7ywprV2kQjEq7HNHWa\n\tWy8TjoPaahhVQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1661886463;\n\tbh=5Xc3WRqtsxCtsY38ZEsIWtJD9FP+uwLd7AVChMPKz4c=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KxsDMvioH+Z6oXB6j6KNvmLjjYC0bqE9yxF3uU5h944NkU8VnvarpMkWzliBdyO7O\n\tPWe3jUiJeWcTRPEvYipXyYAMnnRCix+iQ0Cbit4PukJepfYNEn9kOiYURnRvqCWNtY\n\tliO5KtDC5vu1V4NFw4O7CXVlfurQWhU/iM2RsiIA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"KxsDMvio\"; dkim-atps=neutral","Date":"Tue, 30 Aug 2022 22:07:33 +0300","To":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<Yw5f9fZAT2+WGTfn@pendragon.ideasonboard.com>","References":"<20220829182846.1227824-1-marvin.schmidt1987@gmail.com>\n\t<9af90d24-f2ca-0f05-fd2e-86c7d14cee9f@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<9af90d24-f2ca-0f05-fd2e-86c7d14cee9f@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] ipa: rkisp1: lsc: Use double instead\n\tof float to accumulate vector of doubles","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]