http://bugs.winehq.org/show_bug.cgi?id=14717
--- Comment #15 from Alexander E. Patrakov patrakov@gmail.com 2010-11-24 00:26:58 CST --- I am currently at work, so cannot run-test the patch. Will do so at home. However, I can review the code.
The math is very understandable:
* Precalculate a windowed sinc filter that is sufficient for a 50x change in the sample rate.
* Calculate the step of the FIR, differently in the cases of upsampling and downsampling. Round it to an integer, this only affects the position of the transition in the frequency response.
* Interpolate the FIR linearly between the precalculated points, calculate the convolution in the simplest possible way (i.e., without any polyphase tricks that can speed up the process).
Questions:
1) Why is the sinc Kaiser-windowed? There are simpler windows that don't require calculation of modified Bessel functions.
2) Why are the start of the stopband and the transition width chosen this way? As far as I understand, this will lead to attenuation near the Nyquist frequency of worse than -6 dB (not checked, but guessed by the fact that the transition width is more than the distance between the start of the stopband and the Nyquist frequency).
3) Did you test your patch for security bugs like buffer overflows for certain stupid requests like "resample this from a 100 Hz buffer to a 192 kHz output buffer"?