From 885c2fff7091e9ea71cad8da56904ead73ca0853 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 20 Feb 2015 07:31:22 +0100 Subject: 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. --- video/out/filter_kernels.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'video/out') 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} -- cgit v1.2.3