diff options
author | Chris Robinson <[email protected]> | 2018-03-21 09:01:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-03-21 09:01:32 -0700 |
commit | 22a7bcd5ad448bf3021931e0d9ca6b59a5b90c04 (patch) | |
tree | 7a4898aa2ffb85fbd5570aa21dd2a8cbf2bd425b /Alc | |
parent | ecc51c8c55f01e961bd2e82f8c408ce3c5a525d4 (diff) |
Avoid placing a 2K sample buffer on the stack
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/effects/pshifter.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Alc/effects/pshifter.c b/Alc/effects/pshifter.c index a9921028..a0cf4f45 100644 --- a/Alc/effects/pshifter.c +++ b/Alc/effects/pshifter.c @@ -49,9 +49,6 @@ typedef struct ALFrequencyDomain { typedef struct ALpshifterState { DERIVE_FROM_TYPE(ALeffectState); - /* Effect gains for each channel */ - ALfloat Gain[MAX_OUTPUT_CHANNELS]; - /* Effect parameters */ ALsizei count; ALsizei STFT_size; @@ -73,6 +70,11 @@ typedef struct ALpshifterState { ALfrequencyDomain Analysis_buffer[MAX_SIZE]; ALfrequencyDomain Syntesis_buffer[MAX_SIZE]; + + ALfloat BufferOut[BUFFERSIZE]; + + /* Effect gains for each output channel */ + ALfloat Gain[MAX_OUTPUT_CHANNELS]; } ALpshifterState; static ALvoid ALpshifterState_Destruct(ALpshifterState *state); @@ -256,9 +258,9 @@ static ALvoid ALpshifterState_process(ALpshifterState *state, ALsizei SamplesToD * http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/ */ + ALfloat *restrict bufferOut = state->BufferOut; ALsizei i, j, k, STFT_half_size; ALfloat freq_bin, expected, tmp; - ALfloat bufferOut[BUFFERSIZE]; ALphasor component; STFT_half_size = state->STFT_size >> 1; |