From 6765a7549bf5df25b2b8d9b9f8223e8d2b4c16d4 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 23 Feb 2015 18:20:06 +0100 Subject: 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. --- video/out/filter_kernels.c | 8 ++------ 1 file 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}, -- cgit v1.2.3