[v3,3/5] ipa: rkisp1: Fix histogram weights configuration
diff mbox series

Message ID 20240218164908.15921-4-laurent.pinchart@ideasonboard.com
State Accepted
Commit a5e6b7f0dbf74b77991aa149c6d659872dade87c
Headers show
Series
  • ipa: rkisp1: Support the i.MX8MP ISP
Related show

Commit Message

Laurent Pinchart Feb. 18, 2024, 4:49 p.m. UTC
The histogram weights are initialized to hardcoded 1's for each
histogram grid cell. The code uses the wrong variable for the grid size,
resulting in some weights having a 0 value. Fix it.

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

Comments

Paul Elder Feb. 20, 2024, 9:56 a.m. UTC | #1
On Sun, Feb 18, 2024 at 06:49:06PM +0200, Laurent Pinchart wrote:
> The histogram weights are initialized to hardcoded 1's for each
> histogram grid cell. The code uses the wrong variable for the grid size,
> resulting in some weights having a 0 value. Fix it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  src/ipa/rkisp1/algorithms/agc.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index da705b14754c..47a6f7b26744 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -175,7 +175,7 @@ void Agc::prepare(IPAContext &context, const uint32_t frame,
>  	/* Set an average weighted histogram. */
>  	Span<uint8_t> weights{
>  		params->meas.hst_config.hist_weight,
> -		context.hw->numHistogramBins
> +		context.hw->numHistogramWeights
>  	};
>  	std::fill(weights.begin(), weights.end(), 1);
>  	/* Step size can't be less than 3. */
> -- 
> Regards,
> 
> Laurent Pinchart
>
Stefan Klug Feb. 23, 2024, 1:07 p.m. UTC | #2
Am 18.02.24 um 17:49 schrieb Laurent Pinchart:
> The histogram weights are initialized to hardcoded 1's for each
> histogram grid cell. The code uses the wrong variable for the grid size,
> resulting in some weights having a 0 value. Fix it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>   src/ipa/rkisp1/algorithms/agc.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index da705b14754c..47a6f7b26744 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -175,7 +175,7 @@ void Agc::prepare(IPAContext &context, const uint32_t frame,
>   	/* Set an average weighted histogram. */
>   	Span<uint8_t> weights{
>   		params->meas.hst_config.hist_weight,
> -		context.hw->numHistogramBins
> +		context.hw->numHistogramWeights
>   	};
>   	std::fill(weights.begin(), weights.end(), 1);
>   	/* Step size can't be less than 3. */

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index da705b14754c..47a6f7b26744 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -175,7 +175,7 @@  void Agc::prepare(IPAContext &context, const uint32_t frame,
 	/* Set an average weighted histogram. */
 	Span<uint8_t> weights{
 		params->meas.hst_config.hist_weight,
-		context.hw->numHistogramBins
+		context.hw->numHistogramWeights
 	};
 	std::fill(weights.begin(), weights.end(), 1);
 	/* Step size can't be less than 3. */