[v2,00/15] Add resampling support for polynomial LSC data
mbox series

Message ID 20260108-sklug-lsc-resampling-v2-dev-v2-0-e682ec4b9893@ideasonboard.com
Headers show
Series
  • Add resampling support for polynomial LSC data
Related show

Message

Stefan Klug Jan. 8, 2026, 4:05 p.m. UTC
In [1] support for polynomial lens shading tables was implement up to
the same feature level of grid based lens shading tables. However
resampling the LSC table for a given analog crop rectangle was never
implemented.

This series partially fixes that by implementing resampling for
polynomial LSC data. Resampling for tabular LSC data is left open for
implementation if need arises.

Patches 1-7 apply some code cleanup that got mentioned on the last
series after it was merged.

Patches 8-10 apply further cleanup and are new in v2 of the series.

Patches 11-13 implement the actual resampling.

Patches 14-15 implement a LensShadingCorrectionEnable control that is
necessary to assess the effect of LSC in practice. Patch 14 resurrects
an old patch from Jacopo [2]. These last two patches could be stripped
off the series if needed.

Best regards,
Stefan

[1] https://patchwork.libcamera.org/project/libcamera/list/?series=4609&archive=both&state=*
[2] https://patchwork.libcamera.org/project/libcamera/list/?series=3795&archive=both&state=*

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
Changes in v2:
- Collected tags
- Applied small fixes from review
- Additional cleanup by patches 8-10 to improve the prepare() function
- A bit more rework on the resampling patches due to preceding changes

---
Stefan Klug (15):
      ipa: rkisp1: lsc: Drop unused member variable
      ipa: rkisp1: lsc: Drop unused function declaration
      ipa: rkisp1: lsc: Replace assert with ASSERT
      ipa: rkisp1: lsc: Rename res to positions
      ipa: rkisp1: lsc: Rename res to ret
      ipa: rkisp1: lsc: Rename res to samples
      ipa: rksip1: lsc: Move function definitions out of class
      ipa: rkisp1: lsc: Move local types into anonymous namespace
      ipa: rkisp1: lsc: Handle quantization locally
      ipa: libipa: interpolator: Drop key quantization
      ipa: rkisp1: lsc: Pass sampling positions into samplePolynomial
      ipa: rkisp1: lsc: Pass crop rectangle as parameter
      ipa: rkisp1: lsc: Resample polynomial lens shading tables at configure time
      libcamera: control_ids: Introduce LensShadingCorrectionEnable
      ipa: rkisp1: Implement LensShadingCorrectionEnable control

 src/android/camera_capabilities.cpp  |  11 +-
 src/ipa/libipa/interpolator.cpp      |  25 +-
 src/ipa/libipa/interpolator.h        |  14 +-
 src/ipa/rkisp1/algorithms/dpf.cpp    |   2 +-
 src/ipa/rkisp1/algorithms/lsc.cpp    | 491 ++++++++++++++++++++++-------------
 src/ipa/rkisp1/algorithms/lsc.h      |  20 +-
 src/ipa/rkisp1/ipa_context.h         |  13 +-
 src/libcamera/control_ids_core.yaml  |   9 +
 src/libcamera/control_ids_draft.yaml |  14 -
 test/ipa/libipa/interpolator.cpp     |   7 -
 10 files changed, 346 insertions(+), 260 deletions(-)
---
base-commit: c63f2c72cd7b278584dcc70b8294063e89b01ca1
change-id: 20260107-sklug-lsc-resampling-v2-dev-d77540b176de

Best regards,