From 882b4acae80f41547a9e16b7def02a972842c857 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 28 Sep 2019 01:58:29 -0700 Subject: Add "fast" variants for the bsinc resamplers This simply omits the scale factor from the filter, similar to how up-sampling does. The consequence of this is less smooth transitions when ramping the pitch while down-sampling, but otherwise behaves fine. --- alc/mixvoice.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'alc/mixvoice.cpp') diff --git a/alc/mixvoice.cpp b/alc/mixvoice.cpp index 58a08ce3..e9e0d8df 100644 --- a/alc/mixvoice.cpp +++ b/alc/mixvoice.cpp @@ -161,6 +161,9 @@ ResamplerFunc SelectResampler(Resampler resampler, ALuint increment) case Resampler::BSinc24: if(increment <= FRACTIONONE) { + /* fall-through */ + case Resampler::FastBSinc12: + case Resampler::FastBSinc24: #ifdef HAVE_NEON if((CPUCapFlags&CPU_CAP_NEON)) return Resample_; @@ -191,7 +194,7 @@ void aluInitMixer() if(auto resopt = ConfigValueStr(nullptr, nullptr, "resampler")) { struct ResamplerEntry { - const char name[12]; + const char name[16]; const Resampler resampler; }; constexpr ResamplerEntry ResamplerList[]{ @@ -199,7 +202,9 @@ void aluInitMixer() { "point", Resampler::Point }, { "cubic", Resampler::Cubic }, { "bsinc12", Resampler::BSinc12 }, + { "fast_bsinc12", Resampler::FastBSinc12 }, { "bsinc24", Resampler::BSinc24 }, + { "fast_bsinc24", Resampler::FastBSinc24 }, }; const char *str{resopt->c_str()}; -- cgit v1.2.3