[libcamera-devel] [PATCH 07/11] ipu3: ipa: agc: Determine cell size from ipu3_uapi_awb_set_item

Jean-Michel Hautbois jeanmichel.hautbois at ideasonboard.com
Mon Sep 13 16:58:06 CEST 2021


The kCellSize was hardcoded from the size determined by examining the
statistics from the ImgU.  The cell definition is now described as a
struct. Utilise the struct size to express the cell size.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois at ideasonboard.com>
---
 src/ipa/ipu3/algorithms/agc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
index 8740dcdf..e085599a 100644
--- a/src/ipa/ipu3/algorithms/agc.cpp
+++ b/src/ipa/ipu3/algorithms/agc.cpp
@@ -48,7 +48,7 @@ static constexpr uint32_t knumHistogramBins = 256;
 static constexpr double kEvGainTarget = 0.5;
 
 /* A cell is 8 bytes and contains averages for RGB values and saturation ratio */
-static constexpr uint8_t kCellSize = 8;
+static constexpr uint8_t kCellSize = sizeof(ipu3_uapi_awb_set_item);
 
 Agc::Agc()
 	: frameCount_(0), lastFrame_(0), iqMean_(0.0), lineDuration_(0s),
-- 
2.30.2



More information about the libcamera-devel mailing list