summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/pdaf_data.h
diff options
context:
space:
mode:
authorNick Hollinghurst <nick.hollinghurst@raspberrypi.com>2023-03-27 13:20:29 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-03-31 13:29:18 +0100
commit43f57f26b44648e609f66770e43294a361bd6657 (patch)
tree8246999f1e8b418dbd675f853d8d1fd7f2dc49a8 /src/ipa/raspberrypi/controller/pdaf_data.h
parente51a9f7b94f29390514052096ef4a2f44b67fa56 (diff)
ipa: raspberrypi: Generalise the autofocus algorithm
Remove any hard-coded assumptions about the target hardware platform from the autofocus algorithm. Instead, use the "target" string provided by the camera tuning config and generalised statistics structures to determing parameters such as grid and region sizes. Additionally, PDAF statistics are represented by a generalised region statistics structure to be device agnostic. These changes also require the autofocus algorithm to initialise region weights on the first frame's prepare()/process() call rather than during initialisation. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/pdaf_data.h')
-rw-r--r--src/ipa/raspberrypi/controller/pdaf_data.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/ipa/raspberrypi/controller/pdaf_data.h b/src/ipa/raspberrypi/controller/pdaf_data.h
index 03c00d72..470510f2 100644
--- a/src/ipa/raspberrypi/controller/pdaf_data.h
+++ b/src/ipa/raspberrypi/controller/pdaf_data.h
@@ -2,20 +2,23 @@
/*
* Copyright (C) 2022, Raspberry Pi Ltd
*
- * pdaf_data.h - PDAF Metadata; for now this is
- * largely based on IMX708's PDAF "Type 1" output.
+ * pdaf_data.h - PDAF Metadata
*/
#pragma once
#include <stdint.h>
-#define PDAF_DATA_ROWS 12
-#define PDAF_DATA_COLS 16
+#include "region_stats.h"
-struct PdafData {
- /* Confidence values, in raster order, in arbitrary units */
- uint16_t conf[PDAF_DATA_ROWS][PDAF_DATA_COLS];
+namespace RPiController {
- /* Phase error, in raster order, in s11 Q4 format (S.6.4) */
- int16_t phase[PDAF_DATA_ROWS][PDAF_DATA_COLS];
+struct PdafData {
+ /* Confidence, in arbitrary units */
+ uint16_t conf;
+ /* Phase error, in s16 Q4 format (S.11.4) */
+ int16_t phase;
};
+
+using PdafRegions = RegionStats<PdafData>;
+
+} /* namespace RPiController */