summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/agc.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-02-16 20:54:37 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-02-23 15:12:15 +0200
commit971c4904ff91e3525fb807567fdb4408b15df00e (patch)
treebcdaeff828be26a4dae6f540c0a65b17cdff54be /src/ipa/rkisp1/algorithms/agc.h
parent366077c4db502c8129eacc81a59d6e0ec958e4f0 (diff)
ipa: rkisp1: agc: Wrap variable length C arrays in spans
The RkISP1 statistics structure contains multiple arrays whose length varies depending on the hardware revision. Accessing those arrays is error-prone, wrap them in spans at the top level to reduce risks of out-of-bound accesses. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Diffstat (limited to 'src/ipa/rkisp1/algorithms/agc.h')
-rw-r--r--src/ipa/rkisp1/algorithms/agc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h
index 8a222637..ce8594f3 100644
--- a/src/ipa/rkisp1/algorithms/agc.h
+++ b/src/ipa/rkisp1/algorithms/agc.h
@@ -9,6 +9,7 @@
#include <linux/rkisp1-config.h>
+#include <libcamera/base/span.h>
#include <libcamera/base/utils.h>
#include <libcamera/geometry.h>
@@ -42,8 +43,8 @@ private:
void computeExposure(IPAContext &Context, IPAFrameContext &frameContext,
double yGain, double iqMeanGain);
utils::Duration filterExposure(utils::Duration exposureValue);
- double estimateLuminance(const rkisp1_cif_isp_ae_stat *ae, double gain);
- double measureBrightness(const rkisp1_cif_isp_hist_stat *hist) const;
+ double estimateLuminance(Span<const uint8_t> expMeans, double gain);
+ double measureBrightness(Span<const uint32_t> hist) const;
void fillMetadata(IPAContext &context, IPAFrameContext &frameContext,
ControlList &metadata);