Video pixel formats

Source: Internet
Author: User

To decode compressed video, use one of the following uncompressed pixel formats.

Pixel format Description

Yuy2

As described in video pixel formats, produced t that two lines of Output CB and Cr samples are produced for each actual line of CB and Cr samples. the second line of each pair of output lines is generally either a duplicate of the first line or is produced by averaging the samples in the first line of the pair with the samples of the first line the next pair.

Uyvy

As described in video pixel formats, produced t that two lines of Output CB and Cr samples are produced for each actual line of CB and Cr samples. the second line of each pair of output lines is generally either a duplicate of the first line or is produced by averaging the samples in the first line of the pair with the samples of the first line the next pair.

Yv12

All y samples are found first in memory as an array of unsigned char (possibly with a larger stride for memory alignment ), followed immediately by all cr samples (with half the stride of the Y lines, and half the number of lines), then followed immediately by all CB samples in a similar fashion.

Iyuv

The same as yv12, before t for swapping the order of the CB and Cr planes.

Nv12

A format in which all y samples are found first in memory as an array of unsigned char with an even number of lines (possibly with a larger stride for memory alignment ). this is followed immediately by an array of unsigned char containing interleaved CB and Cr samples. if these samples are addressed as a little-Endian word type, CB wocould be in the least significant bits and Cr wocould be in the most significant bits with the same total stride as the y samples. nv12 is the preferred pixel format.

Nv21

The same as nv12, could t that CB and Cr samples are swapped so that the chroma array of unsigned char wowould have cr followed by CB for each sample (such that if addressed as a little-Endian word type, cr wocould be in the least significant bits and CB wocould be in the most significant bits ).

Imc1

The same as yv12, doesn t that the stride of the CB and Cr planes is the same as the stride in the Y plane. also, the CB and Cr planes must fall on memory boundaries that are a multiple of 16 lines. the following code examples show calculations for the CB and Cr planes.

BYTE* pCr = pY + (((Height + 15) & ~15) * Stride);BYTE* pCb = pY + (((((Height * 3) / 2) + 15) & ~15) * Stride);

In the preceding examples, Py is a byte pointer that points to the beginning of the memory array, and height must be a multiple of 16.

Imc2

The same as imc1, doesn t that CB and Cr lines are interleaved at half-stride boundaries. in other words, each full-stride line in the chrominance area starts with a line of Cr, followed by a line of CB that starts at the next half-stride boundary. (this is a more address-space-efficient format than imc1, because it cuts the chrominance address space in half, and thus cuts the total address space by 25 percent .) this is an optionally preferred format in relation to nv12, but nv12 appears to be more popular.

Imc3

The same as imc1, memory T for swapping CB and Cr.

Imc4

The same as imc2, memory T for swapping CB and Cr.

 

For more information about these formats, see recommended 8-bit YUV formats for video rendering in the Microsoft Media Foundation documentation.


Http://msdn.microsoft.com/en-us/library/windows/hardware/ff538197%28v=vs.85%29.aspx

Https://wiki.videolan.org/YUV/#NV21

Video pixel formats

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.