[PATCH v2 0/2] libipa: Fix CameraSensorHelper gain helpers

Kieran Bingham kieran.bingham at ideasonboard.com
Fri May 24 15:52:54 CEST 2024


The CameraSensorHelper class provides helpers to simplify the
descriptions of gain models of the sensors.

This provides an implementation of converting a gain-code to a linear
gain value, and a return calculation that converts a linear gain to a
gain code.

It could be expected that a gain value reported by the 'gain(code)'
function should itself generate the same code when called into
'gainCode(gain)' but this is not the case.

This series addresses this by correcting the rounding issue and adding a
test to ensure all CameraSensorHelpers meet this expectation.

The test is introduced first and marked as 'should_fail', which is
subsequently updated with the fix.

v2:
 - The test now only validates a single instance of each of the linear
   and exponential uses of the helpers.

Kieran Bingham (2):
  test: ipa: libipa: Add CameraSensorHelper Gain Model tests
  libipa: camera_sensor_helper: Fix rounding of gainCode

 src/ipa/libipa/camera_sensor_helper.cpp |   6 +-
 test/ipa/camera_sensor_helper.cpp       | 101 ++++++++++++++++++++++++
 test/ipa/meson.build                    |   4 +-
 3 files changed, 107 insertions(+), 4 deletions(-)
 create mode 100644 test/ipa/camera_sensor_helper.cpp

-- 
2.34.1



More information about the libcamera-devel mailing list