From 521110054d89f5066549288092fd945968dd4d50 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Jan 2016 21:46:01 +0100 Subject: vo_opengl: add tscale-interpolates-only sub-option --- DOCS/interface-changes.rst | 1 + DOCS/man/vo.rst | 4 ++++ video/out/opengl/video.c | 8 +++++++- video/out/opengl/video.h | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 956798889e..bc6a9fd53f 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -28,6 +28,7 @@ Interface changes - VO opengl custom shaders must now use "sample_pixel" as function name, instead of "sample" - change VO opengl scaler-resizes-only default to enabled + - add VO opengl "tscale-interpolates-only" suboption --- mpv 0.15.0 --- - change "yadif" video filter defaults --- mpv 0.14.0 --- diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index 96ba0049ca..027e2dfb1f 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -549,6 +549,10 @@ Available video output drivers are: manifest themselves as short flashes or fringes of black, mostly around moving edges) in exchange for potentially adding more blur. + ``tscale-interpolates-only=`` + If set, then don't perform interpolation if the playback rate matches + the the display refresh rate (default: yes). + ``dscale-radius``, ``cscale-radius``, ``tscale-radius``, etc. Set filter parameters for ``dscale``, ``cscale`` and ``tscale``, respectively. diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 8a23b2570b..c646a6306a 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -338,6 +338,7 @@ const struct gl_video_opts gl_video_opts_def = { .clamp = 1, }, // tscale }, .scaler_resizes_only = 1, + .tscale_interpolates_only = 1, .scaler_lut_size = 6, .alpha_mode = 3, .background = {0, 0, 0, 255}, @@ -363,6 +364,7 @@ const struct gl_video_opts gl_video_opts_hq_def = { .clamp = 1, }, // tscale }, .scaler_resizes_only = 1, + .tscale_interpolates_only = 1, .scaler_lut_size = 6, .alpha_mode = 3, .background = {0, 0, 0, 255}, @@ -406,6 +408,7 @@ const struct m_sub_options gl_video_conf = { SCALER_OPTS("tscale", 3), OPT_INTRANGE("scaler-lut-size", scaler_lut_size, 0, 4, 10), OPT_FLAG("scaler-resizes-only", scaler_resizes_only, 0), + OPT_FLAG("tscale-interpolates-only", tscale_interpolates_only, 0), OPT_FLAG("linear-scaling", linear_scaling, 0), OPT_FLAG("correct-downscaling", correct_downscaling, 0), OPT_FLAG("sigmoid-upscaling", sigmoid_upscaling, 0), @@ -2182,8 +2185,11 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, int fbo) if (has_frame) { gl_sc_set_vao(p->sc, &p->vao); + bool same_rate = !(frame->repeat || frame->num_vsyncs > 1); + if (p->opts.interpolation && frame->display_synced && - (p->frames_drawn || !frame->still)) + (p->frames_drawn || !frame->still) && + (!same_rate || !p->opts.tscale_interpolates_only)) { gl_video_interpolate_frame(p, frame, fbo); } else { diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h index 5c9262a97a..ea6981705c 100644 --- a/video/out/opengl/video.h +++ b/video/out/opengl/video.h @@ -83,6 +83,7 @@ struct gl_video_opts { float sigmoid_center; float sigmoid_slope; int scaler_resizes_only; + int tscale_interpolates_only; int pbo; int dither_depth; int dither_algo; -- cgit v1.2.3