From 8861bfa9137e9e4d637f0c681db5029bad7d9e74 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sat, 14 Mar 2020 17:58:02 +0200 Subject: vo_gpu: warn if correct-downscaling is ignored And document that it's ignored with bilinear scaler. --- DOCS/man/options.rst | 2 ++ video/out/gpu/video.c | 11 +++++++++++ 2 files changed, 13 insertions(+) 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) -- cgit v1.2.3