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 --- video/out/opengl/video.c | 8 +++++++- video/out/opengl/video.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'video') 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