Several formats of YUV

Source: Internet
Author: User
Differences between yv12 and i420
Generally, the video data directly collected is in rgb24 format. The size of a rgb24 frame is size = width × heigth × 3 bit, and the size of rgb32 is width × heigth × 4, for i420 (that is, the YUV standard format), the data volume is size = width × heigth × 1. 5 bit.

After rgb24 data is collected, the data in this format needs to be compressed for the first time. The color space of the image is determined by rgb2yuv. Because the standard YUV () is required for x264 encoding ). However, it should be noted that although yv12 is also (), yv12 and i420 are different, and there are some differences in the storage space. As follows:

Yv12: brightness (row x column) + U (row x column/4) + V (row x column/4)

I420: brightness (row x column) + V (row x column/4) + U (row x column/4)

It can be seen that yv12 and i420 are basically the same, that is, the UV sequence is different.

Continue to our topic. After the first data compression, rgb24-> YUV (i420 ). In this way, the data volume will be halved. Why? Well, this is too basic, and I will not write more. Similarly, if it is rgb24-> YUV (yv12), it is also halved. However, although both are half, if yv12 is used, the effect will be greatly reduced. Then, the data size will be greatly reduced after the x264 encoding. The encoded data is packaged and transmitted in real time through RTP. After arriving at the destination, extract and decode the data. After decoding, the data is still in YUV format. Therefore, a conversion is required so that the windows driver can process the data, that is, yuv2rgb24.

 

Yuy2 is [y0 U0 Y1 V0]

The differences between yuv420p and yuv420 differ in storage formats.

Yuv420p: yyyyyyyy uuuuuuuu vvvvv
Yuv420: 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.