summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/ipu3.cpp
diff options
context:
space:
mode:
authorJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-09-22 17:44:01 +0200
committerJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>2021-10-06 15:59:40 +0200
commit380b08754f10d6e03e96d13cac5be5e84e12835e (patch)
tree9d1424af9f8560fa102111dc57299afeda002a7d /src/ipa/ipu3/ipu3.cpp
parent03132d0ff9aaaa709b9db21c0e272ea8f51f3a7d (diff)
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 <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/ipu3.cpp')
-rw-r--r--src/ipa/ipu3/ipu3.cpp6
1 files changed, 6 insertions, 0 deletions
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 << ")";