[Vorbis-dev] Questions regarding OGG implementation on DSP

Dominik Kuhlen dkuhlen at gmx.net
Mon Jan 31 10:18:42 PST 2005


Hi!
On Monday 31 January 2005 13:06, Yuh-Chin Chang wrote:
> As to tremor fixed-point implementation, i got several questions, and
> hopefully some one can help me out. Thanks a lot!
>
> 1. For DSP chips with small and limited memory, how much memory do we
> really need for saving all codebooks before we start to decode audio
> packets? Can the bit-rate give us some clues? Is there some simple
> guidelines for this?
I just tried this:
download svn tremor version.
compiled and did 'make example' as well
ran:
 valgrind -v --tool=massif ./ivorbisfile_example < testfile.ogg > /dev/null
this has created a very nice "memory usage over time" diagram.
in my case the maximum memory usage was abt 140kByte.
ogginfo testfile.ogg shows:
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: Xiph.Org libVorbis I 20040629
Channels: 2
Rate: 44100

Nominal bitrate: 45.000000 kb/s
Upper bitrate not set
Lower bitrate not set
Vorbis stream 1:
        Total data length: 2236995 bytes
        Playback length: 6m:19s
        Average bitrate: 47.157508 kbps
Logical stream 1 ended

Well, ok, this (valgrind) works only on x86 platforms, 
but you'll get a feeling which part uses how much memory.

>
> 2. For CRC error protection, it seems to me that we need to get all the
> pages, compute the CRC, and then compare the result to the one for that
You need one page (i.e. header + all packets) for the crc check
> packet. That means a huge input buffer in some cases. So, ignoring the CRC
the reference encoder produces about 4kByte / page, but you cannot assume this is true in general.
see libogg: framing.c function ogg_stream_pageout (line ~449)
> words seems a reasonable compromise for portable devices, since it is
> anyway a error detection, not correction. We cannot do anything about it
> except skipping that packet. Is this assumption ok?
yes. But if you decode corrupted packets you will probably get some noise (sounds you don't want to) in your output.
the memory consumption for one page is much less than for the codebooks.
>
> 3. Any further information/papers/books about how Vorbis gets audio samples
> compressed? Well, the Vorbis I specification does give me some clues, but
> not very clear to me.
Feel free to ask questions :-) 
There's very few information about the encoder in written form (or am I wrong?)


BTW (a bit off topic):  
in "ivorbisfile_example.c" line 24+25 
#include <vorbis/ivorbiscodec.h>
#include <vorbis/ivorbisfile.h>
just before compiling a symbolic link is created: ln -fs . vorbis
why not changing the example lines to 
#include <tremor/ivorbiscodec.h>
#include <tremor/ivorbisfile.h>
and it will compile without "ln -fs"


Dominik


More information about the Vorbis-dev mailing list