diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-02-20 07:31:22 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-20 16:21:46 +0100 |
commit | 885c2fff7091e9ea71cad8da56904ead73ca0853 (patch) | |
tree | fb49e2646f4af8dc4aadc3671d885923bff099a2 /video | |
parent | 4356e893a138e24f2d54dee2b96d2720e69d4c18 (diff) | |
download | mpv-885c2fff7091e9ea71cad8da56904ead73ca0853.tar.bz2 mpv-885c2fff7091e9ea71cad8da56904ead73ca0853.tar.xz |
vo_opengl: add ginseng upscaler
This is a variation of ewa_lanczos that is sinc-windowed instead of
jinc-windowed. Results are pretty similar, but the logic is simpler.
This could potentially replace the ugly ewa_lanczos code.
It's hard to tell, but from comparing stills I think this one has
slightly less ringing than regular ewa_lanczos.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/filter_kernels.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c index 77dbea57c0..b8a2e0d965 100644 --- a/video/out/filter_kernels.c +++ b/video/out/filter_kernels.c @@ -294,6 +294,16 @@ static double lanczos(kernel *k, double x) return radius * sin(pix) * sin(pix / radius) / (pix * pix); } +static double ginseng(kernel *k, double x) +{ + double radius = k->radius; + if (fabs(x) < 1e-8) + return 1.0; + if (fabs(x) >= radius) + return 0.0; + return jinc(k, x) * sinc(k, x / radius); +} + static double ewa_lanczos(kernel *k, double x) { double radius = k->radius; @@ -365,6 +375,7 @@ const struct filter_kernel mp_filter_kernels[] = { {"gaussian", -1, gaussian, .params = {28.85390081777927, NAN} }, {"sinc", -1, sinc}, {"ewa_lanczos", -1, ewa_lanczos, .polar = true}, + {"ginseng", -1, ginseng, .polar = true}, {"lanczos", -1, lanczos}, {"blackman", -1, blackman}, {0} |