[v2,0/4] software-isp: Align GPU cropping and statistics
mbox series

Message ID 20261015223604.311616-1-halfline@gmail.com
Headers show
Series
  • software-isp: Align GPU cropping and statistics
Related show

Message

Ray Strode Oct. 15, 2026, 10:36 p.m. UTC
Hi all,

This series fixes crop positioning and statistics alignment in the EGL
software ISP when producing frames at different output sizes and aspect
ratios.

The GPU projection currently positions the cropped image off-center in
the output, shifting the visible scene. CPU statistics operate on the
full sensor buffer using a window derived from the output dimensions,
so metering can cover a different region from the one displayed.

Patches 1 and 2 center the GPU crop and test the projection by mapping
expected sensor crop corners and the sensor center to output coordinates.
Patches 3 and 4 align statistics with the visible sensor region and test
the selected crop rectangles across output sizes and aspect ratios,
including integer rounding before Bayer alignment.

Changes in v2:
- Replace the rendering and statistics integration tests with direct
  geometry unit tests, following Laurent's feedback. The tests require
  neither a graphics context nor sensor buffers.
- Use the standard three lines of diff context.

Thanks,
Ray

Ray Strode (4):
  software-isp: Center the GPU image crop
  tests: Validate debayer projection geometry
  software-isp: Meter the visible sensor crop
  tests: Validate the visible sensor crop

 .../internal/software_isp/debayer_geometry.h  |  49 +++++++
 .../internal/software_isp/meson.build         |   1 +
 src/libcamera/software_isp/debayer_egl.cpp    |  34 ++---
 src/libcamera/software_isp/debayer_egl.h      |   1 -
 test/debayer-geometry.cpp                     | 129 ++++++++++++++++++
 test/meson.build                              |   1 +
 6 files changed, 188 insertions(+), 27 deletions(-)
 create mode 100644 include/libcamera/internal/software_isp/debayer_geometry.h
 create mode 100644 test/debayer-geometry.cpp