Talk:YCbCr

From Wikipedia, the free encyclopedia

This article is supported by the Color WikiProject.

This project provides a central approach to Color-related subjects on Wikipedia.
Please participate by editing the article, and help us assess and improve articles to good and 1.0 standards, or visit the wikiproject page for more details.

Start This article has been rated as start-Class on the quality scale.
??? This article has not yet received a rating on the importance scale.

Article Grading:
The article has been rated for quality and/or importance but has no comments yet. If appropriate, please review the article and then leave comments here to identify the strengths and weaknesses of the article and what work it will need.

Contents

[edit] Not 2^24 colors

Please forgive the odd comment placement, but I think this deserves attention.
I think the fact that 24 bit YCbCr, even without the "head room"/"toe room", does not contain a full set of 16777216 colors, should be expounded upon in this article, and the exact number of possible colors should be given.
For example, if (assuming there is no "buffer") Y where 0 (black) or 255 (white), the Cb and Cr values are irrelevant.
In fact, when saturation of a color is low, the precision of Cb and Cr is of little relevance.
Only when saturation is at the maximum it is possible get the "full range" of hues.

[edit] how close is it to red and blue again?

I hardly understood what chrominancy means, but really can't figure out the two chrominance components Cb and Cr, as mentioned in this article. Maybe someone can explain those in the article? thanks, --Abdull 21:55, 17 Jan 2005 (UTC)

"A different form of YCbCr is used for HDTV, as specificed in the ITU-R BT.709 standard." Just want to say this is not entirely correct. I have a bunch of HDTV files on my PC. Some of them are indeed encoded using Rec.709 (info is present in the header of the file and can be viewed with GSpot or latest DGDecode (Avisynth plugin)), while others are encoded using Rec.601. Wilbert Dijkhof 13:50, 21 March 2005 (GMT)

In general material from an HD source will use the correct (709) color. HD material that is from other sources is frequently generated (incorrectly) using 601 color conversions. Pelman 17:06, 5 April 2007 (UTC)

The above-quoted section has been rephrased to soften its forcefulness to address the above remark attributed to Wilbert Dijkhof. Cat5nap 19:56, 21 Mar 2005 (UTC)

[edit] "Sony Extended Video"

What on earth is "Sony Higher Definition"/"Sony Extended Video/"xvYCC"? Here is a link to a page at Sony which contains the term: http://news.sel.sony.com/pressrelease/6377

Please drop a note over my talk page if you respond :)

Thanks, Wulf 07:31, 9 January 2006 (UTC)

[edit] "Why is it Useful ?"

Feedback: Hi, Thanks for the article. I would have liked to have understood early in the article what YCbCR achieves over say just using RGB values. Why is it useful ? What are the benefits ? Then I would have been motivated to understand all the maths. [My background I.T. and trying to understand the landscape of video codecs]. Anyway, It's great to have all the detail there. Thanks, again. Peter H

I think a key point is in the first sentence: whether this is a good or bad color space (and there are entirely too many) it is the color space used in video systems; so if you need to work in that area, there's your motivation. Computer software tends to give the impression that everything works in RGB, but that's really a convenient abstraction. There are two specific advantages to YCbCr that I can think of, compared to RGB: (1) the use of Y means that there is a black and white signal in there directly; I think this was vital in the transition from black and white to color television. (2) the eye/brain is more sensitive to changes in Y than in CbCr. This is why it is used in JPEG compression; the Cb and Cr components are compressed more agressively than the Y component, allowing better overall compression with less loss of quality. Notinasnaid 09:18, 21 April 2006 (UTC)

The main advantage of Y'CbCr is that it allows color subsampling. As Notinasnaid pointed out, our vision has poorer resolution (or acuity) for color than for brightness. By reducing the resolution/bandwidth of the color, we can optimize the system for lower bandwidth. In practice, you can consider it to be a form of compression.

Y'CbCr encoding actually does not seperate color from brightness perfectly. Better systems however would be more computationally expensive and ?may add more rounding error?, so that's probably why they weren't implemented. Similarly, Y'IQ encoding incorporates some ideas that allow for better quality, but it was too expensive to implement and now the NTSC world uses Y'UV color encoding for analog broadcasts. Y'IQ rotates the chroma components, allowing one axis to have lower bandwidth than the other. This is because our eyes are more sensitive towards orange-blue (I) than for purple-green (Q).

