The gain value interpolated for each pixel is multiplied with a corresponding input pixel. An offset is applied before the gain. The product is rounded to the nearest integer and then clipped or saturated to the valid range of 13 bits.
The following equation describes the operation of the LSC in terms of offset and gain:
Equation 3. out[x,y] = (in[x,y] + a × (ofst[x,y] << T)) × gain[x,y]
- in[x, y] are the input pixels, 13 bits signed.
- ofst[x, y] are the upsampled offset points.
- T is the upshift value applied to the result of the offset interpolation points (0–5) set through the ISIF_2DLSCOFST[6:4] OFSTSFT bit field.
- a is the offset gain value in U8Q7 format set through the ISIF_2DLSCOFST[15:8] OFSTSF bit field.
- gain[x, y] are the upsampled gain points.
- out[x, y] are the resulting output pixels, 13 bits signed.