I should have mentioned it together with a few more things, but I forgot :sweat_smile:
This is basically a C port of the default resampler from openal-soft. It's MUCH faster while not being much worse in theoretical quality compared to the old FIR resampler. In practice the old resampler had a couple of shortcomings that lowered the effective quality[*], so I don't think this is much a downgrade quality-wise.
Otherwise we could bring in the sinc resampler, which is theoretically very solid and still quite a bit faster than the old FIR resampler. It is sensibly slower than this one though, and slower than Windows 10 / 11 dsound's resampler. I'm not opposed to having it as an option; I did in fact try to make the surrounding code somewhat generic to facilitate that.
The SSE2 version gives about a 2x speedup for me. For the records it makes even more of a difference in openal-soft, most likely because we start running into performance limitations in our dsound outside of the resampler proper; I should have a few more patches to improve on that. The SSE2 version is effectively always enabled on (x86) 64-bit. To compile the SSE2 version on 32-bit you need to have `-msse2` in `i386_CFLAGS`, or some other option that includes it (e.g. the typical `-march=nocona` will do that).
[*]: The FIR resampler used a fixed Gaussian window instead of the parametrized Kaiser that's customarily used for audio resampling. That can introduce some aliasing or some distortion depending on the input signal. Additionally, the position computation (`total_fir_steps`, `rem`) using floats wasn't exact, which in turn caused some mid-high frequency distortion. In fact I had originally preserved it when porting the cubic resampler and I did see the same kind of distortion in the new output, so I ended up using fixed point for that, which is also what openal-soft does.