summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorBin Jin <bjin1990@gmail.com>2015-11-09 21:39:06 +0000
committerwm4 <wm4@nowhere>2015-11-09 22:48:40 +0100
commit03bbaad686432b6f98c8bfc45206aea55ebe7ebc (patch)
tree70bee3225341a9a25d4114a16e8f50b9eb58a263 /video/out/opengl/video.c
parent3dc0f2ecf033718a3a5d4b7acc41d144839fb7dc (diff)
downloadmpv-03bbaad686432b6f98c8bfc45206aea55ebe7ebc.tar.bz2
mpv-03bbaad686432b6f98c8bfc45206aea55ebe7ebc.tar.xz
vo_opengl: fix 10-bit video prescaling
The nnedi3 prescaler requires a normalized range to work properly, but the original implementation did the range normalization after the first step of the first pass. This could lead to severe quality degradation when debanding is not enabled for NNEDI3. Fix this issue by passing `tex_mul` into the shader code. Fixes #2464
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 14ad3dee79..5ed831bfe5 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -1210,20 +1210,17 @@ static void pass_prescale(struct gl_video *p, int src_tex_num, int dst_tex_num,
switch(p->opts.prescale) {
case 1:
pass_superxbr(p->sc, planes, tex_num, step,
- p->opts.superxbr_opts, &transform);
+ tex_mul, p->opts.superxbr_opts, &transform);
break;
case 2:
pass_nnedi3(p->gl, p->sc, planes, tex_num, step,
- p->opts.nnedi3_opts, &transform);
+ tex_mul, p->opts.nnedi3_opts, &transform);
break;
default:
abort();
}
- if (tex_mul != 1.0) {
- GLSLF("color *= %f;\n", tex_mul);
- tex_mul = 1.0;
- }
+ tex_mul = 1.0;
gl_transform_trans(transform, offset);