diff options
author | Chris Robinson <[email protected]> | 2017-08-27 10:16:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-08-27 10:16:36 -0700 |
commit | a4d357de06b3860f49f2f6f70899d825b920947b (patch) | |
tree | 3532665177753d3f6d6cb8a5c6a9b702a48d403a /OpenAL32/Include/alu.h | |
parent | 773d4664ff8f31837374164b64b992b86fcc80f7 (diff) |
Add a higher quality bsinc resampler using 24 sample points
This improves the transition width, allowing more of the higher frequencies
remain audible. It would be preferrable to have an upper limit of 32 points
instead of 48, to reduce the overall table size and the CPU cost for down-
sampling.
Diffstat (limited to 'OpenAL32/Include/alu.h')
-rw-r--r-- | OpenAL32/Include/alu.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index e5fd8b09..b322995b 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -24,16 +24,17 @@ #define MAX_PITCH (255) /* Maximum number of buffer samples before the current pos needed for resampling. */ -#define MAX_PRE_SAMPLES 12 +#define MAX_PRE_SAMPLES 24 /* Maximum number of buffer samples after the current pos needed for resampling. */ -#define MAX_POST_SAMPLES 12 +#define MAX_POST_SAMPLES 24 #ifdef __cplusplus extern "C" { #endif +struct BSincTable; struct ALsource; struct ALbufferlistitem; struct ALvoice; @@ -54,8 +55,9 @@ enum Resampler { LinearResampler, FIR4Resampler, BSinc12Resampler, + BSinc24Resampler, - ResamplerMax = BSinc12Resampler + ResamplerMax = BSinc24Resampler }; extern enum Resampler ResamplerDefault; @@ -91,13 +93,16 @@ typedef union InterpState { Sinc4State sinc4; } InterpState; -ALboolean BsincPrepare(const ALuint increment, BsincState *state); - typedef const ALfloat* (*ResamplerFunc)(const InterpState *state, const ALfloat *restrict src, ALsizei frac, ALint increment, ALfloat *restrict dst, ALsizei dstlen ); +ALboolean BsincPrepare(const ALuint increment, BsincState *state, const struct BSincTable *table); + +extern const struct BSincTable bsinc12; +extern const struct BSincTable bsinc24; + typedef union aluVector { alignas(16) ALfloat v[4]; |