Processing in the 8-bit YUV Color Space

Source: Internet
Author: User

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 from the Y value to position the black level at zero. This removes, the DC offset so, adjusting the contrast does not vary the black level. Because y values might is less than, negative Y values should is 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 would result whenever the contrast is changed. The Brightness property value was added (or subtracted) from the contrast adjusted Y values; This was done to avoid introducing a DC offset due to adjusting the contrast. Finally, the value of 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 are the brightness value.

Y ' = ((Y-16) x C) + B + 16
UV processing

To perform ProcAmp adjustment for the U and V components, subtract-both U and V values to position the range Arou nd zero. The hue is implemented by mixing the U and V values together as shown in the following equations. H is the desired hue angle:

U ' = (U-128) x cos (h) + (V-128) x sin (h) V ' = (V-128) x cos (h)-(U-128) x Sin (h)

Saturation is adjusted by multiplying U ' and V ' by a pair of constants, and then by adding. The combined processing of hue and saturation on the UV data are shown in the following equations. H is the desired hue angle, C is the contrast value, and S is the saturation value:

U ' = ((U-128) x cos (h) + (V-128) x Sin (h)) x C x s) + 128V "= (((V-128) x cos (h)-(U-128) x Sin (h)) x C x s) + 128http S://msdn.microsoft.com/en-us/library/ff569191%28v=vs.85%29.aspx

Processing in the 8-bit YUV Color Space

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.