[v4,16/21] ipa: rkisp1: ccm: Use Q4_7 format directly
diff mbox series

Message ID 20251114005428.90024-17-kieran.bingham@ideasonboard.com
State New
Headers show
Series
  • libipa: Introduce a Quantized type
Related show

Commit Message

Kieran Bingham Nov. 14, 2025, 12:54 a.m. UTC
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 <kieran.bingham@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/ccm.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch
diff mbox series

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<FixedPointQTraits<4, 7, int16_t>>;
+
 	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++)