Understanding Color Sampling

This is weird. For the second time in as many days, I see that Barry Green has posted in one of the article threads. I click on that article thread, but his post is nowhere to be found. Does anyone see a Barry Green post right above mine and right below Ted's? I don't. If I search for posts by barry green, I can see it.

Weird,
Jason
 
Seems theres confusion over 4:2:0, insofar as the 0 isnt actually 0. Its actually the integer used for 2:1 compression. It does not mean 0 as in nothing.

The XDcam uses 4:2:0 and its a number one seller. So, a lot of HD your seeing comes from this camera. But can you tell the difference on your TV? Weather it be a 42 inch plasma like mine or larger? Un bloody likely. Consider that the US (once again per BG) is mostly still broadcasting SD at 4:3, you can just about achieve 4:4:4 on a downrezzed HD aquisition.

In Japan HD has almost become prevalent (cars here are turned over every year). And the most common output is mpeg2. A 4:2:0 codec. There has been some shifts in decoders in recent years to improve quality. I think its important to understand the rear end so to speak. Japan is at the leading edge in this area......... I submit this article from NHK arguably the most technologically advanced broadcas network in the world : http://www.ebu.ch/en/technical/trev/trev_304-mpeg2.pdf

After reading that do things appear more gray than black and white? Well thats the HDTV world where 4:2:2 does not equal 8 and 4:2:0 does not equal 6.
 
Last edited:
Great explanation. Thanks Barry.

My professor in college referred to color sampling as going to a buffet. In a strange way, it made sense.
 
Great article! Finally these numbers make sense to me. And also, the knowledge of colour sampling can be translated into managing your lighting and colour better for your productions.
 
It's funny though, that if the codec doesnt' average, but just "picks" one colour from the 4 in 4:1:1, you could do chroma reconstruction to produce a better result than you'd get from the averaging.
Hey Graeme, in my tests of that approach it has low RMSE (average error; root mean square error) but visually doesn't look that great. It has inherent aliasing problems, so things like colored lines can lose and gain back their color (in the same image). The decoder for that is also relatively complex, so it won't perform as fast / will cost more. Of course, you've seen my results so you already know this.

2- Barry:
Can I be picky here? :D The diagrams might be slightly wrong compared to actual implemention.

The diagrams you show are what you (well, I) intuitively would guess about the schemes. However, there are actually *multiple* 4:2:0 schemes. This is because the 4:2:0 diagrammed (in your article) has problems with interlacing, and the other 4:2:0 schemes try to solve that.

If you notice in interlacing, the fields are taken from two different points in time. However, the chroma is averaged from two different points in time. This time mismatch means that the chroma is inappropriate if you have motion going on.

To fix this, you can break the image up into two fields, and 4:2:0 sample each field. This way, the chroma samples are taken from the right slice of time, so you won't have problems with motion. However, you introduce new problems. Each chroma sample, effectively, describes the chroma for an area ~2 pixels wide by 4 pixels tall (ignore co-siting for now). This is actually not as good compared to 4:1:1, where the chroma samples describe a ~4 X 1 area (again, ignore co-siting for now).

You also get another problem in that the artifacts look comb-like, instead of a smooth transition.

See
http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html (somewhat related)
And the 4:2:0 follies article by adam wilt in DV magazine is very relevant here, but unfortunately it's not on dv.com anymore.

The following formats use different 4:2:0 variants:
PAL DV (except for DVCPRO PAL, which is 4:1:1)
MPEG2/DVD - DVD uses two schemes, one interlaced sampling and the other progressive
?HDV seems to be the same as in DVD. The Main Concept HDV encoder is consistent with MPEG2/DVD in my testing.


3- The chroma samples tend to be centered over a particular pixel, and describe the chroma over an area. i.e. for 4:1:1, a chroma sample can be taken from the chroma values from 7 different pixels (assuming a simple filtering scheme; some filtering schemes look at a much larger number of pixels).

On a professional VTRs, they seem to apply some chroma interpolation,
so the missing chroma values are created by looking at the chroma samples to the left and right (i.e. TWO chroma samples). Compare and contrast this to what most DV codecs do: reconstruction is based upon a SINGLE chroma sample. Your diagram shows what most DV codecs do. While I don't believe what most DV codecs do is entirely correct (it shifts the chroma horizontally), that chroma shifting makes other problems look less bad. The scheme used in most DV codecs also has good multi-generation performance.


4- If you want to get really hardcore, you could look at how pixel shifting the in camera (i.e. the DVX100 exploys pixel shifting) affects effective color quality. The effects of pixel shifting happen before compression and before chroma subsampling. For ideal 4:4:4 color, you would not employ pixel shifting (although pixel shifting may yields better pictures / MTF).

I have never tested with the DVX100, but my Panasonic GS70 (NTSC) does pixel shifting and employs heavy filtering. Its color resolution is terrible (both vertically and horizontally).
 
Last edited:
So Glenn,

Are there any real world examples of frame grabs or video clips to show the image quality before and after pixel shifting? Perhaps you can share what you have tested with the GS70?
 
The diagrams you show are what you (well, I) intuitively would guess about the schemes.
Well, no, they're not guesses. They're actual pixel-for-pixel extractions of what the codec does to the footage. I ran the pixel-based 4:4:4 image through each of the codecs (DV NTSC for 4:1:1, DV PAL for 4:2:0, DV50 NTSC for 4:2:2). So the colors that are generated and demonstrated there are what actually happens.

Yes, interlaced 4:2:0 is a nightmare, which may be why Panasonic chose 4:1:1 for DVCPRO in PAL... and again, the article isn't meant to be all-encompassing, it's meant to provide a basic overview so that the numbers start to make some sense. :)
 
Hey Luzer,

You can't un-pixel shift the GS70 easily since the CCDs are aligned that way at the factory, and the DSP in the camera is designed for pixel shifting.

I suppose it would be possible to measure luminance and color resolution simultaneously, to show you the relative differences between the two.

If you display the following pattern, it's a good test of resolution + aliasing.
http://glennchan.info/Proofs/forums/double-zone.png

Unfortunately, that test pattern is very difficult for monitors to display correctly (and I haven't figured out how to print it correctly). Resizing it bigger 2X via **nearest neighbour** might help (or zoom in 200%, which does the same thing in Photoshop).

2- Barry:
They're incorrect in the sense that they don't show the correct way of doing things (i.e. they don't show co-siting). Although in the case of the apple NTSC DV codec, your 4:1:1 diagram should be correct.

For the DV50 4:2:2 codec, the correct diagram for that codec would be a little different and would show co-siting (since that's what the DV50 codec does). The chroma samples are positioned over a luma sample, not between them. And in the case of Apple DV50, the sample is taken as an average of:
0.25 times the chroma to the left
0.5 of the chroma it's sitting on
0.25 times the chroma to the right

Of course, that makes things a little harder to explain.
 
Excellent article, really gives the black and white answers to what can be done with what sampling and what you miss without the better samples. Good read as always.

- Kyle
 
Back
Top