I am coding with vorbis using mingw32 (g++ for win32 without the cygwin.dll dependency). mingw32's math library does not support rint and I can't find a replacement so I have tried the following: Use Cygwin to execute ./configure. Then: (1) "make" with Cygwin - ok. Cygwin supports rint. I encode my Aerosmith's "Get A Grip" .wav from the CD to .ogg with encoder_example.exe. grip.ogg file size is 5869034 bytes. Sounds good (2) "make" with mingw32 setting all occurrences of rint to "ceil". - ok. Encode Get A Grip .wav again and get a 6141038 byte .ogg. Sounds good. But why is it bigger now? (3) "make" with mingw32 setting all occurrences of rint to "floor". - ok. Encode Get A Grip .wav again and get a 5531747 byte .ogg. Some parts sound "off" - Now it is smaller too. So I have posted to the mingw32 mailing list looking for a new math library but I haven't found any responses yet (I have been unable to build the libm from newlib for mingw32). Any ideas on how I can get around calling rint and still get correct functionality and file size? Why do I have these differences? --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
>Any ideas on how I can get around calling rint and still get correct >functionality and file size? Why do I have these differences?You're changing the mathematics involved, so differences are to be expected. The solution is pretty simple - just do what is done for win32 (see os.h, I think) - we #define rint(x) floor((x) + 0.5) This is close enough for the purposes of vorbis - under certain rare circumstances, it can produce slightly different results, but we don't care about those. The win32 encoder still produces bit-identical results. Michael --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
Hi Don, I've got a set of Makefiles that will work for Mingw32. It's necessary to change the #ifdef's in a few header files (include/vorbis/os_types.h and lib/os.h). The problem is that gcc(mingw) != gcc(cygwin). I'll pack up my vorbis directory and email it to you. -Andy Key>I am coding with vorbis using mingw32 (g++ for win32 without the cygwin.dll >dependency). mingw32's math library does not support rint and I can't find >a replacement so I have tried the following:_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. Share information about yourself, create your own public profile at http://profiles.msn.com. --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/