[v3,0/2] ipa: ipu3: Take the OV5670 black level from the sensor helper
mbox series

Message ID 20260910172120.73148-1-dmanresa@gmail.com
Headers show
Series
  • ipa: ipu3: Take the OV5670 black level from the sensor helper
Related show

Message

D. Manresa Sept. 10, 2026, 5:21 p.m. UTC
The black level of the OV5670 belongs in the camera sensor helper rather
than in the tuning data, so:

- add the OV5670 black level (64 at 10 bits) to camera_sensor_helper.cpp;
- make the IPU3 BLC algorithm read it from the helper, converting the
  16-bit value to the ImgU OB grid units (half a 10-bit LSB), and keep
  the old hard-coded 64 with a warning for sensors without a helper
  value.

Measured on a Latitude 7275: with 64 the darkest percentile of Y is 32
with a U/V of 132/131 (a residual, colour-shifted pedestal); with 128 it
is 15 with U/V 128/128.

Changes in v3 (thanks Dan):
- Use uint16_t for the default black level and for the member.
- Move the explanation of the >> 5 conversion from the copydoc block into
  a comment next to the shift itself, and mention the OV5693 experiment
  that corroborates it.

Changes in v2:
- Rework as helper + algorithm change instead of a tuning parameter.

D. Manresa (2):
  ipa: libipa: camera_sensor_helper: Add OV5670 black level
  ipa: ipu3: blc: Use the black level from the camera sensor helper

 src/ipa/ipu3/algorithms/blc.cpp         | 60 +++++++++++++++++++++----
 src/ipa/ipu3/algorithms/blc.h           |  5 +++
 src/ipa/libipa/camera_sensor_helper.cpp |  2 +
 3 files changed, 58 insertions(+), 9 deletions(-)