SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-Q1
The VC-1 range mapping unit is used when the video frame picture is decoded using a VC-1 codec by the video accelerator. It remaps the Y, Cb, and Cr components to the full range (from the reduced data range) before displaying. The unit is used primarily for YUV420-NV12 (NV21) pixel format, but also can be applied to YUV422 pixel formats (YUV2 and UYVY).
The VC-1 range mapping unit is enabled by setting the DSS0_VID_ATTRIBUTES2[0] VC1ENABLE bit to 0x1. The VC-1 range mapping must be enabled only for 8 bits/component YUV input data.
The DSS0_VID_ATTRIBUTES2[3:1] VC1_RANGE_Y and [6:4]VC1_RANGE_CBCR register bitfields are two 3-bit values programmed by the user.
The equations for the mapping process are:
Yout = CLIP(((( Yint – 128) × (VC1_RANGE_Y + 9) + 4) / 8) + 128)
Cb = CLIP(((( Cb – 128) × (VC1_RANGE_CBCR + 9) + 4) / 8) + 128)
Cr = CLIP(((( Cr – 128) × (VC1_RANGE_CBCR + 9) + 4) / 8) + 128)
The input and output pixel values are unsigned (Y, Cr, and Cb).
The function CLIP() clips to 0 or 255 when minimum or maximum, respectively, is reached. Otherwise, the resulting output remains identical.