diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2020-03-14 17:58:02 +0200 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2020-03-14 19:47:12 +0200 |
commit | 8861bfa9137e9e4d637f0c681db5029bad7d9e74 (patch) | |
tree | 507dbb5f7b090ced11169bf753328e1c003a9938 | |
parent | cb2b5553bfd87ef4a91f946b4ef123f9e0b522d1 (diff) | |
download | mpv-8861bfa9137e9e4d637f0c681db5029bad7d9e74.tar.bz2 mpv-8861bfa9137e9e4d637f0c681db5029bad7d9e74.tar.xz |
vo_gpu: warn if correct-downscaling is ignored
And document that it's ignored with bilinear scaler.
-rw-r--r-- | DOCS/man/options.rst | 2 | ||||
-rw-r--r-- | video/out/gpu/video.c | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index a91d01afd2..629ed4eabd 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4960,6 +4960,8 @@ The following video options are currently all specific to ``--vo=gpu`` and better than without it) since it will extend the size to match only the milder of the scale factors between the axes. + Note: this option is ignored when using bilinear downscaling (the default). + ``--linear-downscaling`` Scale in linear light when downscaling. It should only be used with a ``--fbo-format`` that has at least 16 bit precision. This option diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 3c06751959..539934fe67 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -292,6 +292,7 @@ struct gl_video { bool broken_frame; // temporary error state bool colorspace_override_warned; + bool correct_downscaling_warned; }; static const struct gl_video_opts gl_video_opts_def = { @@ -4022,6 +4023,16 @@ static void reinit_from_options(struct gl_video *p) "E.g.: --video-sync=display-resample\n"); p->dsi_warned = true; } + + if (p->opts.correct_downscaling && !p->correct_downscaling_warned) { + const char *name = p->opts.scaler[SCALER_DSCALE].kernel.name; + if (!name) + name = p->opts.scaler[SCALER_SCALE].kernel.name; + if (!name || !strcmp(name, "bilinear")) { + MP_WARN(p, "correct-downscaling requires non-bilinear scaler.\n"); + p->correct_downscaling_warned = true; + } + } } void gl_video_configure_queue(struct gl_video *p, struct vo *vo) |