Working in the YUV color space simplifies the calculations involved for ProcAmp adjustment control of a video stream.
Y Processing
To perform ProcAmp adjustment for the Y component, subtract 16 from the Y value to position the black level at zero. This removes the DC offset so that adjusting the contrast does not vary the black level. Because Y values might be less than 16, negative Y values should be supported at this point. Contrast is adjusted by multiplying the YUV pixel values by a constant. If U and V are not adjusted, a color shift will result whenever the contrast is changed. The brightness property value is added (or subtracted) from the contrast adjusted Y values; this is done to avoid introducing a DC offset due to adjusting the contrast. Finally, the value 16 is added to reposition the black level at 16.
The following equation summarizes the steps described in the previous paragraph. C is the contrast value and B is the brightness value.
UV Processing
To perform ProcAmp adjustment for the U and V components, subtract 128 from both U and V values to position the range around zero. The hue property is implemented by mixing the U and V values together as shown in the following equations. H is the desired hue angle:
Saturation is adjusted by multiplying U' and V' by a pair of constants, and then by adding 128 to each. The combined processing of hue and saturation on the UV data is shown in the following equations. H is the desired hue angle, C is the contrast value, and S is the saturation value:
本文链接:Processing in the 8-bit YUV Color Space,转载请注明。