summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-02-23 18:20:06 +0100
committerNiklas Haas <git@nand.wakku.to>2015-02-23 18:20:06 +0100
commit6765a7549bf5df25b2b8d9b9f8223e8d2b4c16d4 (patch)
treecc332f7005407dc9713ff5de511dca1d75ba8bb7
parenta3733b53d3bd13d7bb03d8d9e2cb26899733bfc9 (diff)
downloadmpv-6765a7549bf5df25b2b8d9b9f8223e8d2b4c16d4.tar.bz2
mpv-6765a7549bf5df25b2b8d9b9f8223e8d2b4c16d4.tar.xz
filter_kernels: gaussian: redefine the parameter
Previously, this was based on some arbitrary range 1-100, cut off for no particular reason, and also defined in such a way that higher values = *less* smoothness. Since it wasn't multiplied by e in the code, the default had to be 10*e = 28.8539... Now, it's sane: 1.0 = default, higher = blurrier.
-rw-r--r--video/out/filter_kernels.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c
index b7769986e4..c49a8e113a 100644
--- a/video/out/filter_kernels.c
+++ b/video/out/filter_kernels.c
@@ -259,11 +259,7 @@ static double spline64(kernel *k, double x)
static double gaussian(kernel *k, double x)
{
double p = k->params[0];
- if (p > 100.0)
- p = 100.0;
- if (p < 1.0)
- p = 1.0;
- return pow(2.0, -(p / 10.0) * x * x);
+ return pow(2.0, -(M_E / p) * x * x);
}
static double sinc(kernel *k, double x)
@@ -347,7 +343,7 @@ const struct filter_kernel mp_filter_kernels[] = {
{"spline16", 2, spline16},
{"spline36", 3, spline36},
{"spline64", 4, spline64},
- {"gaussian", -1, gaussian, .params = {28.85390081777927, NAN} },
+ {"gaussian", -1, gaussian, .params = {1.0, NAN} },
{"sinc", -1, sinc},
{"ewa_lanczos", -1, ewa_lanczos, .polar = true},
{"ewa_hanning", -1, ewa_hanning, .polar = true},