diff options
-rw-r--r-- | al/state.cpp | 7 | ||||
-rw-r--r-- | alc/alu.cpp | 8 | ||||
-rw-r--r-- | alc/alu.h | 2 | ||||
-rw-r--r-- | alc/converter.cpp | 4 | ||||
-rw-r--r-- | alc/mixvoice.cpp | 7 | ||||
-rw-r--r-- | alsoftrc.sample | 6 | ||||
-rw-r--r-- | utils/alsoft-config/mainwindow.cpp | 2 |
7 files changed, 26 insertions, 10 deletions
diff --git a/al/state.cpp b/al/state.cpp index 8f456ed3..d426f022 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -63,7 +63,9 @@ constexpr ALchar alErrOutOfMemory[] = "Out of Memory"; constexpr ALchar alPointResampler[] = "Nearest"; constexpr ALchar alLinearResampler[] = "Linear"; constexpr ALchar alCubicResampler[] = "Cubic"; +constexpr ALchar alFastBSinc12Resampler[] = "11th order Sinc (fast)"; constexpr ALchar alBSinc12Resampler[] = "11th order Sinc"; +constexpr ALchar alFastBSinc24Resampler[] = "23rd order Sinc (fast)"; constexpr ALchar alBSinc24Resampler[] = "23rd order Sinc"; } // namespace @@ -798,8 +800,9 @@ START_API_FUNC { const char *ResamplerNames[] = { alPointResampler, alLinearResampler, - alCubicResampler, alBSinc12Resampler, - alBSinc24Resampler, + alCubicResampler, alFastBSinc12Resampler, + alBSinc12Resampler, alFastBSinc24Resampler, + alBSinc24Resampler }; static_assert(al::size(ResamplerNames) == static_cast<ALuint>(Resampler::Max)+1, "Incorrect ResamplerNames list"); diff --git a/alc/alu.cpp b/alc/alu.cpp index 86d2789e..5df1c3a2 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -947,9 +947,9 @@ void CalcNonAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, cons voice->mStep = MAX_PITCH<<FRACTIONBITS; else voice->mStep = maxu(fastf2u(Pitch * FRACTIONONE), 1); - if(props->mResampler == Resampler::BSinc24) + if(props->mResampler == Resampler::BSinc24 || props->mResampler == Resampler::FastBSinc24) BsincPrepare(voice->mStep, &voice->mResampleState.bsinc, &bsinc24); - else if(props->mResampler == Resampler::BSinc12) + else if(props->mResampler == Resampler::BSinc12 || props->mResampler == Resampler::FastBSinc12) BsincPrepare(voice->mStep, &voice->mResampleState.bsinc, &bsinc12); voice->mResampler = SelectResampler(props->mResampler, voice->mStep); @@ -1277,9 +1277,9 @@ void CalcAttnSourceParams(ALvoice *voice, const ALvoicePropsBase *props, const A voice->mStep = MAX_PITCH<<FRACTIONBITS; else voice->mStep = maxu(fastf2u(Pitch * FRACTIONONE), 1); - if(props->mResampler == Resampler::BSinc24) + if(props->mResampler == Resampler::BSinc24 || props->mResampler == Resampler::FastBSinc24) BsincPrepare(voice->mStep, &voice->mResampleState.bsinc, &bsinc24); - else if(props->mResampler == Resampler::BSinc12) + else if(props->mResampler == Resampler::BSinc12 || props->mResampler == Resampler::FastBSinc12) BsincPrepare(voice->mStep, &voice->mResampleState.bsinc, &bsinc12); voice->mResampler = SelectResampler(props->mResampler, voice->mStep); @@ -46,7 +46,9 @@ enum class Resampler { Point, Linear, Cubic, + FastBSinc12, BSinc12, + FastBSinc24, BSinc24, Max = BSinc24 diff --git a/alc/converter.cpp b/alc/converter.cpp index b0efb839..aff1c353 100644 --- a/alc/converter.cpp +++ b/alc/converter.cpp @@ -167,9 +167,9 @@ SampleConverterPtr CreateSampleConverter(DevFmtType srcType, DevFmtType dstType, converter->mResample = Resample_<CopyTag,CTag>; else { - if(resampler == Resampler::BSinc24) + if(resampler == Resampler::BSinc24 || resampler == Resampler::FastBSinc24) BsincPrepare(converter->mIncrement, &converter->mState.bsinc, &bsinc24); - else if(resampler == Resampler::BSinc12) + else if(resampler == Resampler::BSinc12 || resampler == Resampler::FastBSinc12) BsincPrepare(converter->mIncrement, &converter->mState.bsinc, &bsinc12); converter->mResample = SelectResampler(resampler, converter->mIncrement); } 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_<FastBSincTag,NEONTag>; @@ -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()}; diff --git a/alsoftrc.sample b/alsoftrc.sample index 7cb780a3..de3ab6f3 100644 --- a/alsoftrc.sample +++ b/alsoftrc.sample @@ -161,14 +161,18 @@ #cf_level = 0 ## resampler: (global) -# Selects the resampler used when mixing sources. Valid values are: +# Selects the default resampler used when mixing sources. Valid values are: # point - nearest sample, no interpolation # linear - extrapolates samples using a linear slope between samples # cubic - extrapolates samples using a Catmull-Rom spline # bsinc12 - extrapolates samples using a band-limited Sinc filter (varying # between 12 and 24 points, with anti-aliasing) +# fast_bsinc12 - same as bsinc12, except without interpolation between down- +# sampling scales # bsinc24 - extrapolates samples using a band-limited Sinc filter (varying # between 24 and 48 points, with anti-aliasing) +# fast_bsinc24 - same as bsinc24, except without interpolation between down- +# sampling scales #resampler = linear ## rt-prio: (global) diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 7e5159cf..f4f5fd45 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -101,7 +101,9 @@ static const struct NameValuePair { { "Linear", "linear" }, { "Default (Linear)", "" }, { "Cubic Spline", "cubic" }, + { "11th order Sinc (fast)", "fast_bsinc12" }, { "11th order Sinc", "bsinc12" }, + { "23rd order Sinc (fast)", "fast_bsinc24" }, { "23rd order Sinc", "bsinc24" }, { "", "" } |