SPRUJB3 March 2024 AM67 , AM67A , TDA4AEN-Q1 , TDA4VEN-Q1
The Color Space Conversion (CSC) unit converts the video-encoded pixel values from YUV444 format into ARGB48 format (12-bit value per component A, R, G, and B, with A fixed at 0xFFF).
In case of YUV420 or YUV422 formats, a chrominance resampling to YUV444 is performed before converting the YUV into RGB values (see Section 12.9.1.4.1.8.4, DISPC VID Chrominance Resampling). The YUV422/YUV420 to YUV444 chrominance resampling is a pre-processing to the color space conversion.
Figure 12-493 and Figure 12-494 show the 3 × 3 11-bit coefficients used to convert from YUV444 into ARGB48. The value of A component is fixed at 0xFFF in the output. The coefficients are set according to the standard used to encode the pixel data in YUV color space. Table 12-432 summarizes the coefficients with their respective register bit fields.
Coefficients | Register Fields |
---|---|
RY | DSS0_VID_CSC_COEF0[10-0] C00 |
RCr | DSS0_VID_CSC_COEF0[26-16] C01 |
RCb | DSS0_VID_CSC_COEF1[10-0] C02 |
GY | DSS0_VID_CSC_COEF1[26-16] C10 |
GCr | DSS0_VID_CSC_COEF2[10-0] C11 |
GCb | DSS0_VID_CSC_COEF2[26-16] C12 |
BY | DSS0_VID_CSC_COEF3[10-0] C20 |
BCr | DSS0_VID_CSC_COEF3[26-16] C21 |
BCb | DSS0_VID_CSC_COEF4[10-0] C22 |
Y offset | DSS0_VID_CSC_COEF5[15-3] PREOFFSET1 |
Cr offset | DSS0_VID_CSC_COEF5[31-19] PREOFFSET2 |
Cb offset | DSS0_VID_CSC_COEF6[15-3] PREOFFSET3 |
If the active range for the luminance samples (Y) is [256:3760] and for the chrominance samples (Cb and Cr) is [256:3840], the following equation in Figure 12-493 (based on 11-bit coefficients) must be used to convert the YUV to RGB. To clip the values of R, G, and B output components to the full output data range [0:4095], set the DSS0_VID_ATTRIBUTES[11] FULLRANGE bit to 0x1.
In Figure 12-493, the offset values (-256, -2048, -2048) are also programmed via corresponding register bit-fields shown in Table 12-432, DISPC VID CSC - YUV to RGB Register Settings).
If the active range for the luminance samples (Y) and chrominance samples (Cb and Cr) is [0:4095], the following equation in Figure 12-494 (based on 11-bit coefficients) must be used to convert the YUV to RGB. To clip the values of R, G, and B output components to the full output data range [0:4095], set the DSS0_VID_ATTRIBUTES[11] FULLRANGE bit to 0x1.
In Figure 12-494, the offset values (0, -2048, -2048) are also programmed via corresponding register bit-fields shown in Table 12-432, DISPC VID CSC - YUV to RGB Register Settings).
In case of YUV420-NV21 data, the coefficients for Cr and Cb must be swapped in order to correctly support YUV420-NV21 format.
The scaling and CSC clipping is set by the same bit, DSS0_VID_ATTRIBUTES[11] FULLRANGE.