summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-02-23 16:30:22 +0100
committerNiklas Haas <git@nand.wakku.to>2015-02-23 16:30:22 +0100
commitc2c96f9b10e24f9975814f9079943c92c5856b88 (patch)
tree9eb4a7b8833da9bbca3f4120ce739118f3e9d596
parentb17781bbc606d6323a1883b19a81ed41aa928699 (diff)
downloadmpv-c2c96f9b10e24f9975814f9079943c92c5856b88.tar.bz2
mpv-c2c96f9b10e24f9975814f9079943c92c5856b88.tar.xz
filter_kernels: add ewa_hanning
This is suggested in a thesis by Andreas Gustafsson, and seems to produce very a bit less ringing than lanczos at high radius.
-rw-r--r--video/out/filter_kernels.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c
index 11aed8e1c2..a498234c7d 100644
--- a/video/out/filter_kernels.c
+++ b/video/out/filter_kernels.c
@@ -313,6 +313,15 @@ static double ewa_lanczos(kernel *k, double x)
return jinc(k, x) * jinc(k, x * jinc_zero / radius);
}
+static double ewa_hanning(kernel *k, double x)
+{
+ double radius = k->radius;
+ if (fabs(x) >= radius)
+ return 0.0;
+ // Jinc windowed by the hanning window
+ return jinc(k, x) * hanning(k, x / radius);
+}
+
static double blackman(kernel *k, double x)
{
double radius = k->size / 2;
@@ -342,6 +351,7 @@ const struct filter_kernel mp_filter_kernels[] = {
{"gaussian", -1, gaussian, .params = {28.85390081777927, NAN} },
{"sinc", -1, sinc},
{"ewa_lanczos", -1, ewa_lanczos, .polar = true},
+ {"ewa_hanning", -1, ewa_hanning, .polar = true},
{"ginseng", -1, ginseng, .polar = true},
{"lanczos", -1, lanczos},
{"blackman", -1, blackman},