summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2024-04-19 14:56:10 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2024-05-09 21:08:21 +0900
commitf1522e94dfaedcde26280eb6387f2c6f2de66fd7 (patch)
tree05b9903a67f56f1e075eacc37d0204da6fdd4890 /src/ipa/rkisp1/algorithms
parent299e5278bd7657c785b7adac0c4f02d7e42f22c2 (diff)
ipa: rkisp1: agc: Fix histogram construction
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 these 4 bits when construction the histogram. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms')
-rw-r--r--src/ipa/rkisp1/algorithms/agc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index c1333b59..50e0690f 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -277,7 +277,9 @@ 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 });
+ /* The lower 4 bits are fractional and meant to be discarded. */
+ Histogram hist({ params->hist.hist_bins, context.hw->numHistogramBins },
+ [](uint32_t x) { return x >> 4; });
expMeans_ = { params->ae.exp_mean, context.hw->numAeCells };
/*