[vorbis-dev] Delphi Header by Matthijs Laan vs RC3 = bitrates not working!

Matthijs Laan matthijsln at xs4all.nl
Mon Feb 11 07:08:24 PST 2002



[please start a new thread next time]

On Mon 11 Feb 2002 08:46:21, "John Zitterkopf" <zitt at bigfoot.com> wrote:

> With Matthijs' compiled libraries, I've been getting divide by zero
> errors in one of the DLLs (don't remember which one). But when it
> worked... it worked as expected... in that when I set a bitrate of say
> 160kbps; it would encode at near that bitrate (ie 177 - 150).

Yeah, those are my experiences too. Most songs work OK, but some songs 
discover this bug. Something I also can't explain is that the bitrates are 
relatively far from those produced by encoder_example - as I'm using nearly 
the same calls to the libraries.

I think all these problems have their source in how the DLL's are compiled. 
I now also see that I compiled ogg.dll and vcedit.dll _without_ using 
msvcrt.dll (aka the "Multithreaded DLL Code Generation" MSVC option) and 
the others are - this is clearly an error on my part.

For the divide by zero, this normally should not occur - but as MSVC apps 
usually disable exceptions (by default Delphi apps don't do that) I can't 
see whether or not it's a Xiph bug - but most likely that's not the case.

Anyway, for a quick and dirty fix you can insert this code before calling 
any library functions:

  asm 
        push    eax
        fnstcw  word ptr [esp]
        or      word ptr [esp], 111111b
        fldcw   word ptr [esp]
        add     esp, 4
  end;

This disables all FPU exceptions. It seems to produce correct files (I 
guess NaN's are handled correctly in the quantization or something - 
coincidence?).

> Hoping to fix the / by zero problems; I downloaded the RC3 SDK from
> www.vorbis.com , backed up the original DLLs, and replaced them with
> the one's in the RC3 SDK.
> 
> I re-ran CDMaster32... and encoded the same files which where giving me
> / zero errors. The encoded with no issues. <cool>
> 
> Then I looked at the files and they were ~10MBs... which is quite a bit
> bigger than I expected.
> 
> Upon checking the files with Winamp; all of them were encoded at over
> 300kbps. The Winamp plugin reports that the nominal bitrate is
> 160kps... but the average is over 300kbps.
>
> So... Would the API change discussed below be affecting me?
> I had assumed that the API was nearly finished and that backwards
> compatiblity wouldn't be broken.
> Did I assume incorrectly?

I think Michael explained this. I'll give a shot at compiling and testing 
some RC3 libraries with Delphi using the new API.

I'm very sorry about all these problems - although I'm not really sure to 
whatever these bugs are due.

Matthijs

--- >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