Fixed pitchEnd wrt to variable frame size. It should (sort of) all work now

This commit is contained in:
Jean-Marc Valin 2010-05-07 07:48:07 -04:00
parent ce4dd367c2
commit e949b72049
2 changed files with 3 additions and 3 deletions

View file

@ -227,7 +227,7 @@ int compute_pitch_gain(const CELTMode *m, const celt_sig *X, const celt_sig *P,
celt_word16 delta;
const int C = CHANNELS(_C);
celt_word32 Sxy=0, Sxx=0, Syy=0;
int len = m->pitchEnd;
int len = M*m->pitchEnd;
int N = M*m->eBands[m->nbEBands+1];
#ifdef FIXED_POINT
int shift = 0;
@ -319,7 +319,7 @@ void apply_pitch(const CELTMode *m, celt_sig *X, const celt_sig *P, int gain_id,
celt_word16 gain;
celt_word16 delta;
const int C = CHANNELS(_C);
int len = m->pitchEnd;
int len = M*m->pitchEnd;
N = M*m->eBands[m->nbEBands+1];
gain = ADD16(QCONST16(.5f,14), MULT16_16_16(QCONST16(.05f,14),gain_id));

View file

@ -343,7 +343,7 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
if (mode->eBands==NULL)
goto failure;
mode->pitchEnd = 4000*(celt_int32)frame_size/Fs;
mode->pitchEnd = 4000*(celt_int32)mode->shortMdctSize/Fs;
/* Overlap must be divisible by 4 */
if (mode->nbShortMdcts > 1)