From a759028f67d27ce8d8d39505bcc24713b23067b1 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 24 Feb 2015 03:13:37 +0100 Subject: filter_kernels: rename bilinear_slow to triangle This is essentially what it is, and it's a useful for windowing or downscaling. For upscaling we already have bilinear, no need to cause extra confusion between biliner and bilinear_slow. Also made it a bit more well-behaved. --- video/out/filter_kernels.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'video/out/filter_kernels.c') diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c index 75b7b50b0d..084c7b85ae 100644 --- a/video/out/filter_kernels.c +++ b/video/out/filter_kernels.c @@ -132,9 +132,11 @@ static double nearest(kernel *k, double x) return x > 0.5 ? 0.0 : 1.0; } -static double bilinear(kernel *k, double x) +static double triangle(kernel *k, double x) { - return 1.0 - x; + if (fabs(x) > 1.0) + return 0.0; + return 1.0 - fabs(x); } static double hanning(kernel *k, double x) @@ -317,7 +319,7 @@ static double blackman(kernel *k, double x) const struct filter_kernel mp_filter_kernels[] = { {"nearest", 0.5, nearest}, - {"bilinear_slow", 1, bilinear}, + {"triangle", 1, triangle}, {"hanning", 1, hanning}, {"hamming", 1, hamming}, {"quadric", 1.5, quadric}, -- cgit v1.2.3