diff options
author | David Plowman <david.plowman@raspberrypi.com> | 2025-04-28 11:36:03 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2025-04-29 16:14:48 +0100 |
commit | 36ba0e5515075f87490048aa1d5f57b6c3864bae (patch) | |
tree | 29d381632cd0761bb4cbc4631bdd46bc3c0a3e80 /utils/hooks/pre-commit | |
parent | 9b50d3c23dea1bc2882cd3e6566a3d4cb9f7296f (diff) |
utils: raspberrypi: ctt: Fix NaNs in lens shading tables
The problem occurs when the calculation could lead to a final row (or
column) of grid squares with no pixels in them (and hence, NaNs).
One specific case is a Pi 5 with an image width (or height) of 1364,
so that's 682 Bayer quads. To give 32 grid squares it was calculating
22 quads per cell. However, 31 * 22 = 682 leaving nothing in the final
column.
The fix is to do a rounding-down division by the number of cells minus
one, rather than a rounding-up division by the number of cells. This
turns the corner case from one where the final row/column has no
pixels to one where we don't quite cover the full image, which is how
we have to handle these cases.
Bug: https://github.com/raspberrypi/libcamera/issues/254
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'utils/hooks/pre-commit')
0 files changed, 0 insertions, 0 deletions