From patchwork Fri Nov 14 00:54:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 25046 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 2C5AFC3334 for ; Fri, 14 Nov 2025 00:55:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C0C9E60AA4; Fri, 14 Nov 2025 01:55:09 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oPj9lYFA"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9FE1960A81 for ; Fri, 14 Nov 2025 01:54:53 +0100 (CET) Received: from charm.hippo-penny.ts.net (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 204B719B5; Fri, 14 Nov 2025 01:52:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1763081573; bh=r1ZXJQShnSWr/dg4t9QvGQ2E3oU88IEwg8g8aeTsFfk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oPj9lYFAThzrzll5jxaJ0aVSLIgOtGFoiYXy0MSu3OXHg45TJ2DhdjpBO0lGxywTI 4aZ4ygwvKY2CqWw35QRgVMLRQnuEF9RkTlNtJdZSnizsTyZEg3Y4ZI/0yiAhlFhtUI 6IKdIwDSNCX/kjp1cOKhi94C1uF+zqvSub4hlOX8= From: Kieran Bingham To: libcamera devel Cc: Kieran Bingham Subject: [PATCH v4 16/21] ipa: rkisp1: ccm: Use Q4_7 format directly Date: Fri, 14 Nov 2025 00:54:20 +0000 Message-ID: <20251114005428.90024-17-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251114005428.90024-1-kieran.bingham@ideasonboard.com> References: <20251114005428.90024-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Replace the legacy call to floatingToFixedPoint with the new FixedPoint quantizer to explicitly describe the type used by the RKISP1 Colour Correction Matrix. Signed-off-by: Kieran Bingham --- src/ipa/rkisp1/algorithms/ccm.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp index de2b6fe775aa..a99336c478b1 100644 --- a/src/ipa/rkisp1/algorithms/ccm.cpp +++ b/src/ipa/rkisp1/algorithms/ccm.cpp @@ -115,10 +115,11 @@ void Ccm::setParameters(struct rkisp1_cif_isp_ctk_config &config, * 4 bit integer and 7 bit fractional, ranging from -8 (0x400) to * +7.9921875 (0x3ff) */ + using Q4_7 = Quantized>; + for (unsigned int i = 0; i < 3; i++) { for (unsigned int j = 0; j < 3; j++) - config.coeff[i][j] = - floatingToFixedPoint<4, 7, uint16_t, double>(matrix[i][j]); + config.coeff[i][j] = Q4_7(matrix[i][j]).quantized(); } for (unsigned int i = 0; i < 3; i++)