| Message ID | 20261118164621.15513-2-guyliandejong@proton.me |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
diff --git a/src/ipa/ipu3/algorithms/lsc.cpp b/src/ipa/ipu3/algorithms/lsc.cpp index 77e637fd..729a23ff 100644 --- a/src/ipa/ipu3/algorithms/lsc.cpp +++ b/src/ipa/ipu3/algorithms/lsc.cpp @@ -256,7 +256,7 @@ void Lsc::prepare([[maybe_unused]] IPAContext &context, [[maybe_unused]] const u unsigned int totalCells = numHCells_ * numVCells_; unsigned int cellsPerSet = numHCells_ * config->grid.grid_height_per_slice; - unsigned int numSets = (numHCells_ + config->grid.grid_height_per_slice - 1) / + unsigned int numSets = (numVCells_ + config->grid.grid_height_per_slice - 1) / config->grid.grid_height_per_slice; unsigned int i = 0;
The shading LUT is split in sets of grid_height_per_slice rows of numHCells_ cells each. The number of sets to fill is computed from the number of horizontal cells instead of the number of vertical cells, so when the grid has more rows than columns, the last rows are never written and get no shading correction. This happens with the OV9734 (1296x734), where the grid is 41x46 cells with 3 rows per set: 16 sets are needed, but only 14 are filled, and the bottom 4 rows of the image are left uncorrected. Compute the number of sets from the number of vertical cells. Fixes: 279d355ef8f7 ("ipa: ipu3: Add Lens Shading Correction algorithm") Signed-off-by: GuyliandeJong <guyliandejong@proton.me> --- src/ipa/ipu3/algorithms/lsc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)