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>
This commit is contained in:
parent
366077c4db
commit
971c4904ff
2 changed files with 16 additions and 16 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue