[vorbis-dev] Libvorbis suggestion & floating point exception
Jan Lellmann
Jan.Lellmann at web.de
Mon Sep 23 15:50:32 PDT 2002
Hello,
I'm not quite sure if this is the right list for my questions, please excuse
if it isn't.
1. While using vorbislib (Win2K/Borland C++ Builder 5), I'm getting
reproducible floating point exceptions at lots of sample rate/bit rate
combinations. For example, the original encoder_example.c, with just the
initialization line changed to
vorbis_encode_init(&vi,2,22050,48000,48000,48000);
generates a "floating point exception 0xc0000090" in psy.c /
bark_noise_hybridmp (line 642).
The code reads:
D = tN * tXX - tX * tX;
R = (A + fi * B) / D;
Before the crash, tXX and tX are both 0, thus D == 0. This causes a "divide
by zero".
As said, it is reproducible every single time. At higher sample rates it
works at 48kbps, but crashes at higher bit rates. I tested the 1.0 build
(static as well as the pre-built DLL from the distribution) and the CVS
snapshot, same result.
However, at 44.1kHz all bit rates seem to work.
Any ideas?
<p>2. In vorbisenc.c / vorbis_encode_setup_managed, there's a piece that reads:
if(nominal_bitrate<=0.){
if(max_bitrate>0.){
nominal_bitrate=max_bitrate*.875;
}else{ ...
If only min_bitrate and max_bitrate are passed, and nominal_bitrate set to
zero for "auto" mode, nominal_bitrate might actually end lower than
min_bitrate (e.g. if min_bitrate == max_bitrate for "CBR" emulation).
I think it should be something like:
if(nominal_bitrate<=0.){
if(max_bitrate>0.){
nominal_bitrate=max(min_bitrate, max_bitrate*.875);
}else{ ...
Greetings,
Jan
<p>--- >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-dev-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-dev
mailing list