SPRUJB3 March 2024 AM67 , AM67A , TDA4AEN-Q1 , TDA4VEN-Q1
The Flexible CFA incorporates 2 sets of gradient and direction selection logic. Typically for symmetric 2x2 patterns like Bayer, only a single set is sufficient; however in sensors wherein one of the channels is working on a different data type, the second set can be used for that channel. An example of such sensors is the RGB-IR sensor, wherein the 2x2 pattern consists of one pixel of each color channel and one pixel of the IR channel. In this case, mixing the gradients and intensity of the color channels with the IR channel could be meaningless.
The gradient selection uses bit masks to select the desired pixel position for calculating the horizontal and the vertical gradient.
Figure 7-55 shows the notation for the bit-mask values. The same notation is used for vertical masks as well and the notation implies that setting a ‘1’ in any field of the bit Mask enables the absolute difference of those 2 pixels to be summed in the gradient calculation.
Similar masks are also used to calculate the intensity (see Figure 7-56), however instead of taking the absolute difference, the bit masks are used to sum up the pixels in those locations.
The 4 bit Intensity mask is used to choose which pixels in the 6 rows should be used for creating the intensity sum. The same masks are used for every 2x2 window within the 6x6 buffer. (Thus setting all 4 bits to ‘1’ will be equivalent to summing up the entire 6x6 window.) A programmable shift is then used to bring the intensity down to the 0-16k range. The maximum value of intensity can be 6x6 x4k = 144k, so the maximum value of shift is 4 (divide by 16). The shift value can be programmed to any value between 0 and 4 and should be chosen based on the mask. Note that dependent on the shift value, it’s possible that the full range of 0-16k of the intensity may not be reached, hence the adaptive threshold should be programmed accordingly.
The adaptive threshold calculation uses the calculated intensity. For more information, see Section 7.7.3.6.3.1.2.2, Software Controlled Direction Selection.