SPRUJB3 March 2024 AM67 , AM67A , TDA4AEN-Q1 , TDA4VEN-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 YUV4:2:0-NV12 (NV21) pixel format, but also can be applied to YUV4:2:2 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 bit fields 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.