SPRAD86A March 2023 – May 2024 AM62A3 , AM62A3-Q1 , AM62A7 , AM62A7-Q1 , AM67A , AM68A , AM69A
The minimum and maximum gains are usually specified in the data sheet as Nx gain and Mx gain, where N is the minimum and M is the maximum. The corresponding values in the gain register are usually also given. For example, a certain sensor may specify the following:
Since the DCC live tuning tool uses 1024 for 1 × gain to calculate and display the gain in floating point numbers, it is preferred to set the gain in this convention and map the gain between 2A and the sensor driver. Function get_<sensor>_ae_dyn_params()
has the following setting for minimum and maximum gain:
p_ae_dynPrms->analogGainRange[count].min = 1024; /* 1x gain */
p_ae_dynPrms->analogGainRange[count].max = 15872; /* 15.5x gain */
Therefore the gain value used by the 2A algorithm
is essentially 64 times the gain value used by this specific sensor. After the 2A
algorithm returns the gain to be set for the sensor, that gain value needs to be
divided by 64 before being sent to the sensor. This mapping is done in function
gst_tiovx_isp_map_2A_values()
:
*analog_gain_mapped = analog_gain / 64; /* 64 = 1024 / 16 */