filter_kernels: add ewa_hanning

This is suggested in a thesis by Andreas Gustafsson, and seems to
produce very a bit less ringing than lanczos at high radius.
This commit is contained in:
Niklas Haas 2015-02-23 16:30:22 +01:00
parent b17781bbc6
commit c2c96f9b10
No known key found for this signature in database
GPG Key ID: 3BA77D4BFDB10BCE
1 changed files with 10 additions and 0 deletions

View File

@ -313,6 +313,15 @@ static double ewa_lanczos(kernel *k, double x)
return jinc(k, x) * jinc(k, x * jinc_zero / radius);
}
static double ewa_hanning(kernel *k, double x)
{
double radius = k->radius;
if (fabs(x) >= radius)
return 0.0;
// Jinc windowed by the hanning window
return jinc(k, x) * hanning(k, x / radius);
}
static double blackman(kernel *k, double x)
{
double radius = k->size / 2;
@ -342,6 +351,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},
{"ewa_hanning", -1, ewa_hanning, .polar = true},
{"ginseng", -1, ginseng, .polar = true},
{"lanczos", -1, lanczos},
{"blackman", -1, blackman},