Ogg Vorbis Decoder

Joerg Dietrich Dietrich_Joerg at t-online.de
Mon Jan 2 14:55:52 EST 2006


Hello,

attached is the result of another holiday season with the family,
sometimes you need to get out ;)
It is a working Ogg Vorbis Decoder. I have written it by myself based on
the codec framework of Stuart Dalton and of course idsoftware's work.
It uses libvorbisfile, libvorbis and libogg which are under a BSD
license. The Decoder uses the High Level API of vorbis : libvorbisfile.
This adds a little bit of overhead but only to the loading times.
While in game the streaming background music needs some CPU-time too.
Only one minor addition to existing code was neccessary :
The struct snd_stream_t in client/snd_codec.h now contains an additional
field "length" with the filesize of the compressed soundfile.
This length is obtained in S_CodecutilOpen() in client/snd_codec.c
from the function FS_FOpenFileRead().
I have tested this patch only on Linux on x86_32.
For this I have oggified the Demo-PAK and the programm itself :
encoded all WAVs as OGGs and replaced all calls to *.wav to *.ogg .
The resulting PAK is some 18 % smaller than the original.
The program runs flawless, there is no stutter in the sounds or the
background music. A framerate drop is not noticeable.
In the Makefile I have only added support for the Ogg Vorbis Decoder for
Linux. The maintainers of the other ports must define USE_CODEC_VORBIS
in the CFLAGS and link with libvorbisfile, libvorbis and libogg when
they want Ogg Vorbis. The whole decoder is optional. If you don't want
Ogg Vorbis support, undefine USE_CODEC_VORBIS in the Makefile.

Happy New Year!

Joerg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ogg_codec.patch.gz
Type: application/x-gzip
Size: 3772 bytes
Desc: not available
URL: <http://icculus.org/pipermail/quake3/attachments/20060102/df373aa2/attachment.gz>


More information about the quake3 mailing list