[MPlayer-dev-eng] yuv2rgb and 'equalizer' ?

Arpi arpi at thot.banki.hu
Mon Mar 25 18:05:39 CET 2002


Hi,

Many users request brightness/contrast/hue/saturation/etc settings for
rgb-only outpouts (vesa, x11, fbdev etc).

while writting the colorspaces.txt i got and idea (it was also discussed
some time ago on teh libmpeg2-dev list):

afaik we're using the simplified yuv2rgb equations:
    R = Y + 1.403V'
    G = Y - 0.344U' - 0.714V'
    B = Y + 1.770U'
using tables (C) or MMX (asm) for multiplication and cropping.

by changing these constants we could add brightness, contrast and
saturation setting. Hue is not possible without full 3x3 matrix, but i don't
think anyone wants to change Hue anyway.

yuv2rgb_c_init() even support the standard yuv formats, but doesn't really
use them:

uint32_t matrix_coefficients = 6;
...
    int crv = Inverse_Table_6_9[matrix_coefficients][0];
    int cbu = Inverse_Table_6_9[matrix_coefficients][1];
    int cgu = -Inverse_Table_6_9[matrix_coefficients][2];
    int cgv = -Inverse_Table_6_9[matrix_coefficients][3];

we should get the right value (now hardcoded to 6) from mpeg display
extension header.

the main question: does yuv2rgb_c_init() really affects the MMX optimized
versions of yuv2rgb too? It seems it only has effects to the C version :(

the mmx version seems to use these hardcoded coefficients:
uint64_t __attribute__((aligned(8))) mmx_Y_coeff = 0x253f253f253f253f;
uint64_t __attribute__((aligned(8))) mmx_U_green = 0xf37df37df37df37d;
uint64_t __attribute__((aligned(8))) mmx_U_blue = 0x4093409340934093;
uint64_t __attribute__((aligned(8))) mmx_V_red = 0x3312331233123312;
uint64_t __attribute__((aligned(8))) mmx_V_green = 0xe5fce5fce5fce5fc;


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list