PDA

View Full Version : Explanation of YUV X:X:X notation


thewebchat
2nd August 2009, 02:45
I know that the different YUV chroma sub-sampling formats are given the notation 4:x:x, with YUY2 being 4:2:2 and YV12 being 4:2:0. My question is, what does this numerical notation indicate? I have read the YUV article on Wikipedia, but it does not explain what this notation means.

linyx
2nd August 2009, 04:00
I'm a noob, so this might be wrong, But:

The numbers represent the vertical resolutions given to the Luminance and Chrominance of a color space.

The first number usually represents the Luminance (Y), the second represents the Blue minus the Luminance (Cb), while the third represents the Red minus the Luminance (Cr). Green minus the Luminance is not stored becuase it can be calculated by subtracting the Cb & Cr from Y.

So for something like 4:2:2, each pixel would have a Luminance sample, but only 2 out of every four (vertical & horizontal; so truly only 1/4 of the pixels are given a color sample) would have a Cb and Cr sample. The exception is 4:2:0 which should really be 4:0:0

It can be illustrated like such for a 4:2:0 colorspace:
0=Y
1=Y+Cb+Cr

1 0

0 0

4:4:4 would be:
1 1

1 1

Most of this was roughly copied from "H.264 and MPEG-4 Video Compression."

TinTime
2nd August 2009, 11:17
The first digit represents the number of horizontal pixels we're considering. Although this can have any value it always seems to be 4. It's also implicit that we're looking at two lines at a time. So with the first digit as 4 it means that we have a 4x2 (horizontal by vertical) block of pixels.

The second digit indicates how many chroma samples are taken from the top line of each block of pixels, and the third digit indicates how many are taken from the bottom line.

e.g. 4:2:2 results in each chroma sample representing a 2x1 block of pixels - 2 samples per line of four pixels.

x represents a chroma sample, o doesn't

xo|xo
xo|xo

4:2:0 results in each chroma sample representing a 2x2 block of pixels as the bottom line value is 0.

xo|xo
oo|oo

And 4:1:1 would be:

xooo
xooo

Hope this makes sense!

thewebchat
2nd August 2009, 14:42
Thank you, TinTime, your post cleared this up for me.

unnikrisb4u
3rd August 2009, 04:17
That was a wonderful explanation. Thanks for Information