From cd9761651fdc6e1d2bbb59750ac855024e5f8c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 13 Oct 2024 19:48:57 +0200 Subject: [PATCH] filter_kernels: explain origin of LanczosSharp(est) filters --- DOCS/man/options.rst | 7 ++++++- video/out/filter_kernels.c | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 9ba83bf26e..0cda62f3c5 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -5482,7 +5482,9 @@ them. ``ewa_lanczossharp`` A slightly sharpened version of ``ewa_lanczos``. This is the default - when using the ``high-quality`` profile. + when using the ``high-quality`` profile. Blur value determined by method + originally developed by Nicolas Robidoux for Image Magick, see: + https://www.imagemagick.org/discourse-server/viewtopic.php?p=89068#p89068 ``ewa_lanczos4sharpest`` Very sharp scaler, but also slightly slower than ``ewa_lanczossharp``. @@ -5490,6 +5492,9 @@ them. anti-ringing shader. On ``--vo=gpu-next``, setting this filter enables built-in anti-ringing, so no extra action needs to be taken. + For more details, see: + https://www.imagemagick.org/discourse-server/viewtopic.php?p=128587#p128587 + ``mitchell`` Mitchell-Netravali. Piecewise cubic filter with a support of radius 2.0. Provides a balanced compromise of all scaling artifacts. This filter has diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c index 7a319a979a..d5f46fbb08 100644 --- a/video/out/filter_kernels.c +++ b/video/out/filter_kernels.c @@ -368,12 +368,15 @@ const struct filter_kernel mp_filter_kernels[] = { // See {{SCALER_EWA_GINSENG, JINC_R3, jinc, .resizable = true}, .polar = true, .window = WINDOW_SINC}, // Slightly sharpened to minimize the 1D step response error (to better - // preserve horizontal/vertical lines) + // preserve horizontal/vertical lines). Blur value determined by method + // originally developed by Nicolas Robidoux for Image Magick, see: + // {{SCALER_EWA_LANCZOSSHARP, JINC_R3, jinc, .blur = 0.9812505837223707, .resizable = true}, .polar = true, .window = WINDOW_JINC}, // Similar to the above, but sharpened substantially to the point of // minimizing the total impulse response error on an integer grid. Tends - // to preserve hash patterns well. Very sharp but rings a lot. + // to preserve hash patterns well. Very sharp but rings a lot. See: + // {{SCALER_EWA_LANCZOS4SHARPEST, JINC_R4, jinc, .blur = 0.8845120932605005, .resizable = true}, .polar = true, .window = WINDOW_JINC}, // Similar to the above, but softened instead, to make even/odd integer