Welcome to our community

Be a part of something great, join today!

  • Hey all, just changed over the backend after 15 years I figured time to give it a bit of an update, its probably gonna be a bit weird for most of you and i am sure there is a few bugs to work out but it should kinda work the same as before... hopefully :)

Chroma Subsampling Questions

Tyler Black

Well-known member
Joined
Apr 3, 2008
Messages
130
Reaction score
0
Points
0
I tried posting this last night, but I don't think it went through. If it comes up somewhere else as well, I apologize for the double posting:

I've been reading boards and searching the internet on this for weeks and haven't found anything that gets right down to the fundamentals of what the symbols of the main 2 chroma subsampled methods are. Let me tell you what I know (or think I know) and I would appreciate any help in filling in the blanks.

YCbCr is a digital chroma subsample
YPbPr is an analog chroma subsample
RGB is the chroma sample as seen by the camera prior to output and is always 4:4:4
Y is the luma component and Cb and Cr are the chroma components
The first number in a subsample method is always 4 and always represents luma while the following variable numbers are always chroma

Please correct any errors above, but here are my real questions:

1. Given YPbPr, Pb is Blue minus luma and Pr is Red minus luma: is the green channel carried in the Y luma component or is green a derivative color as a by-product of the first two?
2. For YCbCr I have the same question regarding the Cb and Cr components.
3. In 4:4:4 you have equal pixels of red blue and green. So in 4:2:2 you have 1/2 the red and blue pixels. Which of the 2's in the 4:2:2 number represents this? Is it the second number? Then what's the third number? I think I read that the second number indicates the number of red and blue pixels relative to the Y and the third number represents the number of lines that are sampled. Is that correct? I'm assuming not, because the 4:2:0 number would then mean that 0 lines were sampled.
4. YUV is a mystery. Can this be explained? Is it basically the same as the other two?
5. I know all of this equates to why certain cameras perform blue/green screen better. It's my understanding that 4:2:2 is better at keying than 4:2:0. If ALL subsampled video cameras have a smaller number of blue pixels, then it follows that all “chroma” keys done with non 4:4:4 cameras should be done with green rather than blue, correct?

Obviosly the 4:4:4 camera is better than the other two, but is 4:2:2 better than 4:2:0?

Thanks.
 
YPbPr (ITU-R BT.601)
========================================================
Y' = + 0.299 * R' + 0.587 * G' + 0.114 * B'
Pb = - 0.168736 * R' - 0.331264 * G' + 0.5 * B'
Pr = + 0.5 * R' - 0.418688 * G' - 0.081312 * B'
........................................................
YCbCr (601) from "digital 8-bit R'G'B' "
========================================================================
Y' = 16 + 1/256 * ( 65.738 * R'd + 129.057 * G'd + 25.064 * B'd)
Cb = 128 + 1/256 * ( - 37.945 * R'd - 74.494 * G'd + 112.439 * B'd)
Cr = 128 + 1/256 * ( 112.439 * R'd - 94.154 * G'd - 18.285 * B'd)
........................................................................

YUV, YPbPr, and YCbCr all refer to defined encoded color spaces where each component is a combination of RGB values as illustrated by the above tables. The Y component represents the range of luminance values to which the human eye is most sensitive and defines the resolution of a black and white image. The "b" and "r" components modify the luminance values to define color gamut. YUV and YPbPr are analog encoding and transmission schemes. YCbCr defines digital encode/decode values for the analog component input and output of a system. All are tied to standard phosphor reference CRT displays and are based on color sensitivity of the human eye.
The 4:x:x schemes refer to digital sample ratios between the 3 components of YCbCr used by different compression codecs. Luminance resolution remains the same, but as chroma samples are reduced you tend to get more color noise and bleeding across edge boundaries between different areas of the image, especially when contrast is high and colors are saturated.
 
1. Given YPbPr, Pb is Blue minus luma and Pr is Red minus luma: is the green channel carried in the Y luma component or is green a derivative color as a by-product of the first two?
You need to know Y' Pb and Pr to figure out green.
Ditto for red and blue.

I have a diagram for visualizing this stuff here:
http://www.glennchan.info/articles/technical/chroma/chroma1.htm

Y' can be thought of as the 'black and white' information.
Cb and Cr can be thought of as color.
*The separation is not perfect.

---
Chroma subsampling notation, 4:4:4 versus 4:2:0 versus 4:2:2
It doesn't really make much sense in my opinion. Anyways, just refer to Poynton's article on it:
http://www.poynton.com/PDFs/Chroma_subsampling_notation.pdf

4. YUV is a mystery. Can this be explained? Is it basically the same as the other two?
YUV is the intermediate format of composite analog signals being decoded I think. I might be wrong.

e.g. analog composite NTSC is everything combined into one signal. When you "uncombine" it, you get YUV.

Obviosly the 4:4:4 camera is better than the other two, but is 4:2:2 better than 4:2:0?
4:4:4 versus 4:2:2 doesn't really make a big difference for keying. Usually you would blur/erode the crap out of the matte so much anyways that it's not a big deal.

4:2:0: There are interlaced 4:2:0 formats and progressive 4:2:0 formats. The easy way to think of interlaced 4:2:0 is that chroma performance is halved horizontally, and a quarter vertically. It's a quarter vertically because you *have* to do the chroma subsampling onto an individual field instead of the frame. See the chroma bug article Stacey Spears linked to.

Progressive 4:2:0 is half performance in both directions.



I hope this stuff doesn't fry your brain. :yikes:
 
These are all excellent comments that are taking me to a greater understanding. And the articles that are referenced are outstanding. Thanks everyone that contributed. This is still a wrestling match for me to get my head around, so if anyone jumps into this and has further information, I'm all over it. The more the better. Thanks again everybody. I appreciate your wisdom.

I have another question grown from these responses: Are any of these analog equations something I need to worry myself about? I can see where even 5 years ago it might be necessary to try to have a complete understanding of the merging of the past and present, but as digital continues to move forward, will all of this analog info be obsolete; or should I invest more hours in trying to grasp this technology for future application? Does any of it still have a bearing on the digital world? And now that I have a sliver of an understanding of the significance of what these terms mean, is it all irrelevant when working with REC709, or does it all still apply? REC 709 is just another color gamut, isn't it? So all of the digital subsampling info will continue to be relevant in future technology, yes?
 
It starts as analog going into the lens and ends as analog on the screen. So yes it will remain relevant. REC709 is the extended YCbCr color gamut for HD that replaces 601. At some point more advanced wavelet compression schemes, like JPEG2000 or RED RAY may provide a better alternative but established standards die hard.
 
I have another question grown from these responses: Are any of these analog equations something I need to worry myself about?
I wouldn't worry about them... and you really don't need to know the numbers.

Many of the analog formats and chroma subsampling will stick around for a long time. If old systems didn't exist and we were to design TV/video systems from scratch, we probably wouldn't use chroma subsampling or analog broadcasting/transmission. But those systems will stick around due to analog cable, and analog TVs getting reception from digital transmission via digital->analog converter boxes.

2- The electronics behind digital gear still uses analog voltages and things like that... but I don't worry about that. You might if you run a broadcast facility and need to figure out how long your cables go, what type of cabling you need, termination, etc. etc.

3- The Rec. 709 color gamut is a different size compared to EBU and SMPTE C.

I don't believe Rec. 601 defines color primaries / a color gamut.

As far as the color gamuts go, it's easiest if you pretend that there is only one color gamut (e.g. Rec 709) and pretend that the others don't exist, in my opinion. From a practical perspective, that is what people do now. See
http://www.glennchan.info/articles/technical/hd-versus-sd-color-space/hd-versus-sd-color-space.htm
 
As far as the color gamuts go, it's easiest if you pretend that there is only one color gamut (e.g. Rec 709) and pretend that the others don't exist, in my opinion. From a practical perspective, that is what people do now. See
http://www.glennchan.info/articles/technical/hd-versus-sd-color-space/hd-versus-sd-color-space.htm

Thanks for the links to the articles.

Isn't this recommendation a bit dangerous for folks intending to author SD DVD (with it's 601 color space)?

While obviously not the ideal HiDef target, in reality there are LOTS of DVD decks out there, and it's very likely that even RED originated material is going to make it's way there...

Wouldn't you end up with incorrect color rendition in two scenarios:

1) A SD DVD with 709 content played on a SD monitor will have no color conversion aplied, and thus be "off"

