[v7,10/15] ipa: rkisp1: ccm: Use Q<4, 7> format directly
diff mbox series

Message ID 20260213-kbingham-quantizers-v7-10-1626b9aaabf1@ideasonboard.com
State Accepted
Headers show
Series
  • libipa: Introduce a Quantized type
Related show

Commit Message

Kieran Bingham Feb. 13, 2026, 4:57 p.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.

Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

---
v5:
 - Use Q<4, 7>
---
 src/ipa/rkisp1/algorithms/ccm.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Paul Elder Feb. 19, 2026, 9:02 a.m. UTC | #1
Quoting Kieran Bingham (2026-02-14 01:57:49)
> Replace the legacy call to floatingToFixedPoint with the new FixedPoint
> quantizer to explicitly describe the type used by the RKISP1 Colour
> Correction Matrix.
> 
> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> 
> ---
> v5:
>  - Use Q<4, 7>
> ---
>  src/ipa/rkisp1/algorithms/ccm.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp
> index de2b6fe775aa..466d7a116eea 100644
> --- a/src/ipa/rkisp1/algorithms/ccm.cpp
> +++ b/src/ipa/rkisp1/algorithms/ccm.cpp
> @@ -117,8 +117,7 @@ void Ccm::setParameters(struct rkisp1_cif_isp_ctk_config &config,
>          */
>         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] = Q<4, 7>(matrix[i][j]).quantized();
>         }
>  
>         for (unsigned int i = 0; i < 3; i++)
> 
> -- 
> 2.52.0
>
Laurent Pinchart Feb. 19, 2026, 9:58 a.m. UTC | #2
Hi Kieran,

Thank you for the patch.

On Fri, Feb 13, 2026 at 04:57:49PM +0000, Kieran Bingham wrote:
> Replace the legacy call to floatingToFixedPoint with the new FixedPoint
> quantizer to explicitly describe the type used by the RKISP1 Colour
> Correction Matrix.
> 
> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v5:
>  - Use Q<4, 7>
> ---
>  src/ipa/rkisp1/algorithms/ccm.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp
> index de2b6fe775aa..466d7a116eea 100644
> --- a/src/ipa/rkisp1/algorithms/ccm.cpp
> +++ b/src/ipa/rkisp1/algorithms/ccm.cpp
> @@ -117,8 +117,7 @@ void Ccm::setParameters(struct rkisp1_cif_isp_ctk_config &config,
>  	 */
>  	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] = Q<4, 7>(matrix[i][j]).quantized();
>  	}
>  
>  	for (unsigned int i = 0; i < 3; i++)

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp
index de2b6fe775aa..466d7a116eea 100644
--- a/src/ipa/rkisp1/algorithms/ccm.cpp
+++ b/src/ipa/rkisp1/algorithms/ccm.cpp
@@ -117,8 +117,7 @@  void Ccm::setParameters(struct rkisp1_cif_isp_ctk_config &config,
 	 */
 	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] = Q<4, 7>(matrix[i][j]).quantized();
 	}
 
 	for (unsigned int i = 0; i < 3; i++)