From d27563cb14b9dc20f729470ef5e3d49ca869aebf Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Tue, 24 Feb 2015 00:52:17 +0100 Subject: [PATCH] filter_kernels: add ewa_lanczossharp alias This is essentially a preconfigured version of ewa_lanczos, with the "best" parameters for general purpose usage. --- DOCS/man/vo.rst | 12 ++++++++++-- video/out/filter_kernels.c | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst index 4fdc0e26c7..1fa23f02cd 100644 --- a/DOCS/man/vo.rst +++ b/DOCS/man/vo.rst @@ -310,12 +310,20 @@ Available video output drivers are: ``ewa_lanczos`` Elliptic weighted average Lanczos scaling. Also known as Jinc. - Relatively slow, but very good quality. The number of taps can - be controlled with ``scale-radius``. Adding extra taps makes the + Relatively slow, but very good quality. The radius can be + controlled with ``scale-radius``. Increasing the radius makes the filter sharper but adds more ringing. This filter supports antiringing (see ``scale-antiring``). + ``ewa_lanczossharp`` + A slightly sharpened version of ewa_lanczos, preconfigured to use + an ideal radius and parameter. If your hardware can run it, this is + probably what you should use by default. + + Note: This filter has a fixed radius. Use ``ewa_lanczos`` if you + want to adjust it. + ``mitchell`` Mitchell-Netravali. The ``B`` and ``C`` parameters can be set with ``scale-param1`` and ``scale-param2``. This filter is very good at diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c index e6fa8aa24a..c7c28466b0 100644 --- a/video/out/filter_kernels.c +++ b/video/out/filter_kernels.c @@ -348,6 +348,10 @@ const struct filter_kernel mp_filter_kernels[] = { {"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}, + // Radius is based on the true jinc radius, slightly sharpened as per + // calculations by Nicolas Robidoux. Source: Imagemagick's magick/resize.c + {"ewa_lanczossharp", 3.2383154841662362, ewa_lanczos, + .params = {0.9812505644269356, NAN}, .polar = true}, {"lanczos", -1, lanczos}, {"blackman", -1, blackman}, {0}