[Vorbis-dev] Vorbis bistream definition / separation from ogg

Ralph Giles giles at xiph.org
Thu Apr 28 10:43:09 PDT 2005


On Thu, Apr 28, 2005 at 11:21:37AM +0200, Nico Sabbi wrote:

> 1) in the sources of the encoder_example (and of course in oggenc.c, 
> too) I see a lot of dependance
> on ogg. I want to get totally rid of ogg and use the vorbis bitstream 
> alone.

Note also that the reference implementations uses libogg's bitpacking 
routines, so you need this dependency for the sake of the code even if 
you don't use the Ogg container. These are completely separate issues, 
though; the bitpacker is just abstracted into libogg for conveninence.

> 3) does vorbis always use a variable number of samples per frame? If so, 
> is there a way to know
> from every frame how many samples are used? Is there any disadvantage at 
> using a constant
> number of samples per frame (as in mpeg audio, aac, musepack and so on) ?

Unfortunately it is some work to get the number of samples per frame 
(packet in vorbis terminology). The two possibly lengths are given as a 
simple field in the info header, but which on a given data packet uses 
is looked up through a table from the setup header, using the mode 
number at the start of the packet as an index. So you have to do a fast 
parse of the setup header to be able to determine this without doing a 
full decode.

Hope that helps,
 -r


More information about the Vorbis-dev mailing list