[4/6] ipa: rkisp1: goc: Mark default gamma table as static constexpr
diff mbox series

Message ID 20240611212101.14313-5-laurent.pinchart@ideasonboard.com
State Accepted
Commit 1ca1d06d67c1bb1518ce5a96e49fb1cdf64d940b
Headers show
Series
  • ipa: rksip1: goc: Assorted fixes
Related show

Commit Message

Laurent Pinchart June 11, 2024, 9:20 p.m. UTC
The values for the default gamma table are stored in an array that is
never modified. Mark it as static constexpr to facilitate optimizations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/goc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Klug June 12, 2024, 7:42 a.m. UTC | #1
Hi Laurent,

thank you for the patch. This was actually mentioned by Jacopo and I
missed it. Sorry for that.

On Wed, Jun 12, 2024 at 12:20:59AM +0300, Laurent Pinchart wrote:
> The values for the default gamma table are stored in an array that is
> never modified. Mark it as static constexpr to facilitate optimizations.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> 

Cheers,
Stefan

> ---
>  src/ipa/rkisp1/algorithms/goc.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/goc.cpp b/src/ipa/rkisp1/algorithms/goc.cpp
> index 65460eb45135..e98c9526722f 100644
> --- a/src/ipa/rkisp1/algorithms/goc.cpp
> +++ b/src/ipa/rkisp1/algorithms/goc.cpp
> @@ -108,7 +108,7 @@ void GammaOutCorrection::prepare(IPAContext &context,
>  	 * The logarithmic segments as specified in the reference.
>  	 * Plus an additional 0 to make the loop easier
>  	 */
> -	std::array<unsigned, RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10> segments = {
> +	static constexpr std::array<unsigned int, RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10> segments = {
>  		64, 64, 64, 64, 128, 128, 128, 128, 256,
>  		256, 256, 512, 512, 512, 512, 512, 0
>  	};
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/goc.cpp b/src/ipa/rkisp1/algorithms/goc.cpp
index 65460eb45135..e98c9526722f 100644
--- a/src/ipa/rkisp1/algorithms/goc.cpp
+++ b/src/ipa/rkisp1/algorithms/goc.cpp
@@ -108,7 +108,7 @@  void GammaOutCorrection::prepare(IPAContext &context,
 	 * The logarithmic segments as specified in the reference.
 	 * Plus an additional 0 to make the loop easier
 	 */
-	std::array<unsigned, RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10> segments = {
+	static constexpr std::array<unsigned int, RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10> segments = {
 		64, 64, 64, 64, 128, 128, 128, 128, 256,
 		256, 256, 512, 512, 512, 512, 512, 0
 	};