diff options
author | Niklas Haas <git@haasn.dev> | 2023-09-16 13:25:28 +0200 |
---|---|---|
committer | Niklas Haas <github-daiK1o@haasn.dev> | 2023-09-16 14:33:45 +0200 |
commit | 93ff7554acbf40d309b9464f6fa86d3e758527b0 (patch) | |
tree | eb6d92ebb3b6dec7438614a60f71a555ce907862 /video | |
parent | 2ec79f8bb71b013af795a85f018417fbd28e8763 (diff) | |
download | mpv-93ff7554acbf40d309b9464f6fa86d3e758527b0.tar.bz2 mpv-93ff7554acbf40d309b9464f6fa86d3e758527b0.tar.xz |
filter_kernels: refine ewa_lanczossharp/soft constants
Replaced by mathematically and numerically precise constants, the result
of exact computation. Also updates the description to provide more
explanation and motivation.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/filter_kernels.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c index 9a9d7ae46c..78413bc35e 100644 --- a/video/out/filter_kernels.c +++ b/video/out/filter_kernels.c @@ -378,13 +378,13 @@ const struct filter_kernel mp_filter_kernels[] = { {{"ewa_lanczos", JINC_R3, jinc, .resizable = true}, .polar = true, .window = "jinc"}, {{"ewa_hanning", JINC_R3, jinc, .resizable = true}, .polar = true, .window = "hanning" }, {{"ewa_ginseng", JINC_R3, jinc, .resizable = true}, .polar = true, .window = "sinc"}, - // Radius is based on the true jinc radius, slightly sharpened as per - // calculations by Nicolas Robidoux. Source: Imagemagick's magick/resize.c - {{"ewa_lanczossharp", JINC_R3, jinc, .blur = 0.9812505644269356, .resizable = true}, + // Slightly sharpened to minimize the 1D step response error (to better + // preserve horizontal/vertical lines) + {{"ewa_lanczossharp", JINC_R3, jinc, .blur = 0.9812505837223707, .resizable = true}, .polar = true, .window = "jinc"}, - // Similar to the above, but softened instead. This one makes hash patterns - // disappear completely. Blur determined by trial and error. - {{"ewa_lanczossoft", JINC_R3, jinc, .blur = 1.015, .resizable = true}, + // Similar to the above, but softened instead, to make even/odd integer + // contributions exactly symmetrical. Designed to smooth out hash patterns. + {{"ewa_lanczossoft", JINC_R3, jinc, .blur = 1.0164667662867047, .resizable = true}, .polar = true, .window = "jinc"}, // Very soft (blurred) hanning-windowed jinc; removes almost all aliasing. // Blur parameter picked to match orthogonal and diagonal contributions |