From patchwork Mon Aug 29 18:28:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marvin Schmidt X-Patchwork-Id: 17235 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 15F38C0DA4 for ; Mon, 29 Aug 2022 18:28:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 865C161FBC; Mon, 29 Aug 2022 20:28:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1661797732; bh=Qw+YGkthCKId45nLGjIlHA0D1xIkoWtja8qzH147cds=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=GsvcIINjU1rbX+HIDcc8JNJ9FqfauF+f2byDqpVVmGTK7xM1ilcPAOO6QSapkTLwK kblUCKeoK5Eg+l0+5Wn3kh8HoM3BfaTWU/zCnwGRT7jW+5QbeohXPFXTh5qDSnfgQe uRww2ct/5pH1RnV0YqSHxAH+BtjbMEahP9OBtGvNxS/oYvaeB4rkn9dqnF6WCfTcJR 3GgW+hhMKs4LsMhtMt+rW28xBB4YZKdadUmF9n5Nq2L1OlLpWf7ZmGeYaRlisQC8Dj Vwmwil22Yb9XYDdea9tLvoIw1lp12mafjWyR1k6D6B33vkTSZUD+qpvAxzmN6B6mxC gDGsX5udQnRUw== Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D3B7361FBA for ; Mon, 29 Aug 2022 20:28:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aCIcBuoH"; dkim-atps=neutral Received: by mail-ej1-x629.google.com with SMTP id w19so17420154ejc.7 for ; Mon, 29 Aug 2022 11:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=mDc60W5yRa7Gd+1WzIDoA+bsCb9xDzWgGLAcwCkRijs=; b=aCIcBuoHkNqFHQ2Q7Qh347t5hLXOuQhZLTLqYOnzp8ZKihXUIpMXF2w/OZ4vIV8bMh N8jNsNgGJWk+aS1k8ZZibjMJTlmVmkbuCrfvTT79frf/NoVNC2qE2PtaGYpHb1MszWVq 94Lac7G8lWsgEPjnoyl1c9/ihNPEosWBULhb10qYZ1UtC7htf4sU9H3qTSoWh7vkr+vS G9tCuaAhP3JvczUD99pSUpsB891f/4H9t8iG7wnbFmOiTAelUntypvgISSC20+LyPmLd leaUEuG8LEcHsG6iJr26s43IyCMF9lgpexO8abWXZbY0jv5dY4DTC3ftXj6VMUJUxBhy pxJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=mDc60W5yRa7Gd+1WzIDoA+bsCb9xDzWgGLAcwCkRijs=; b=nMXD33X7IxGaz/CMqKUj9+xramGPVWhdHSc/5mY/o7/h/L5LI5WgNVHqaZpTDUMXZo 1ljld9gbW+el5VYZdPKfH1908WtpP3knU4Zj/9zALSnbbEGvGaIDj8YWmu504+WMm2/5 7yF3xAMk5J/VAA/ohIQig5n/L9m9DX1EUDWon1GqL8xse/ab2TaDbQjy76NZf0V6dIaq EGWHRKBhE1YnzhXig3gR/ImvqAIJwWG7INNSd7V8CL3XpJjdNdK37lsVeWPmkPV9LYS0 a8FsBCO7nlVIEFOjykF7X8zizCCDFacLK67WPkovISZ3IvdC7J9XnQDUPjbYJvfSCTg5 n01A== X-Gm-Message-State: ACgBeo1SqkmxAh8PxzVlCPWUwKeXozsGnNEoXdwvWqPFgOAdQdnareJo S4d41RMkAPQgNIi0jUKTQYJIQD0S57A= X-Google-Smtp-Source: AA6agR48cFvg1JqnVuVjfShpiLx6ab4A4i31a97WjFmVT0gfqitZWLEXi+J0/ycPNwXH+eFBLxbd5A== X-Received: by 2002:a17:907:6da1:b0:731:6a7a:83c0 with SMTP id sb33-20020a1709076da100b007316a7a83c0mr14676578ejc.473.1661797730016; Mon, 29 Aug 2022 11:28:50 -0700 (PDT) Received: from pythagoras.local (dynamic-077-003-143-111.77.3.pool.telefonica.de. [77.3.143.111]) by smtp.gmail.com with ESMTPSA id fv29-20020a170907509d00b00711edab7622sm4774152ejc.40.2022.08.29.11.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 11:28:49 -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 Subject: [libcamera-devel] [PATCH] ipa: rkisp1: lsc: Use double instead of float to accumulate vector of doubles X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Marvin Schmidt via libcamera-devel From: Marvin Schmidt Reply-To: Marvin Schmidt Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" clang-tidy's bugprone-fold-init-type check warns about this: > ../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] > float sum = std::accumulate(sizes.begin(), sizes.end(), 0.0f); > ^ Fixes: b3e96411 ("ipa: rkisp1: Add support of Lens Shading Correction control") Signed-off-by: Marvin Schmidt Reviewed-by: Laurent Pinchart --- src/ipa/rkisp1/algorithms/lsc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp index da287ac7..b9efc063 100644 --- a/src/ipa/rkisp1/algorithms/lsc.cpp +++ b/src/ipa/rkisp1/algorithms/lsc.cpp @@ -58,7 +58,7 @@ static std::vector parseSizes(const YamlObject &tuningData, * prevent an exact match (further adjustments will be performed in * LensShadingCorrection::prepare()). */ - float sum = std::accumulate(sizes.begin(), sizes.end(), 0.0f); + double sum = std::accumulate(sizes.begin(), sizes.end(), 0.0); if (sum < 0.495 || sum > 0.505) { LOG(RkISP1Lsc, Error) << "Invalid '" << prop << "' values: sum of the elements"