[vorbis] bark_noise
David Balazic
david.balazic at uni-mb.si
Thu Nov 9 04:55:57 PST 2000
Michael Smith wrote :
> At 11:23 AM 11/8/00 +0000, you wrote:
> >I would like to understand what is going on, I freely admit. Having no
> >signal processing knowledge means that looking at the code gives me
> >headaches 8-) I would, however, be more than happy to read any weighty
> >tomes if you could point me to any relevant ones.
> >
> >Given that the arrival time of beta 3 has been discussed in the past, I shall
> >refrain from asking. However, I would appreciate knowing how to fix this
> >particular problem so that I can move ahead and play with the alpha a bit
> >more ;-)
>
> I think the particular problem you were encountering has been fixed in CVS
> as of yesterday. Please try again.
>
> Short description: the code was converting some value to dB at one point.
> You can't do this (you get -INF) if the value is 0, so the code was using a
> large negative number instead. Too large.
>
> In the particular case it was being used in, anything negative got clipped
> to 0 about 2 lines later, so it didn't matter. The code now uses -400
> instead.
>
> There may be other problems, but I think they've all been cleared up - let
> us know (preferably with a backtrace of where things are dying) if anything
> else breaks.
>
> Michael
What are those problems with -INF and large negative numbers ?
AFAIK -INF is a valid value and the following code works
( almost ) as expected :
/* BEGIN PROGRAM */
#include <math.h>
#include <stdio.h>
int main()
{
double a;
a = log((double)0.0);
printf ("isinf : %d\n",isinf(a));
printf ("3.0/a : %e\n",3.0/a);
printf ("a : %e\n-----\n",a);
a=a+a;
printf ("isinf : %d\n",isinf(a));
printf ("3.0/a : %e\n",3.0/a);
printf ("a : %e\n=====\n=====\n",a);
a = HUGE_VAL;
printf ("isinf : %d\n",isinf(a));
printf ("3.0/a : %e\n",3.0/a);
printf ("a : %e\n-----\n",a);
a=a+a;
printf ("isinf : %d\n",isinf(a));
printf ("3.0/a : %e\n",3.0/a);
printf ("a : %e\n-----\n",a);
}
/* END PROGRAM */
The output on HP-UX 10.20 :
------------------------------------
isinf : 0
3.0/a : -1.668805e-308
a : -1.797693e+308
-----
isinf : -1
3.0/a : -0.000000e+00
a : -inf
=====
=====
isinf : 0
3.0/a : 1.668805e-308
a : 1.797693e+308
-----
isinf : 1
3.0/a : 0.000000e+00
a : inf
-----
------------------------------------
And on HP-UX 11.00 :
isinf : 1
3.0/a : -0.000000e+00
a : -inf
-----
isinf : 1
3.0/a : -0.000000e+00
a : -inf
=====
=====
isinf : 1
3.0/a : 0.000000e+00
a : inf
-----
isinf : 1
3.0/a : 0.000000e+00
a : inf
-----
--
David Balazic
--------------
"Be excellent to each other." - Bill & Ted
- - - - - - - - - - - - - - - - - - - - - -
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis
mailing list