Introduction to RGB and YUV

Source: Internet
Author: User
Tags color representation insert mixed

Rgb:

Red-green-blue (RGB) is the base color that the computer displays, and the RGB565-supported color depth can be programmed up to 16 bits per pixel,

namely RGB565 (red 5 bit, green 6 bit, blue 5 bit).

Yuv:

Video Codec features

Video encoder requires yuv4:2:0 format video input, so may be based on the application of video input preprocessing, that is, yuv4:2:2 interlaced scanning (such as from the camera) to the YUV 4:2:0 non interlaced scanning, only extract but not filter UV points. In the case of video decoder, a post processing is also required to convert the decoded YUV 4:2:0 data to RGB for display, including: YUV 4:2:0 to RGB conversion, 16-bit or 12-bit RGB display format, and 0-90-degree rotation for horizontal or vertical display. In addition, video codecs typically require the following features and features:

Support MPEG-4 Simple classes 0, 1 and 2;

Compatible H.263 and MPEG-4 codec standards;

MPEG-4 Video Decoder support options are: AC/DC prediction, reversible variable length coding (RVLC), resynchronization sign (RM), Data segmentation (DP), error concealment patented technology, support for each macro Block 4 motion vectors (4MV), free motion compensation, decoding vos layer;

MPEG-4 Video encoder options are: RVLC, RM, DP, support each macro Block 4 motion vectors (4MV), Header extension code, support encoding period rate change, support encoding frame rate change, insert or not insert visual object sequence start code;

Supports the insertion of I frames in the encoding period sequence;

Support Encoder Adaptive Frame refresh (AIR);

Supports multiple codecs and can run multiple codecs instances with the same code.

The principle of color display in computer color display is the same as color TV, is the principle of "R" (red), G (Green), B (Blue) additive blending: By emitting three different intensities of electron beams, the red, green, and blue phosphorescent materials that are covered by the inside of the screen are produced with color. This method of color representation is called RGB color space representation (it is also the most widely used color space representation method in Multimedia computer technology).

According to the principle of three primary colors, any one of the color F can be mixed with the different components of R, G, b three colors added together.

F = R [r] + G [g] + b [b]

In which, R, G, B are the three primary colors involved in the mixing coefficient. When the three-color component is 0 (weakest), mixed with black light, and when the three-color component is K (strongest), mixed with white light. Adjust the values of R, G, b three coefficients to mix a wide variety of shade between black light and white light.

So where does YUV come from? In the modern color TV system, usually using a three-tube color camera or color CCD camera for camera, and then the captured color image signal by color separation, amplification and correction after the RGB, and then through the matrix transformation circuit to get the brightness signal Y and two color difference signal r-y (that is, u), b-y (ie V), At last the transmitter encodes the brightness and chromatic aberration by three signals, and sends out the same channel. This method of color representation is called YUV color space representation.

The importance of using YUV color space is that its brightness signal y and chroma signal u, v are separated. If only the Y signal component does not have a U or v component, then the image represented by this is a black-and-white grayscale image. Color TV using YUV space is precisely to use the brightness signal y to solve the color TV and Black-and-white TV compatibility problem, so that black-and-whites can also receive color TV signal.

YUV and RGB are converted to the following formula (RGB value range is 0-255):

Y = 0.299R + 0.587G + 0.114B

U = -0.147r-0.289g + 0.436B

V = 0.615r-0.515g-0.100b

R = Y + 1.14V

G = y-0.39u-0.58v

B = Y + 2.03U

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.