diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2011-05-24 20:52:27 +0000 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-06 07:31:54 +0300 |
commit | 48fdd3d9268b55fe7e1743b43699b2650fb0db55 (patch) | |
tree | 4266f5dfd81cf366ec2ce4dac3968c1c57b9f6ad /libvo/csputils.c | |
parent | 94d3e6a710c40806f44c1d39aaa0388c05487b8f (diff) | |
download | mpv-48fdd3d9268b55fe7e1743b43699b2650fb0db55.tar.bz2 mpv-48fdd3d9268b55fe7e1743b43699b2650fb0db55.tar.xz |
vo_gl: Support 9- and 10-bit YUV input for OpenGL VOs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33502 b3059339-0415-0410-9bf9-f77b7e298cf2
Fix clear/border color of chroma texture for 9- and 10-bit formats.
Avoids pink borders for those formats.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33504 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/csputils.c')
-rw-r--r-- | libvo/csputils.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libvo/csputils.c b/libvo/csputils.c index 2978279398..0a58aa5a0e 100644 --- a/libvo/csputils.c +++ b/libvo/csputils.c @@ -62,6 +62,9 @@ void mp_gen_gamma_map(uint8_t *map, int size, float gamma) { * not with e.g. MP_CSP_XYZ */ void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, float yuv2rgb[3][4]) { + float depth_multiplier = params->input_shift >= 0 ? + (1 << params->input_shift) : + (1.0 / (1 << -params->input_shift)); float uvcos = params->saturation * cos(params->hue); float uvsin = params->saturation * sin(params->hue); int format = params->format; @@ -128,6 +131,9 @@ void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, float yuv2rgb[3][4]) { // this "centers" contrast control so that e.g. a contrast of 0 // leads to a grey image, not a black one yuv2rgb[i][COL_C] += 0.5 - params->contrast / 2.0; + yuv2rgb[i][COL_Y] *= depth_multiplier; + yuv2rgb[i][COL_U] *= depth_multiplier; + yuv2rgb[i][COL_V] *= depth_multiplier; } } |