summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl.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_gl.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_gl.c')
-rw-r--r--libvo/vo_gl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index e68465f009..12749426ab 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -220,7 +220,8 @@ static void update_yuvconv(struct vo *vo)
mp_get_chroma_shift(p->image_format, &xs, &ys, &depth);
params.chrom_texw = params.texw >> xs;
params.chrom_texh = params.texh >> ys;
- params.csp_params.input_shift = -depth & 7;
+ params.csp_params.input_bits = depth;
+ params.csp_params.texture_bits = depth+7 & ~7;
glSetupYUVConversion(gl, &params);
if (p->custom_prog) {
FILE *f = fopen(p->custom_prog, "rb");