ref: 8111a1eb5bcd11f01dd4fcea067d53b00c13d8a4
parent: ffd168da5e639f5ef9943d2cc8c8be202a1003b0
author: Chris Moeller <kode54@gmail.com>
date: Thu Apr 25 22:13:17 EDT 2013
Whoops, that was Blackman-Harris, not Lanczos. Lanczos produces less aliasing, anyway.
--- a/dumb/src/helpers/lanczos_resampler.c
+++ b/dumb/src/helpers/lanczos_resampler.c
@@ -33,7 +33,7 @@
cosine_lut[i] = (1.0 - cos(((double)(i) / COSINE_RESOLUTION) * M_PI)) * 0.5;
dx = (double)(LANCZOS_WIDTH) / LANCZOS_SAMPLES; x = 0.0;
for (i = 0; i < LANCZOS_SAMPLES; ++i, x += dx)
- lanczos_lut[i] = abs(x) < LANCZOS_WIDTH ? sinc(x) * (0.35875 + 0.48829 * cos((M_PI * x) / 3) + 0.14128 * cos((2 * M_PI * x) / 3) + 0.01168 * cos(M_PI * x)) : 0.0;
+ lanczos_lut[i] = abs(x) < LANCZOS_WIDTH ? sinc(x) * sinc(x / LANCZOS_WIDTH) : 0.0;
}
typedef struct lanczos_resampler