summaryrefslogtreecommitdiffstats
path: root/video/out/filter_kernels.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/filter_kernels.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/filter_kernels.c')
-rw-r--r--video/out/filter_kernels.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c
index c8efbe5731..66116ce18b 100644
--- a/video/out/filter_kernels.c
+++ b/video/out/filter_kernels.c
@@ -56,6 +56,8 @@ const struct filter_kernel *mp_find_filter_kernel(const char *name)
bool mp_init_filter(struct filter_kernel *filter, const int *sizes,
double inv_scale)
{
+ if (filter->radius < 0)
+ filter->radius = 2.0;
// only downscaling requires widening the filter
filter->inv_scale = inv_scale >= 1.0 ? inv_scale : 1.0;
double support = filter->radius * filter->inv_scale;
@@ -294,11 +296,14 @@ const struct filter_kernel mp_filter_kernels[] = {
{"sinc2", 2, sinc},
{"sinc3", 3, sinc},
{"sinc4", 4, sinc},
+ {"sinc", -1, sinc},
{"lanczos2", 2, lanczos},
{"lanczos3", 3, lanczos},
{"lanczos4", 4, lanczos},
+ {"lanczos", -1, lanczos},
{"blackman2", 2, blackman},
{"blackman3", 3, blackman},
{"blackman4", 4, blackman},
+ {"blackman", -1, blackman},
{0}
};