Microsoft KB Archive/294880

= General Information About Pixel Formats =

Article ID: 294880

Article Last Modified on 11/26/2003

-

APPLIES TO


 * Microsoft Windows Media Services 4.1
 * Microsoft Windows Media Player 6.4
 * Microsoft Windows Media Player 7.0
 * Microsoft Windows Media Player 7.1
 * Microsoft Windows Media Encoder 7.0
 * Microsoft Windows Media Encoder 7.1
 * Microsoft Windows Media Encoder 8.0

-



This article was previously published under Q294880



SUMMARY
There are different methods for representing color and intensity information in a video image. The video format that a file uses to store this information is also known as the pixel format. When you convert a file to Windows Media Format, some pixel formats are recommended over others to maintain high content quality. There are two major types of pixel formats. They are classified as YUV and RGB pixel formats.



YUV Pixel Format
YUV Color System is a color-encoding scheme for natural pictures in which the luminance (the black-and-white component of a video signal that controls the light intensity) and chrominance (the color component of the video signal) are separate. The human eye is less sensitive to color variations than to intensity variations, so YUV allows the encoding of luminance (Y) information at full bandwidth and chrominance (UV) information at half bandwidth.

YUV formats are subdivided into two more groups: packed and planar. In the packed format, the Y, U, and V components are stored in a single array. The three components packed into what is known as a macropixel (two pixels stored in one unsigned integer value). Conversely, the planar format stores these components in three separate arrays and combines the planes to form the image.

The variations in the different YUV samples are based on how data is sampled, both in the horizontal and vertical directions. The horizontal subsampling interval describes how frequently across a line that a sample of that component is taken, and the vertical interval describes on which lines samples are taken. For example, if the format has a horizontal subsampling period of 2 for both the U and V components, it indicates that U and V samples are taken for every second pixel across a line. If the vertical subsampling period is 1, it indicates that U and V samples are taken on each line of the image.

RGB Pixel Format
The primary colors in color video are red, green, and blue (RGB). RGB is often used to describe a type of video color-recording scheme and the type of equipment that uses it. It also describes a type of computer color display output signal comprising separately controllable red, green, and blue signals (as opposed to composite video, in which signals are combined before output). RGB monitors typically offer higher resolution than composite monitors.

Recommended Pixel Formats
The following list contains the recommended pixel formats (in order of preference), and a brief description of the format:  IYUV/I420 (planar 4:2:0 or 4:1:1) Comprised of an NxN Y plane followed by (N/2)x(N/2) U and V planes. This format draws a top-down image (for example, the first line is at the top of the screen).

 YV12 (planar 4:2:0 or 4:1:1) Identical to IYUV/I420 except that the U and V planes are switched. This is usually the pixel choice for many MPEG codecs.

 YUY2 (packed 4:2:2) Specifications claim this is a top-down image, although not all drivers follow the specifications properly. In some instances, this can lead to an inverted image when the video is played back. This problem can also be seen in other packed formats such as UYVY and YVYU, which are not PC99 compliant. For more information see the following KB Article:

269967 Video Appears Upside Down When You Use AVI File as Source File

The YUY2 format effectively stores 16 bits per pixel.

The data is stored as (Y0-U0-Y1-V0)(Y2-U2-Y3-V2)(Y4-U4-Y5-V4) and so on.

NOTE: represents 1 megapixel

 UYVY (packed 4:2:2) Very similar to YUY2 except in the ordering of the data.

The data is stored as (U0-Y0-V0-Y1)(U2-Y2-V2-Y3)(U4-Y4-V4-Y5) and so on.

NOTE: represents 1 megapixel

 YVYU (packed 4:2:2) Also, very similar to YUY2 except for the ordering of the data.

The data is stored as (Y0-V0-Y1-U0)(Y2-V2-Y3-U2)(Y4-V4-Y5-U4) and so on.

NOTE: represents 1 megapixel

 RGB 24 Specifies a pixel format with 24 bits per pixel (bpp). An individual pixel is represented by 3 bytes. The blue intensity is the lowest order byte, followed by green, and then red. There is no padding between pixels.

 RGB 32 Very similar to RGB 24 except that each pixel is padded. Although this uses more memory, it is usually easier to process by graphics cards.

</li> RGB 15/16 This RGB format is based on 5 bpp (RGB 5:5:5), yielding 32,786 colors. RGB 16 uses RGB 5:6:5 ratio yielding 65,536 colors.

</li> YVU9 (planar 16:1:1) Comprised of an NxN plane of Y samples, 8 bits each, followed by (N/4)x(N/4) V and U planes. This format draws a top-down image.

</li> RGB 8 Each pixel is represented by 1 byte. This gives a total of 256 colors.</li></ol>

<div class="references_section">