summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-02-24 03:13:37 +0100
committerNiklas Haas <git@nand.wakku.to>2015-02-24 03:13:37 +0100
commita759028f67d27ce8d8d39505bcc24713b23067b1 (patch)
treef448cf9826dcf22f82394e41be49640327a9c7b8 /video
parentdc3c718b376dfdc2f3d0da9e7fee5efe0ca6840f (diff)
downloadmpv-a759028f67d27ce8d8d39505bcc24713b23067b1.tar.bz2
mpv-a759028f67d27ce8d8d39505bcc24713b23067b1.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/filter_kernels.c8
1 files changed, 5 insertions, 3 deletions
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},