[v3,00/14] Simple pipeline IPA cleanup
mbox series

Message ID 20260114113016.25162-1-mzamazal@redhat.com
Headers show
Series
  • Simple pipeline IPA cleanup
Related show

Message

Milan Zamazal Jan. 14, 2026, 11:30 a.m. UTC
The simple pipeline image algorithms inappropriately mix various stuff
together.  For example, contrast and saturation processing is mixed with
CCM and LUT processing, algorithms cannot be disabled without making
software ISP malfunctioning and some "algorithms", like lookup table
construction, are not algorithms at all.

This patch series introduces new algorithm Adjust for contrast,
saturation and gamma adjustments, moves lookup table construction to
debayering, separates CCM from the combined matrix (which includes white
balance and saturation adjustments), and cleans up some other things.

Changes in v3:
- Rebased on the merged GPU ISP and adjusted for the changes there.
- A patch reverting enabling Ccm algorithm by GPU ISP added.

Changes in v2:
- Commit message of "Generalise tracking matrix changes" improved a bit.
- correctionMatrix renamed to combinedMatrix.
- combinedMatrix initialisations fixed and Matrix::identity utilised.
- gamma made adjustable.
- Types of contrast, saturation, gamma set to float (from double in some
  places).
- Symbolic constants are used for contrast, saturation, gamma defaults.
- The gain matrix is applied directly in awb.cpp now.
- Lut "algorithm" removed; lookup tables construction moved to
  debayering.

Milan Zamazal (14):
  libcamera: ipa: simple: Remove an unused include from awb.cpp
  libcamera: ipa: simple: Unwrap IPAFrameContext::ccm
  libcamera: ipa: simple: Generalise tracking matrix changes
  libcamera: ipa: simple: Rename "ccm" identifiers not specific to CCM
  libcamera: ipa: simple: Introduce a general correction matrix
  libcamera: ipa: simple: Initialise the general correction matrix
  libcamera: ipa: simple: Separate saturation from CCM
  libcamera: ipa: simple: Move contrast settings to adjust.cpp
  libcamera: ipa: simple: Make gamma adjustable
  libcamera: ipa: simple: Apply gain matrix in awb
  libcamera: ipa: simple: Use float type for adjustment controls
  libcamera: ipa: simple: Use symbolic constants for adjust defaults
  libcamera: ipa: simple: Remove Lut algorithm
  libcamera: ipa: simple: Disable Ccm algorithm by default again

 .../internal/software_isp/debayer_params.h    |  45 +----
 src/ipa/simple/algorithms/adjust.cpp          | 129 +++++++++++++
 src/ipa/simple/algorithms/{lut.h => adjust.h} |  32 ++--
 src/ipa/simple/algorithms/awb.cpp             |  15 +-
 src/ipa/simple/algorithms/ccm.cpp             |  83 ++-------
 src/ipa/simple/algorithms/ccm.h               |  11 +-
 src/ipa/simple/algorithms/lut.cpp             | 174 ------------------
 src/ipa/simple/algorithms/meson.build         |   2 +-
 src/ipa/simple/data/uncalibrated.yaml         |  14 +-
 src/ipa/simple/ipa_context.h                  |  25 +--
 src/ipa/simple/soft_simple.cpp                |  10 +
 src/libcamera/software_isp/debayer.cpp        | 172 +----------------
 src/libcamera/software_isp/debayer.h          |   8 -
 src/libcamera/software_isp/debayer_cpu.cpp    | 141 ++++++++++++--
 src/libcamera/software_isp/debayer_cpu.h      |  26 ++-
 src/libcamera/software_isp/debayer_egl.cpp    |  27 ++-
 src/libcamera/software_isp/software_isp.cpp   |  17 --
 17 files changed, 374 insertions(+), 557 deletions(-)
 create mode 100644 src/ipa/simple/algorithms/adjust.cpp
 rename src/ipa/simple/algorithms/{lut.h => adjust.h} (53%)
 delete mode 100644 src/ipa/simple/algorithms/lut.cpp