{"id":17235,"url":"https://patchwork.libcamera.org/api/patches/17235/?format=json","web_url":"https://patchwork.libcamera.org/patch/17235/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220829182846.1227824-1-marvin.schmidt1987@gmail.com>","date":"2022-08-29T18:28:46","name":"[libcamera-devel] ipa: rkisp1: lsc: Use double instead of float to accumulate vector of doubles","commit_ref":"68683d3811a803aa087c38a2063cf64c8d084d49","pull_url":null,"state":"accepted","archived":false,"hash":"7a5d4384692282a96387e60db492ed4c90ef1973","submitter":{"id":51,"url":"https://patchwork.libcamera.org/api/people/51/?format=json","name":"Marvin Schmidt","email":"marvin.schmidt1987@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17235/mbox/","series":[{"id":3448,"url":"https://patchwork.libcamera.org/api/series/3448/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3448","date":"2022-08-29T18:28:46","name":"[libcamera-devel] ipa: rkisp1: lsc: Use double instead of float to accumulate vector of doubles","version":1,"mbox":"https://patchwork.libcamera.org/series/3448/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17235/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17235/checks/","tags":{},"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 15F38C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Aug 2022 18:28:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 865C161FBC;\n\tMon, 29 Aug 2022 20:28:52 +0200 (CEST)","from mail-ej1-x629.google.com (mail-ej1-x629.google.com\n\t[IPv6:2a00:1450:4864:20::629])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D3B7361FBA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Aug 2022 20:28:50 +0200 (CEST)","by mail-ej1-x629.google.com with SMTP id w19so17420154ejc.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Aug 2022 11:28:50 -0700 (PDT)","from pythagoras.local\n\t(dynamic-077-003-143-111.77.3.pool.telefonica.de. [77.3.143.111])\n\tby smtp.gmail.com with ESMTPSA id\n\tfv29-20020a170907509d00b00711edab7622sm4774152ejc.40.2022.08.29.11.28.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 29 Aug 2022 11:28:49 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661797732;\n\tbh=Qw+YGkthCKId45nLGjIlHA0D1xIkoWtja8qzH147cds=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=GsvcIINjU1rbX+HIDcc8JNJ9FqfauF+f2byDqpVVmGTK7xM1ilcPAOO6QSapkTLwK\n\tkblUCKeoK5Eg+l0+5Wn3kh8HoM3BfaTWU/zCnwGRT7jW+5QbeohXPFXTh5qDSnfgQe\n\tuRww2ct/5pH1RnV0YqSHxAH+BtjbMEahP9OBtGvNxS/oYvaeB4rkn9dqnF6WCfTcJR\n\t3GgW+hhMKs4LsMhtMt+rW28xBB4YZKdadUmF9n5Nq2L1OlLpWf7ZmGeYaRlisQC8Dj\n\tVwmwil22Yb9XYDdea9tLvoIw1lp12mafjWyR1k6D6B33vkTSZUD+qpvAxzmN6B6mxC\n\tgDGsX5udQnRUw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc;\n\tbh=mDc60W5yRa7Gd+1WzIDoA+bsCb9xDzWgGLAcwCkRijs=;\n\tb=aCIcBuoHkNqFHQ2Q7Qh347t5hLXOuQhZLTLqYOnzp8ZKihXUIpMXF2w/OZ4vIV8bMh\n\tN8jNsNgGJWk+aS1k8ZZibjMJTlmVmkbuCrfvTT79frf/NoVNC2qE2PtaGYpHb1MszWVq\n\t94Lac7G8lWsgEPjnoyl1c9/ihNPEosWBULhb10qYZ1UtC7htf4sU9H3qTSoWh7vkr+vS\n\tG9tCuaAhP3JvczUD99pSUpsB891f/4H9t8iG7wnbFmOiTAelUntypvgISSC20+LyPmLd\n\tleaUEuG8LEcHsG6iJr26s43IyCMF9lgpexO8abWXZbY0jv5dY4DTC3ftXj6VMUJUxBhy\n\tpxJQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"aCIcBuoH\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc;\n\tbh=mDc60W5yRa7Gd+1WzIDoA+bsCb9xDzWgGLAcwCkRijs=;\n\tb=nMXD33X7IxGaz/CMqKUj9+xramGPVWhdHSc/5mY/o7/h/L5LI5WgNVHqaZpTDUMXZo\n\t1ljld9gbW+el5VYZdPKfH1908WtpP3knU4Zj/9zALSnbbEGvGaIDj8YWmu504+WMm2/5\n\t7yF3xAMk5J/VAA/ohIQig5n/L9m9DX1EUDWon1GqL8xse/ab2TaDbQjy76NZf0V6dIaq\n\tEGWHRKBhE1YnzhXig3gR/ImvqAIJwWG7INNSd7V8CL3XpJjdNdK37lsVeWPmkPV9LYS0\n\ta8FsBCO7nlVIEFOjykF7X8zizCCDFacLK67WPkovISZ3IvdC7J9XnQDUPjbYJvfSCTg5\n\tn01A==","X-Gm-Message-State":"ACgBeo1SqkmxAh8PxzVlCPWUwKeXozsGnNEoXdwvWqPFgOAdQdnareJo\n\tS4d41RMkAPQgNIi0jUKTQYJIQD0S57A=","X-Google-Smtp-Source":"AA6agR48cFvg1JqnVuVjfShpiLx6ab4A4i31a97WjFmVT0gfqitZWLEXi+J0/ycPNwXH+eFBLxbd5A==","X-Received":"by 2002:a17:907:6da1:b0:731:6a7a:83c0 with SMTP id\n\tsb33-20020a1709076da100b007316a7a83c0mr14676578ejc.473.1661797730016; \n\tMon, 29 Aug 2022 11:28:50 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 29 Aug 2022 20:28:46 +0200","Message-Id":"<20220829182846.1227824-1-marvin.schmidt1987@gmail.com>","X-Mailer":"git-send-email 2.37.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] ipa: rkisp1: lsc: Use double instead of\n\tfloat 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":"Marvin Schmidt via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Marvin Schmidt <marvin.schmidt1987@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"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\nFixes: b3e96411 (\"ipa: rkisp1: Add support of Lens Shading Correction control\")\n\nSigned-off-by: Marvin Schmidt <marvin.schmidt1987@gmail.com>\n---\n src/ipa/rkisp1/algorithms/lsc.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\nindex 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","prefixes":["libcamera-devel"]}