[PATCH v2] ipa: rkisp1: agc: Fix histogram construction
Dan Scally
dan.scally at ideasonboard.com
Tue Apr 23 00:41:37 CEST 2024
Hi Paul
On 19/04/2024 06:58, Paul Elder wrote:
> This histogram reported by the rkisp1 hardware is 20 bits, where the
> upper 16 bits are meaningful integer data and the lower 4 bits are
> fractional and meant to be discarded. Remove thse 4 bits when
> construction the histogram.
"Remove those 4 bits when constructing the Histogram", if you end up sending another version, but
otherwise:
Reviewed-by: Daniel Scally <dan.scally at ideasonboard.com>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
>
> ---
> This was meant to be in the same series as "[PATCH v2] ipa: libipa:
> histogram: Add transform parameter to constructor"
>
> This depends on v2 of "Centralise Agc into libipa".
>
> Changes in v2:
> - use a lambda function instead of the rshift parameter
> ---
> src/ipa/rkisp1/algorithms/agc.cpp | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
> index 27b6f2c1..26526f5e 100644
> --- a/src/ipa/rkisp1/algorithms/agc.cpp
> +++ b/src/ipa/rkisp1/algorithms/agc.cpp
> @@ -278,7 +278,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
> const rkisp1_cif_isp_stat *params = &stats->params;
> ASSERT(stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP);
>
> - Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins });
> + Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins },
> + [](uint32_t x) { return x >> 4; });
> expMeans_ = { params->ae.exp_mean, context.hw->numAeCells };
>
> /*
More information about the libcamera-devel
mailing list