From 6d60f264d1e05bd19640b66bc72bda9f303bf72d Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Thu, 9 Feb 2023 12:47:35 +0000 Subject: ipa: raspberrypi: Use the generic statistics structure in the algorithms Repurpose the StatisticsPtr type from being a shared_ptr to shared_ptr. This removes any hardware specific header files and structures from the algorithms source code. Add a new function in the Raspberry Pi IPA to populate the generic statistics structure from the values provided by the hardware in the bcm2835_isp_stats structure. Update the Lux, AWB, AGC, ALSC, Contrast, and Focus algorithms to use the generic statistics structure appropriately in their calculations. Additionally, remove references to any hardware specific headers and defines in these source files. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Tested-by: Nick Hollinghurst Signed-off-by: Kieran Bingham --- src/ipa/raspberrypi/controller/rpi/af.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ipa/raspberrypi/controller/rpi/af.h') diff --git a/src/ipa/raspberrypi/controller/rpi/af.h b/src/ipa/raspberrypi/controller/rpi/af.h index f7baf897..7959371b 100644 --- a/src/ipa/raspberrypi/controller/rpi/af.h +++ b/src/ipa/raspberrypi/controller/rpi/af.h @@ -11,6 +11,12 @@ #include "../pdaf_data.h" #include "../pwl.h" +/* + * \todo FOCUS_REGIONS is taken from bcm2835-isp.h, but should be made as a + * generic RegionStats structure. + */ +#define FOCUS_REGIONS 12 + /* * This algorithm implements a hybrid of CDAF and PDAF, favouring PDAF. * @@ -117,7 +123,7 @@ private: void computeWeights(); bool getPhase(PdafData const &data, double &phase, double &conf) const; - double getContrast(struct bcm2835_isp_stats_focus const focus_stats[FOCUS_REGIONS]) const; + double getContrast(const FocusRegions &focusStats) const; void doPDAF(double phase, double conf); bool earlyTerminationByPhase(double phase); double findPeak(unsigned index) const; -- cgit v1.2.1