[v2,0/3] libipa: agc: Fix constraints yTarget handling and add PWL support
mbox series

Message ID 20251106164239.460738-1-stefan.klug@ideasonboard.com
Headers show
Series
  • libipa: agc: Fix constraints yTarget handling and add PWL support
Related show

Message

Stefan Klug Nov. 6, 2025, 4:42 p.m. UTC
Hi all,

This series introduces support for specifying the
relativeLuminanceTarget based on the current lux level by using a PWL
for the mapping. The typical use case is to ensure that images in a
bright environment are regulated a tad brighter than images taken in a
dark environment. This is a very subjective setting and should therefore
be left to the user/camera designer. Mainlining this feature was already
tried in [1] but got rejected at that time because there was no direct
user of it. Meanwhile the lux algorithm got upstreamed and we have users
that actually miss that feature. So I start another try of upstreaming
it (patch 2).

During implementation it turned out that the yTarget of AGC constraints
never worked at all. So patches 3 fixes that and also add PWL support
for the constraints which is sensible to do if we support it for the
relativeLuminanceTarget.

Changes in v2:
- Dropped patch 1 that implemented Pwl::swap() as the intended use can
  already be achieved using the autogenerated move assignment operator
and move constructor together with std::move()
- Dropped the addition of a initializer_list based constructor to Pwl as
  this can be achieved in a bit more verbose way already.
- Added patch 1 that extends the yaml PWL reading code to support plain
  values. This also simplified the subsequent patches.

Best regards,
Stefan


Stefan Klug (3):
  ipa: libipa: pwl: Allow to parse a plain yaml value as single point
    PWL
  ipa: libipa: agc_mean_luminance: Change luminance target to piecewise
    linear function
  ipa: libipa: agc_mean_luminance: Fix yTarget handling in constraints

 src/ipa/libipa/agc_mean_luminance.cpp | 92 +++++++++++++++++++++------
 src/ipa/libipa/agc_mean_luminance.h   | 16 +++--
 src/ipa/libipa/pwl.cpp                |  9 +++
 src/ipa/rkisp1/algorithms/agc.cpp     |  1 +
 src/ipa/rkisp1/algorithms/wdr.cpp     |  3 +-
 5 files changed, 97 insertions(+), 24 deletions(-)