Now using 8 bands for the pitch gain, with a 128-entry codebook.

This commit is contained in:
Jean-Marc Valin 2008-01-05 13:32:32 +11:00
parent a5431bfb09
commit 2875f6bf8d
4 changed files with 50 additions and 17 deletions

View file

@ -170,13 +170,21 @@ void compute_pitch_gain(const CELTMode *m, float *X, float *P, float *gains, flo
//gain = Sxy/(2*(pbank[i+1]-pbank[i]));
//if (i<3)
//gain *= 1+.02*gain;
if (gain > .90)
gain = .90;
if (gain < 0.0)
gain = 0.0;
if (gain > 1.f)
gain = 1.f;
if (gain < 0.0f)
gain = 0.0f;
/* We need to be a bit conservative, otherwise residual doesn't quantise well */
gain *= .9f;
gains[i] = gain;
//printf ("%f ", 1-sqrt(1-gain*gain));
}
/*if(rand()%10==0)
{
for (i=0;i<m->nbPBands;i++)
printf ("%f ", 1-sqrt(1-gains[i]*gains[i]));
printf ("\n");
}*/
for (i=B*pBands[m->nbPBands];i<B*pBands[m->nbPBands+1];i++)
P[i] = 0;
}