Commit 101a3c06 authored by jm's avatar jm

fixed potential problems with float rounding causing NaNs


git-svn-id: http://svn.xiph.org/trunk/speex@10822 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent a150da0b
......@@ -205,6 +205,8 @@ void open_loop_nbest_pitch(spx_sig_t *sw, int start, int end, int len, int *pitc
{
/* Update energy for next pitch*/
energy[i-start+1] = SUB32(ADD32(energy[i-start],SHR32(MULT16_16(swn[-i-1],swn[-i-1]),6)), SHR32(MULT16_16(swn[-i+len-1],swn[-i+len-1]),6));
if (energy[i-start+1] < 0)
energy[i-start+1] = 0;
}
pitch_xcorr(swn, swn-end, corr, len, end-start+1, stack);
......
......@@ -248,7 +248,7 @@ float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float p
qual-=0.5*(log(3.0 + vbr->consec_noise)-log(3));
if (qual<0)
qual=0;
qual += .3*log(ener/60000.0);
qual += .3*log(.0001+ener/60000.0);
}
if (qual<-1)
qual=-1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment