diff options
author | Chris Robinson <[email protected]> | 2015-11-05 09:42:08 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2015-11-05 09:42:08 -0800 |
commit | b9e192b78a384ff13d87c606502373725042509c (patch) | |
tree | e5b99bba51f713e2f671b9ffbc37b22a1cdf5ba1 /Alc/mixer_defs.h | |
parent | dce3d0c7bf8f68c0dc4d98870f9e8119742004c0 (diff) |
Implement a band-limited sinc resampler
This is essentially a 12-point sinc resampler, unless it's resampling to a rate
higher than the output, at which point it will vary between 12 and 24 points
and do anti-aliasing to avoid/reduce frequencies going over nyquist.
Code provided by Christopher Fitzgerald.
Diffstat (limited to 'Alc/mixer_defs.h')
-rw-r--r-- | Alc/mixer_defs.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Alc/mixer_defs.h b/Alc/mixer_defs.h index 0989cce2..3c32278b 100644 --- a/Alc/mixer_defs.h +++ b/Alc/mixer_defs.h @@ -12,11 +12,12 @@ struct HrtfParams; struct HrtfState; /* C resamplers */ -const ALfloat *Resample_copy32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); -const ALfloat *Resample_point32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); -const ALfloat *Resample_lerp32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); -const ALfloat *Resample_fir4_32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); -const ALfloat *Resample_fir8_32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); +const ALfloat *Resample_copy32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); +const ALfloat *Resample_point32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); +const ALfloat *Resample_lerp32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); +const ALfloat *Resample_fir4_32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); +const ALfloat *Resample_fir8_32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); +const ALfloat *Resample_bsinc32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen); /* C mixers */ @@ -50,19 +51,22 @@ inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *frac_a } } -const ALfloat *Resample_lerp32_SSE2(const ALfloat *src, ALuint frac, ALuint increment, +const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *src, ALuint frac, + ALuint increment, ALfloat *restrict dst, ALuint dstlen); + +const ALfloat *Resample_lerp32_SSE2(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint numsamples); -const ALfloat *Resample_lerp32_SSE41(const ALfloat *src, ALuint frac, ALuint increment, +const ALfloat *Resample_lerp32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint numsamples); -const ALfloat *Resample_fir4_32_SSE3(const ALfloat *src, ALuint frac, ALuint increment, +const ALfloat *Resample_fir4_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint numsamples); -const ALfloat *Resample_fir4_32_SSE41(const ALfloat *src, ALuint frac, ALuint increment, +const ALfloat *Resample_fir4_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint numsamples); -const ALfloat *Resample_fir8_32_SSE3(const ALfloat *src, ALuint frac, ALuint increment, +const ALfloat *Resample_fir8_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint numsamples); -const ALfloat *Resample_fir8_32_SSE41(const ALfloat *src, ALuint frac, ALuint increment, +const ALfloat *Resample_fir8_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint numsamples); /* Neon mixers */ |