More info can be found at [subsampling and of my articles. Unfortunately my article has errors in it, and may only make sense to me (if even).

Glennchan 02:21, 1 September 2006 (UTC)

[edit] Formula?

The formula "JPEG-YCbCb (601) from "digital 8-bit R'G'B' "" (the last set of equations), shouldn't it be the same as http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC30 ("How do I encode Y'CBCR components from computer R'G'B' ?") Either my math is very wrong (that would surprise me a bit), or I don't understand it at all (wouldn't surprise me), or there is something fishy here (well... this IS Wikipedia).

Reply: You're might be confusing JPEG-YCbCr (601) from "digital 8-bit R'G'B'" with YCbCr (601) from "digital 8-bit R'G'B'" :)

I'm not a regular of wikipedia, but would like to contribute to this particular discussion. People assume there is a single definition for ycrcb, and hence a single formula for converting rgb to/from ycrcb. In fact, there are several different but simular definitions for ycrcb.

The mpeg-2 standard describes these different definitions. You can buy this standard from ISO as ISO/IEC 13818-2, or download it for free from ITU (www.itu.int) as ITU-T H.262. Go to http://www.itu.int/publications/bookshop/how-to-buy.html and follow the instructions at 'Free Recommendations'.

Excerpt from ISO/IEC 13818-2:

Table 6-9: Recommendation ITU-R BT.709:

 E'Y = 0.7154 E'G + 0.0721 E'B + 0.2125 E'R 
 E'PB = – 0.386 E'G + 0.500 E'B – 0.115 E'R 
 E'PR = – 0.454 E'G – 0.046 E'B + 0.500 E'R 

FCC:

 E'Y = 0.59 E'G + 0.11 E'B + 0.30 E'R 
 E'PB = – 0.331 E'G + 0.500 E'B – 0.169 E'R 
 E'PR = – 0.421 E'G – 0.079 E'B + 0.500 E'R 

Recommendation ITU-R BT.470-2 System B, G:

 E'Y = 0.587 E'G + 0.114 E'B + 0.299 E'R 
 E'PB = – 0.331 E'G + 0.500 E'B – 0.169 E'R 
 E'PR = – 0.419 E'G – 0.081 E'B + 0.500 E'R 

SMPTE 170M:

 E'Y = 0.587 E'G + 0.114 E'B + 0.299 E'R 
 E'PB = – 0.331 E'G + 0.500 E'B – 0.169 E'R 
 E'PR = – 0.419 E'G – 0.081 E'B + 0.500 E'R 

SMPTE 240M (1987):

 E'Y = 0.701 E'G + 0.087 E'B + 0.212 E'R 
 E'PB = – 0.384 E'G + 0.500 E'B – 0.116 E'R 
 E'PR = – 0.445 E'G – 0.055 E'B + 0.500 E'R 

In Table 6-9:

E'Y is analogue with values between 0 and 1;

E'PB and E'PR are analogue between the values –0.5 and 0.5;

E'R, E'G and E'B are analogue with values between 0 and 1;

Y, Cb and Cr are related to E'Y, E'PB and E'PR by the following formulae:

  Y = ( 219 * E'Y ) + 16 
  Cb = ( 224 * E'PB ) + 128 
  Cr = ( 224 * E'PR ) + 128 

You can easily invert these equations to obtain the formuals for rgb as a function of ycrcb.

The mpeg-2 reference implementation is the program 'mpeg2dec', freely available on internet. The file 'globals.h' contains the color space conversion coefficients, 'Inverse_Table_6_9'. The actual arithmetic is done in display.c (and store.c). This is 8-bit accurate integer arithmetic.

HTH.

[edit] R'G'B' <-> RGB conversions

How to convert computer-RGB to and from gamma corrected RGB?

Lodev 16:30, 24 August 2006 (UTC)

Computer RGB *is* R'G'B'. It is *not* linear light levels, which is what RGB would be. This is assumming you are talking about the numbers from 0 to 255 that you stick into the display buffer to get an image on the screen.

Also, what are the inverse transformations (YCbCr to RGB) of the given formulas?

Using the Kb=.0722 and Kr=.2126 and doing matrix inversion I get: R = Y + 1.5748*Pr G = Y - 0.1873*Pb - 0.4681*Pr B = Y + 1.8556*Pb

User:Spitzak

[edit] Image removed

I removed image because it was wrong. Color planes there were really very blurred, so it was not good example to show low resoluton of eye to colors. Proper image should be made. —The preceding unsigned comment was added by 85.71.172.18 (talk) 19:50, 17 March 2007 (UTC).