yuvwebmlibvpx

yuv to rgb for libvpx/webm


does anybody know the correct matrices for yuv -> rgb and rgb -> yuv that is used by libvpx/webm? when i use a standard one from wikipedia then my video output looks a bit different to vlc, the colors are stronger.


Solution

  • Seems to be same as need to create a webm video from RGB frames

    there is one set of matrices for SD video and another for HD video. So remember that. Also RGB to YUV matrix is independent of the codec. The UV sample location is dependent on the codec.

    You can also take a look at http://www.fourcc.org/fccyvrgb.php to understand the conversion issue better

    EDIT: Explanation: The problem is not the equations per se but the understanding. Let me explain:

    Analog data on a component cable when converted to digital is supposed to be in the Range 16-220 for Y and 16-240 for Cb and Cr. So correctly captured data will always be in that range. For such data Y601 = 0.299R ́ + 0.587G ́ + 0.114B ́

    However in many computer softwares 0-255 is used as the range. For that 0.257R ́ + 0.504G ́ + 0.098B ́ + 16 is a more appropriate equation.

    For HD data the color conversion scheme is 709 and it changes the equation to Y709 = 0.213R ́ + 0.715G ́ + 0.072B ́

    If your range is 0-255 the conversion should be Y709 = 0.183R ́ + 0.614G ́ + 0.062B ́ + 16

    I suggest you read www.compression.ru/download/articles/color_space/ch03.pdf once.