The gain calculation modes as defined by the MIPI CCS.
Describes the image sensor analogue gain capabilities. Two modes are possible, depending on the sensor: Linear and Exponential.
Enumerator
AnalogueGainLinear
Gain is computed using linear gain estimation.
The relationship between the integer gain parameter and the resulting gain multiplier is given by the following equation:
Where 'x' is the gain control parameter, and m0, m1, c0 and c1 are image-sensor-specific constants of the sensor. These constants are static parameters, and for any given image sensor either m0 or m1 shall be zero.
The full Gain equation therefore reduces to either:
or
AnalogueGainExponential
Gain is expressed using an exponential model.
The relationship between the integer gain parameter and the resulting gain multiplier is given by the following equation:
Where 'x' is the gain control parameter, and 'a' and 'm' are image sensor-specific constants.
This is a subset of the MIPI CCS exponential gain model with the linear factor 'a' being a constant, but with the exponent being configurable through the 'm' coefficient.
When the gain is expressed in dB, 'a' is equal to 1 and 'm' to .
Fill the blanks and add pedestal values for all supported sensors. Once done, drop the std::optional<>.
Black levels are typically the result of the following phenomena:
Pedestal added by the sensor to pixel values. They are typically fixed, sometimes programmable and should be reported in datasheets (but documentation is not always available).
Dark currents and other physical effects that add charge to pixels in the absence of light. Those can depend on the integration time and the sensor die temperature, and their contribution to pixel values depend on the sensor gains.
The pedestal is usually the value with the biggest contribution to the overall black level. In most cases it is either known before or in rare cases (there is not a single driver with such a control in the linux kernel) can be queried from the sensor. This function provides that fixed, known value.
Returns
The black level of the sensor, or std::nullopt if not known
Compute the real gain from the V4L2 subdev control gain code.
Parameters
[in]
gainCode
The V4L2 subdev control gain
This function aims to abstract the calculation of the gain letting the IPA use the real gain for its estimations. It is the counterpart of the function CameraSensorHelper::gainCode.