the YUV color Y = 0.299R' + 0.587G' + 0.114B space and is optionally used by the NTSC composite color video standard. (The "I" stands for "in-phase" Pb = -0.169R' - 0.331G' + 0.500B' and the "Q" for "quadrature," which is the modula- Pr = 0.500R - 0.419G' - 0.081B tion method used to transmit the color information.) To generate 8-bit YCbCr with the proper values, YPbPr is The basic equations to convert between R'G'B' and then quantized to 8 bits: YIQ are: Y = 0.299R' + 0.587G' + 0.114B Y = round [219Y + 16] I = 0.596R' - 0.275G' 0.321B Cb = round [224Pb + 128] = Vcos 33° - Usin 33° Cr = round [224Pr + 128] = 0.736(R' - Y) - 0.268(B' - Y) RGB to YCbCr: Digital Equations Q = 0.212R' - 0.523G' + 0.311B = Vsin 33° + Ucos 33° To convert 8-bit digital R'G'B' data with a 16-235 nominal range (Studio R'G'B') to YCbCr, the analog = 0.478(R' - Y) + 0.413 (B'-Y) - equations may be simplified to: or, using matrix notation: Y = 0.299R' + 0.587G' + 0.114B' Cb = -0.172R' - 0.339G' + 0.511B + 128 sin(33)]IV Cr = 0.511R' - 0.428G' - 0.083B' + 128 YCbCr to RGB: Analog Equations R' = Y + 0.956I + 0.621Q Many specifications assume the source is analog YPbPr. G' = Y - 0.272I - 0.647Q This is first converted to analog R'G'B': B' = Y - 1.1071 + 1.704Q R' = Y + 1.402Pr For digital R'G'B' values with a range of 0-255, Y has G' = Y - 0.714Pr - 0.344Pb a range of 0-255, I has a range of 0 to +152, and Q has B' = Y + 1.772Pb a range of 0 to +134. I and Q are obtained by rotating the U and Vaxes 33°. These equations are usually scaled to To generate 8-bit R'G'B' with a 16-235 nominal range simplify the implementation in an actual NTSC digital (Studio R'G'B'), R'G'B' is then quantized to 8 bits: encoder or decoder. out' = round[219in' + 16] CHAPTER 7.2 Colour spaces YCbCr to RGB: Digital Equations Note that 8-bit YCbCr and R'G'B' data should be saturated at the 0 and 255 levels to avoid underflow and To convert 8-bit YCbCr to R'G'B' data with a 16-235 nominal range (Studio R'G'B'), the analog equations may overflow wrap-around problems. be si