summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-02-23 19:06:18 +0100
committerNiklas Haas <git@nand.wakku.to>2015-02-23 19:06:18 +0100
commit36011c7f6dbda356d64af3866305a036044333fa (patch)
tree1498f8d35914c3bdd9c7f05210dc10052e9a5ce3
parent8161d621bbd9c094b01de6a716120c3e8cb6c4b1 (diff)
downloadmpv-36011c7f6dbda356d64af3866305a036044333fa.tar.bz2
mpv-36011c7f6dbda356d64af3866305a036044333fa.tar.xz
filter_kernels: add blur parameter to jinc
This affects all filters that use it, eg. ewa_lanczos. Setting it to something like 0.95 can be done to make the filter a bit less blurry.
-rw-r--r--DOCS/man/vo.rst6
-rw-r--r--video/out/filter_kernels.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst
index 7da0d2efff..4fdc0e26c7 100644
--- a/DOCS/man/vo.rst
+++ b/DOCS/man/vo.rst
@@ -340,6 +340,12 @@ Available video output drivers are:
Scale parameter (``t``). Increasing this makes the result blurrier.
Defaults to 1.
+ ``ewa_lanczos``, ``ewa_ginseng``, ``ewa_hanning``
+ Jinc function scaling factor (also known as a blur factor).
+ Decreasing this makes the result sharper, increasing it makes it
+ blurrier. Defaults to 1. Note that setting this too low (eg. 0.5)
+ leads to bad results. It's recommended to stay between 0.9 and 1.1.
+
``scale-radius=<r>``
Set radius for filters listed below, must be a float number between 1.0
and 16.0. Defaults to be 3.0 if not specified.
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c
index c49a8e113a..e6fa8aa24a 100644
--- a/video/out/filter_kernels.c
+++ b/video/out/filter_kernels.c
@@ -274,7 +274,7 @@ static double jinc(kernel *k, double x)
{
if (fabs(x) < 1e-8)
return 1.0;
- double pix = M_PI * x;
+ double pix = M_PI * x / k->params[0]; // blur factor
return 2.0 * j1(pix) / pix;
}
@@ -345,9 +345,9 @@ const struct filter_kernel mp_filter_kernels[] = {
{"spline64", 4, spline64},
{"gaussian", -1, gaussian, .params = {1.0, NAN} },
{"sinc", -1, sinc},
- {"ewa_lanczos", -1, ewa_lanczos, .polar = true},
- {"ewa_hanning", -1, ewa_hanning, .polar = true},
- {"ewa_ginseng", -1, ewa_ginseng, .polar = true},
+ {"ewa_lanczos", -1, ewa_lanczos, .params = {1.0, NAN}, .polar = true},
+ {"ewa_hanning", -1, ewa_hanning, .params = {1.0, NAN}, .polar = true},
+ {"ewa_ginseng", -1, ewa_ginseng, .params = {1.0, NAN}, .polar = true},
{"lanczos", -1, lanczos},
{"blackman", -1, blackman},
{0}