2) The "correct" behavior for a device scaling SD content to HD resolutions (be it the deck or the display) is to also apply the correction transforms for 601--> 709 color space. However becasue the color space on the SD DVD is "already" 709, the transforms would push the color space out of whack.


Or am I misunderstanding your recommendation?

Thanks.

-Steve
 
Isn't this recommendation a bit dangerous for folks intending to author SD DVD (with it's 601 color space)?

I believe Glenn is talking about the gamut, not the conversion matrix. Both SD and HD BVMs had the same SMPTE C color primaries.

You still want to use 601 matrix for SD and 709 matrix for HD.

There are a lot of devices that don't twist the color matrix when converting SD to HD. The good news is that several recent BD players are now doing it correctly. Of course, PIP on BD is 601 and it is not being twisted because they often composite in YCbCr and then convert to RGB.
 
Recap, there are two differences between Rec. 709 and (say) Rec. 601 with SMPTE C primaries:
1- The luma coefficients are different. This is the matrix Stacey refers to. Matrix = another way of writing algebra. You plug different numbers in for 601 and 709.
2- The primaries are different.

We should absolutely handle #1 correctly. This can be noticeable if there is clipping, or if your color bars can't line up.

#2 is ignored in practice (generally). IMO we should keep it that way.

Getting #1 wrong is subtle, although numerically the difference is huge. Some equipment will do #1 wrong intentionally because it's slightly cheaper to do that. #1 is noticeable for super saturated colors, and when clipping occurs.
#2 is way, way more subtle than #1.

Sorry, I don't have pictures of that up on my article.
 
If only I knew how important algebra (3x3 matrix) really was in high school. :) Here is a sample image that might help.

barsmatrix.jpg
 
Recap, there are two differences between Rec. 709 and (say) Rec. 601 with SMPTE C primaries:
1- The luma coefficients are different. This is the matrix Stacey refers to. Matrix = another way of writing algebra. You plug different numbers in for 601 and 709.
2- The primaries are different.

We should absolutely handle #1 correctly. This can be noticeable if there is clipping, or if your color bars can't line up.

#2 is ignored in practice (generally). IMO we should keep it that way.

Getting #1 wrong is subtle, although numerically the difference is huge. Some equipment will do #1 wrong intentionally because it's slightly cheaper to do that. #1 is noticeable for super saturated colors, and when clipping occurs.
#2 is way, way more subtle than #1.

Sorry, I don't have pictures of that up on my article.

Ah, thanks Stacey and Glenn. I indeed was missing the fact that the recomendation was to ignore the gamut differences not the color space conversion process.

Much appreciated, thanks.

-Steve
 
Back
Top