[libcamera-devel,v3,0/2] Take into account color temperature during LSC algorithm for rkisp1
mbox series

Message ID 20221003142357.602633-1-fsylvestre@baylibre.com
Headers show
Series
  • Take into account color temperature during LSC algorithm for rkisp1
Related show

Message

Florian Sylvestre Oct. 3, 2022, 2:23 p.m. UTC
First brick to have an adaptive LSC algorithm on Rkisp1: add LSC coefficients
sets in YAML tuning file depending of color temperature.
For this version the computation of coefficients regarding the current computed
color temperature is done inside prepare() method.
For reference: the computation time has been measured at an average 135us on an
Imx8Mp board.

The different coefficients are computed by doing a linear interpolation with the
two coefficients sets that have the closer color temperature values.
In case the current color temperature is 'out of bound' the closest set is used.
The LSC can work with a single set in case of monochrome sensor for example.

The 'grad' and 'size' tables are now computed in configure() to gain some
time by doing only a memcpy() of them during prepare().

Modifications in V3:
- Rebased on top of "ipa: rkisp1: Remove initialized_ flags from algorithms"
- Add specific check if there is a single LSC set: Remove out-of-bound access
while looking for correct set.
- Minor cleanup

Modifications in V2:
- The single commit has been splited into two commits. The first one only
contains the move of LSC parameters computation in configure().
- LSC parameters are no more re-computed when there is small color temperature
variations between two frames.
- LSC parameters are not interpolated when the actual color temperature is
close to one defined in the tuning parameters sets.
- Minor typo/cleanups

Florian Sylvestre (2):
  ipa: rkisp1: Compute LSC algorithm parameter during configure
  ipa: rkisp1: Take into account color temperature during LSC algorithm

 src/ipa/rkisp1/algorithms/lsc.cpp | 191 +++++++++++++++++++-----
 src/ipa/rkisp1/algorithms/lsc.h   |  25 +++-
 src/ipa/rkisp1/data/ov5640.yaml   | 231 ++++++++++++++++++++----------
 3 files changed, 328 insertions(+), 119 deletions(-)