SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
The gain and offset map are M × N downsampled:
The starting point of the preconfigured lens shading map can be modified in software to align with the ISIF input image frame. The location of the gain and offset mask data in memory is specified as follows:
The input address must be aligned to a 4-byte boundary.
In the full resolution case, the address is set to the beginning of the map. When the LSC active region is defined over a cropped region of the full image, the SDRAM input address can be set to the upper-left corner of the grid closest to the beginning of the active region, and the ISIF_2DLSCINI[6:0] X and ISIF_2DLSCINI[14:8] Y bit fields mark the offset into the upsampled gain and offset map where the active region begins. Figure 9-157 shows the LSC active region with respect to the gain and offset map grid. Because (X, Y) deals with the pixel phase inside a gain and offset map grid, X and Y must each be less than M and N, respectively.
Before applying the gain or offset table, the table is internally upsampled and interpolated back to full resolution via bilinear interpolation.
The gain table format is set in the ISIF_2DLSCCFG[4:1] GAIN_FORMAT bit field. Eight-bit entries are supported in the gain map (in U8Q8, U8Q7, U8Q6, and U8Q5 format with an optional base of 1.0 to shift the range up).
Eight-bit entries are supported in the offset map (in S8Q0 format). An optional shifting up for offsets is possible. The shift-up value is selected through the ISIF_2DLSCOFST[6:4] OFSTSFT bit field. A scaling factor for offsets is defined in the ISIF_2DLSCOFST[15:8] OFSTSF bit field.
A 16-bit gain map is supported by combining the gain map and offset map (in U16Q16, U16Q15, U16Q14, U16Q13, U16Q12, U16Q11, U16Q10, and U16Q9 format with an optional base of 1.0 to shift the range up). This function is exclusive to offset control function, and can be configured through the ISIF_2DLSCCFG[6] GAIN_RANGE bit.
The offset control in the 2D-LSC module can be enabled or disabled through the ISIF_2DLSCOFST[0] OFSTEN bit.
For an LSC active region size of W × H (the output and input are the same size), and the gain and offset maps are M × N downsampled, a table with the following values is needed:
Extra data at end of each line can be skipped by the line offset register parameter: