[Speex-dev] Getting SING errors
Jean-Marc Valin
jean-marc.valin at usherbrooke.ca
Mon Dec 12 18:16:55 PST 2005
Yes, that's definitely a bug in the vbr code, there's an easy fix for
that. Just replace:
qual += .3*log(ener/60000.0);
with
qual += .3*log((ener+1)/60000.0);
Jean-Marc
On Mon, 2005-12-12 at 18:06 -0800, Alex Bakaev wrote:
> Hello!
>
> I'm getting SING errors from the log() function. Here is the code
> inside the vbr_analysis() function.
>
> if (ener<60000)
> {
> if (vbr->consec_noise>2)
> qual-=0.5*(log(3.0 + vbr->consec_noise)-log(3));
> if (ener<10000&&vbr->consec_noise>2)
> qual-=0.5*(log(3.0 + vbr->consec_noise)-log(3));
> if (qual<0)
> qual=0;
> qual += .3*log(ener/60000.0);
> }
>
> Inspecting the values shows that 'ener' is zero, which leads to the
> error.
>
> The question I have is if the code above should explicitly be checking
> for zero? Or I have an issue with my compiler screwing something up?
>
> The error doesn't occur constantly, but frequently enough to be a huge
> nuissance.
>
> Thanks in advance,
> Alex
>
More information about the Speex-dev
mailing list