From 380b08754f10d6e03e96d13cac5be5e84e12835e Mon Sep 17 00:00:00 2001 From: Jean-Michel Hautbois Date: Wed, 22 Sep 2021 17:44:01 +0200 Subject: ipa: ipu3: awb: Use the line stride for the stats The statistics buffer 'ipu3_uapi_awb_raw_buffer' stores the ImgU calculation results in a buffer aligned horizontally to a multiple of 4 cells. The AWB loop should take care of it to add the proper offset between lines and avoid any staircase effect. It is no longer required to pass the grid configuration context to the private functions called from process() which simplifies the code flow. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/ipu3.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ipa/ipu3/ipu3.cpp') diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 757a5d50..06f53fbe 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -91,6 +91,9 @@ * * \var IPASessionConfiguration::grid::bdsOutputSize * \brief BDS output size configured by the pipeline handler + * + * \var IPASessionConfiguration::grid::stride + * \brief Number of cells on one line including the ImgU padding */ /** @@ -352,6 +355,9 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize) bdsGrid.height = best.height >> bestLog2.height; bdsGrid.block_height_log2 = bestLog2.height; + /* The ImgU pads the lines to a multiple of 4 cells. */ + context_.configuration.grid.stride = utils::alignUp(bdsGrid.width, 4); + LOG(IPAIPU3, Debug) << "Best grid found is: (" << (int)bdsGrid.width << " << " << (int)bdsGrid.block_width_log2 << ") x (" << (int)bdsGrid.height << " << " << (int)bdsGrid.block_height_log2 << ")"; -- cgit v1.2.1