Recognize RGB and YUV

Source: Internet
Author: User

For many years, for most people, there are three kinds of knowledge about graphic signals: RF signal, composite video signal,S video signal . The RF signal is modulated by the composite video signal to the high frequency, the antenna input signal of the ordinary TV is used for the RF signal, the input of the composite video signal is the RGA terminal. As our most common audio interface, the input of the S video signal is a four-wire terminal. Commonly known as the S-terminal. In the definition, the S terminal is the highest, the composite video is the second, the RF video is the worst.

With the advent of DVD players and digital set-top boxes, in order to provide more clear graphics, two new video patterns are also displayed in the public eye, this is the RGB and YUV signal, also called color component signal, said its new, in fact, professional work and video players. It's never been cooked again. In addition, the input signal of the computer display is RGB, but usually people do not care about it.

Common composite video signal with pal, NTSC, SECAM and other three-mode, because the image is displayed through the visual coding and decoding process, will produce some additional interference. For example, in the high-brightness display object edge, you will see the phenomenon of crawling, when there are a variety of colors in the movement of objects, there will be color instability phenomenon. RGB, YUV signal will not have such a problem. Because the phenomenon of the three cathode input signal is R, G, B signal this is the most primitive, the most direct signal, RGB and YUV signal No color difference problem, different formats are only related to synchronous signal, composite video signal and S-video signal aulympic scanning frequency fixed at 15.625KHZ (for PAL or 15.750 (for PAL). Higher scanning frequency signals will be provided by RGB and YUV.

about the RGB

RGB signal application is much earlier than YUV, many professional-level monitor, projection with RGB input. The RGB signal must exist simultaneously with the synchronous signal, there are three kinds of forms; The first is the presence of 5 signals, i.e. R, G, B, H, v where H and V are horizontal synchronous signals, and the second is the presence of a 4-way signal i.e. R, G, B, s which is a composite signal with horizontal pure straight signal synchronous video signal The third kind is 3 signal, namely R, G, B, wherein the synchronous signal is added to the G signal, playing in the meta-projector or high-machine monitor, often encounter such problems, must be direct attention, fortunately, many of the sources are now switching switches, in order to output different forms, In addition, advanced video devices can automatically identify non-formal RGB signals.

In a PAL-based European region, the RGB signal is included in the 21-pin SCART terminal. It is noteworthy that the R, G, B signal in this state is 0.7V, there is no base pulse, there is no synchronization signal on the G signal and its addition, and there is no separate synchronization signal with the accompanying, but with a composite video signal as a synchronous signal. SCART the content of the terminal is quite rich, also includes the left and right channel stereo signal , the following table is the SCGRT terminal pin description which contains the RGB signal. There is also a standard for scart terminals that contain Y, C signals, equivalent to the S-terminal.

However, in North America and in countries and regions where TV is NTSC, the RGB signals are connected separately with BNC plugs. In this state, the signal level of R, G, and B is 0.714V, which contains the base pulse. If the G signal is synchronized, the level of the sync pulse is 0.286V. about the YUV

There is less knowledge of YUV than RGB, only in recent years it has been known. Y is the luminance component, U , V respectively for r-y and the b-y component, also known as chromatic aberration component. Y, U, V and R, G, b constitute a color vector space. RGB requires three components to represent color, and YUV needs only two components of r-y and b-y. So YUV is particularly suitable for the digital processing of the image for data transmission and storage, such as MPEG, JPEC as standard image compression is carried out in YUV, which is why high-end DVD machine are color difference output terminal.


RGB is from the color of the principle of light to design, popular Point said its color mixing way is like red, green, blue three lights, when their light overlap, the color mix, and brightness is equal to the sum of the brightness of the two (two lamp brightness!). ), the higher the blending brightness, the more The addition is mixed.
YUV is mainly used to optimize the transmission of color video signal, so that it is backward compatible with old black and white. Compared with the RGB video signal transmission, its greatest advantage is that it takes only a very small bandwidth (RGB requires three separate video signals to transmit simultaneously). where "Y" is the luminance (luminance or Luma), which is the grayscale value, and "U" and "V" are the chroma (chrominance or Chroma), which describes the color and saturation of the image used to specify the color of the pixel. The main sampling formats are YCbCr 4:2:0, YCbCr 4:2:2, YCbCr 4:1:1, and YCbCr 4:4:4. Among them, YCbCr 4:1:1 is more commonly used, the meaning is: each point to save a 8bit brightness value (that is, Y value), each 2x2 point to save a Cr and Cb value, the image in the naked eye does not feel much change. So, the original use of RGB (R, G, B are 8bit unsigned) model, a point requires 8x3=24 bits (such as the first figure), (after full sampling, YUV still accounted for 8bit). After sampling by 4:1:1, the average is now only 8+ (8/4) + (8/4) =12bits (4 points, 8*4 (Y) +8 (U) +8 (V) =48bits), with an average of 12bits per point (as in the second figure). This compresses the image data by half.

that is, the YUV format is smaller than the RGB format storage space.

YUV and RGB Conversion formula

Y = 0.257R + 0.504G + 0.098B + 16
U = 0.148r-0.291g + 0.439B + 128
V = 0.439r-0.368g-0.071b + +
B = 1.164 (Y-16) + 2.018 (U-128)
G = 1.164 (Y-16)-0.813 (V-128)-0.391 (U-128)
R = 1.164 (Y-16) + 1.596 (V-128)

Recognize RGB and YUV

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.