summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-01-20 20:56:40 +0100
committerNiklas Haas <git@nand.wakku.to>2015-01-22 19:40:04 +0100
commitf24c2e0f56fdcef9b14c4a2ed15c4e9e801bbeab (patch)
tree97d9d14985a5706a35003af3ba3f31c2ddfc06ad /video
parent2d182fdea0a068cbbbe88b575963cbb480444f31 (diff)
downloadmpv-f24c2e0f56fdcef9b14c4a2ed15c4e9e801bbeab.tar.bz2
mpv-f24c2e0f56fdcef9b14c4a2ed15c4e9e801bbeab.tar.xz
vo_opengl: always prefer indirect scaling
This is better even for non-separable. The only exception is when using bilinear for both lscale and cscale. I've fixed the documentation/comments to make more sense.
Diffstat (limited to 'video')
-rw-r--r--video/out/gl_video.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index ddccd3a3e5..4ab41d8076 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1194,11 +1194,7 @@ static void compile_shaders(struct gl_video *p)
shader_setup_scaler(&header_final, &p->scalers[0], -1);
}
- // We want to do scaling in linear light. Scaling is closely connected to
- // texture sampling due to how the shader is structured (or if GL bilinear
- // scaling is used). The purpose of the "indirect" pass is to convert the
- // input video to linear RGB.
- // Another purpose is reducing input to a single texture for scaling.
+ // The indirect pass is used to preprocess the image before scaling.
bool use_indirect = p->opts.indirect;
// Don't sample from input video textures before converting the input to
@@ -1206,15 +1202,10 @@ static void compile_shaders(struct gl_video *p)
if (use_input_gamma || use_conv_gamma || use_linear_light || use_const_luma)
use_indirect = true;
- // It doesn't make sense to scale the chroma with cscale in the 1. scale
- // step and with lscale in the 2. step. If the chroma is subsampled, a
- // convolution filter wouldn't even work entirely correctly, because the
- // luma scaler would sample two texels instead of one per tap for chroma.
- // Also, even with 4:4:4 YUV or planar RGB, the indirection might be faster,
- // because the shader can't use one scaler for sampling from 3 textures. It
- // has to fetch the coefficients for each texture separately, even though
- // they're the same (this is not an inherent restriction, but would require
- // to restructure the shader).
+ // If the video is subsampled, chroma information needs to be pulled up to
+ // the input size before scaling can be done. Even for 4:4:4 or planar RGB
+ // this is also faster because it means the scalers can operate on all
+ // channels simultaneously. Disabling scale_sep overrides this behavior.
if (p->opts.scale_sep && p->plane_count > 1)
use_indirect = true;