Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

separate Y from CbCr in YCbCr

Hi

I have YCbCr video data in two color spaces in sequence(on the same 8bit data bus). I want to separate Y component from CbCr.

can you help me please!

thank You

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You need Y, Cb and Cr if you are going to colour space convert to RGB. Setting Y to 0 just kills an RGB output. The conversion is done via a matrix transform. But depending on what your input and output are for affects the matrix.

    Raw video off a DAC is likely to have Y values in the range 16 to 235. PC monitors often expect the range 0 to 255 for RGB for peak values, so you can either rescale the input to 0 to 255 or use a different matrix for the colour space conversion.

    The standard matrix for conversion is:

    
    (R) = ( 1.0 ,  0.0   ,  1.140 , 0.0 )   (Y )
    (G) = ( 1.0 , -0.396 , -0.581 , 0.0 ) * (Cb-128)
    (B) = ( 1.0 ,  2.029 ,  0.0   , 0.0))   (Cr-128)
    So
    R = Y + 1.14(Cr-128)
    G = Y - 0.396(Cb-128) - 0.581(Cr-128)
    B = Y + 2.029(Cb-128)