summaryrefslogtreecommitdiffstats
path: root/video/out/gl_video.c
diff options
context:
space:
mode:
authorBin Jin <bjin1990@gmail.com>2014-08-26 00:41:30 +0200
committerwm4 <wm4@nowhere>2014-08-26 22:19:30 +0200
commitb3e788d3f462e4f8acaf4ea9bf0cb07f8d622c7c (patch)
tree90a3dd2782cf3b9e772f9cb6e6fa98d65c7f5989 /video/out/gl_video.c
parentf14722a40f46366e4333881ec5d540bca1400280 (diff)
downloadmpv-b3e788d3f462e4f8acaf4ea9bf0cb07f8d622c7c.tar.bz2
mpv-b3e788d3f462e4f8acaf4ea9bf0cb07f8d622c7c.tar.xz
vo_opengl: add radius options for filters
Add two new options, make it possible for user to set the radius for some of the filters with no fixed radius. Also add three new filters with the new radius parameter supported.
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r--video/out/gl_video.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 3478c8afcc..359013a6e6 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -289,6 +289,7 @@ static const struct gl_video_opts gl_video_opts_def = {
.scale_sep = 1,
.scalers = { "bilinear", "bilinear" },
.scaler_params = {{NAN, NAN}, {NAN, NAN}},
+ .scaler_radius = {NAN, NAN},
.alpha_mode = 2,
};
@@ -300,6 +301,7 @@ const struct gl_video_opts gl_video_opts_hq_def = {
.scale_sep = 1,
.scalers = { "spline36", "bilinear" },
.scaler_params = {{NAN, NAN}, {NAN, NAN}},
+ .scaler_radius = {NAN, NAN},
.alpha_mode = 2,
};
@@ -326,6 +328,8 @@ const struct m_sub_options gl_video_conf = {
OPT_FLOAT("lparam2", scaler_params[0][1], 0),
OPT_FLOAT("cparam1", scaler_params[1][0], 0),
OPT_FLOAT("cparam2", scaler_params[1][1], 0),
+ OPT_FLOATRANGE("lradius", scaler_radius[0], 0, 1.0, 8.0),
+ OPT_FLOATRANGE("cradius", scaler_radius[1], 0, 1.0, 8.0),
OPT_FLAG("scaler-resizes-only", scaler_resizes_only, 0),
OPT_FLAG("fancy-downscaling", fancy_downscaling, 0),
OPT_FLAG("indirect", indirect, 0),
@@ -1117,6 +1121,12 @@ static void init_scaler(struct gl_video *p, struct scaler *scaler)
scaler->kernel->params[n] = p->opts.scaler_params[scaler->index][n];
}
+ if (scaler->kernel->radius < 0) {
+ float radius = p->opts.scaler_radius[scaler->index];
+ if (!isnan(radius))
+ scaler->kernel->radius = radius;
+ }
+
update_scale_factor(p, scaler->kernel);
int size = scaler->kernel->size;