libcamera/utils
David Plowman 36ba0e5515 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>
2025-04-29 16:14:48 +01:00
..
codegen utils: ipc: Do not define variables in signal handler up front 2025-04-22 20:52:42 +02:00
hooks hooks: pre-push: Verify that co-authors have a SoB line 2024-10-08 18:06:30 +03:00
ipu3 libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
raspberrypi utils: raspberrypi: ctt: Fix NaNs in lens shading tables 2025-04-29 16:14:48 +01:00
rkisp1 utils: rkisp1: gen-csc-table: Support printing CCM in decimal 2025-04-17 14:50:44 +03:00
tracepoints meson: Move all code generation scripts to utils/codegen/ 2024-08-15 23:59:08 +03:00
tuning libipa: awb_bayes: Change the probabilities from log space to linear space 2025-02-21 17:51:10 +01:00
abi-compat.sh utils: abi-compat: sort meson options 2024-09-25 10:36:40 +01:00
checkstyle.py utils: checkstyle.py: Centralize dependency handling for checkers 2024-11-05 03:50:12 +02:00
gen-debug-controls.py utils: gen-debug-controls: Output direction flag 2024-12-23 11:16:08 +00:00
gen-ipa-priv-key.sh libcamera: Drop file name from header comment blocks 2024-05-08 22:39:50 +03:00
gen-version.sh utils: gen-version: Use posix compliant date 2024-07-25 09:57:54 +01:00
meson.build meson: Move all code generation scripts to utils/codegen/ 2024-08-15 23:59:08 +03:00
release.sh utils: Provide a release script 2022-10-13 12:40:24 +01:00
run-dist.sh build: Preserve upstream git versioning using meson dist 2021-10-19 13:14:54 +03:00
semver utils: semver: Add version helper 2022-10-13 12:40:23 +01:00
update-kernel-headers.sh utils: update-kernel-headers: Support relative path to kernel git tree 2024-08-27 12:16:10 +03:00
update-mojo.sh utils: update-mojo.sh: Commit the mojo update 2024-01-09 15:39:05 +00:00