diff options
author | Raulshc <[email protected]> | 2018-03-19 16:48:00 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2018-03-19 16:48:00 +0100 |
commit | c38854fe3d83034237c244f1b8564d7834db3ff8 (patch) | |
tree | 4fe6d62baafb2236ff7f055db4473b5d7e7538f0 /Alc/effects/pshifter.c | |
parent | 56423b9ef160aa4313f1db81da7197eb6a25efa8 (diff) |
EFX:Own size for pitch shifter buffers
Diffstat (limited to 'Alc/effects/pshifter.c')
-rw-r--r-- | Alc/effects/pshifter.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/Alc/effects/pshifter.c b/Alc/effects/pshifter.c index 1a2ddef7..2bf911f8 100644 --- a/Alc/effects/pshifter.c +++ b/Alc/effects/pshifter.c @@ -29,6 +29,7 @@ #include "alError.h"
#include "alu.h"
+#define MAX_SIZE 2048
typedef struct ALcomplex{
@@ -67,17 +68,17 @@ typedef struct ALpshifterState { ALfloat Frequency;
/*Effects buffers*/
- ALfloat InFIFO[BUFFERSIZE];
- ALfloat OutFIFO[BUFFERSIZE];
- ALfloat LastPhase[(BUFFERSIZE>>1) +1];
- ALfloat SumPhase[(BUFFERSIZE>>1) +1];
- ALfloat OutputAccum[BUFFERSIZE<<1];
- ALfloat window[BUFFERSIZE];
+ ALfloat InFIFO[MAX_SIZE];
+ ALfloat OutFIFO[MAX_SIZE];
+ ALfloat LastPhase[(MAX_SIZE>>1) +1];
+ ALfloat SumPhase[(MAX_SIZE>>1) +1];
+ ALfloat OutputAccum[MAX_SIZE<<1];
+ ALfloat window[MAX_SIZE];
- ALcomplex FFTbuffer[BUFFERSIZE];
+ ALcomplex FFTbuffer[MAX_SIZE];
- ALfrequencyDomain Analysis_buffer[BUFFERSIZE];
- ALfrequencyDomain Syntesis_buffer[BUFFERSIZE];
+ ALfrequencyDomain Analysis_buffer[MAX_SIZE];
+ ALfrequencyDomain Syntesis_buffer[MAX_SIZE];
} ALpshifterState;
@@ -102,20 +103,20 @@ static void ALpshifterState_Construct(ALpshifterState *state) SET_VTABLE2(ALpshifterState, ALeffectState, state);
/*Initializing parameters and set to zero the buffers */
- state->STFT_size = BUFFERSIZE>>1;
+ state->STFT_size = MAX_SIZE>>1;
state->oversamp = 1<<2;
state->step = state->STFT_size / state->oversamp ;
state->FIFOLatency = state->step * ( state->oversamp-1 );
state->count = state->FIFOLatency;
- memset(state->InFIFO, 0, BUFFERSIZE*sizeof(ALfloat));
- memset(state->OutFIFO, 0, BUFFERSIZE*sizeof(ALfloat));
- memset(state->FFTbuffer, 0, BUFFERSIZE*sizeof(ALcomplex));
- memset(state->LastPhase, 0, ((BUFFERSIZE>>1) +1)*sizeof(ALfloat));
- memset(state->SumPhase, 0, ((BUFFERSIZE>>1) +1)*sizeof(ALfloat));
- memset(state->OutputAccum, 0, (BUFFERSIZE<<1)*sizeof(ALfloat));
- memset(state->Analysis_buffer, 0, BUFFERSIZE*sizeof(ALfrequencyDomain));
+ memset(state->InFIFO, 0, MAX_SIZE*sizeof(ALfloat));
+ memset(state->OutFIFO, 0, MAX_SIZE*sizeof(ALfloat));
+ memset(state->FFTbuffer, 0, MAX_SIZE*sizeof(ALcomplex));
+ memset(state->LastPhase, 0, ((MAX_SIZE>>1) +1)*sizeof(ALfloat));
+ memset(state->SumPhase, 0, ((MAX_SIZE>>1) +1)*sizeof(ALfloat));
+ memset(state->OutputAccum, 0, (MAX_SIZE<<1)*sizeof(ALfloat));
+ memset(state->Analysis_buffer, 0, MAX_SIZE*sizeof(ALfrequencyDomain));
/* Create lockup table of the Hann window for the desired size, i.e. STFT_size */
for ( i = 0; i < state->STFT_size>>1 ; i++ )
|