SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-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.6.3.8.4, DISPC VID Chrominance Resampling). The YUV422/YUV420 to YUV444 chrominance resampling is a pre-processing to the color space conversion.
Figure 12-344 and Figure 12-345 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-343 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-344 (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-344, the offset values (-256, -2048, -2048) are also programmed via corresponding register bit-fields shown in Table 12-343, 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-345 (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-344 and Figure 12-345, the offset values (0, -256, -2048) can be programmed via the corresponding register bit-fields shown in Table 12-343, DISPC VID CSC - YUV to RGB Register Settings).
In case of YUV420/YUV422-NV21 data, the coefficients for Cr and Cb must be swapped in order to correctly support YUV420/YUV422-NV21 format.
The scaling and CSC clipping is set by the same bit, DSS0_VID_ATTRIBUTES[11] FULLRANGE.
Output Clipping
It is possible for the output results to be larger (overflow) than the maximum or smaller (underflow) than the minimum value the output representation supports. The Color Space Conversion module clips the overflow/underflow result to the maximum/minimum value as follows:
The FULLRANGE = 0 setting should only be used when the CSC logic is used to convert RGB to YCrCb and the output needs to be in the video data range.
For YCrCb to RGB conversion and other RGB to RGB processing, the FULLRANGE bit should be set to 1 to enable full data range in the output.