summaryrefslogtreecommitdiffstats
path: root/libvo/vo_vdpau.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-03-08 05:25:33 +0200
committerUoti Urpala <uau@mplayer2.org>2012-03-09 20:48:55 +0200
commita8168102668337f3c11619bea7e744fc245adff1 (patch)
tree5f847baf425b1e672db6e91b7f307c30f44fb6ec /libvo/vo_vdpau.c
parent2a2f8672188273831dacd58a0dc76055326e4ce2 (diff)
downloadmpv-a8168102668337f3c11619bea7e744fc245adff1.tar.bz2
mpv-a8168102668337f3c11619bea7e744fc245adff1.tar.xz
vo_gl: improve 10-bit YUV->RGB conversion accuracy slightly
Modify the YUV->RGB conversion matrix to take into account the difference between the same color value being x/255 in a 8-bit texture and x*256/65535 in a 16-bit texture (actually things are stored as x*4/65535 for 10-bit color, but that can be ignored here). This 0.4 % difference in the shader float value could make shades of gray in 10-bit (or generally more than 8 bit) YUV produce RGB values with green slightly higher than red/blue.
Diffstat (limited to 'libvo/vo_vdpau.c')
-rw-r--r--libvo/vo_vdpau.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index f8b70a4255..0971ae47ea 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -599,7 +599,8 @@ static void update_csc_matrix(struct vo *vo)
// both are float[3][4]
VdpCSCMatrix matrix;
- struct mp_csp_params cparams = { .colorspace = vc->colorspace };
+ struct mp_csp_params cparams = {
+ .colorspace = vc->colorspace, .input_bits = 8, .texture_bits = 8 };
mp_csp_copy_equalizer_values(&cparams, &vc->video_eq);
mp_get_yuv2rgb_coeffs(&cparams, matrix);