[vorbis-dev] Blocked encoding question

Michael Smith msmith at xiph.org
Thu Feb 13 02:38:04 PST 2003

On Thursday 13 February 2003 21:17, Ronald Bos wrote:
> Hello everybody,
> Since there is almost no documentation on the vorbis algorithm I have to
> post some questions on this list. To remind you: I am trying to implement a
> parallel (multithreaded) ogg encoder, using a manager-worker model.
> 1. About the vorbis algorithm. I plan to let the workers each process a
> buffer of vorbis_blocks. The point is that each worker has to start
> somewhere and can not use previous encoded blocks. A solution could be to
> let each worker start a (few) block(s) earlier to 'seed'/initialize the
> encoding process. Illustration:
> thread 1 |-----|
> thread 2     |-----|
> After encoding, I discard these overlapping blocks. Is this needed? Can
> someone shed his light on the dependency/correlation between the adjacent
> vorbis_blocks?

Be warned that block edges may not line up correctly (i.e. this may sometimes 
fail completely if you do it this way). Vorbis has two different block sizes, 
libvorbis will select between them dynamically. 

This (the fact that you can't easily predict where your block boundaries will 
actually lie prior to encoding) is the largest problem you're likely to 
encounter in trying to implement a threaded encoder.

One approach is to force the encoder to put block boundaries where you have 
assumed they will be (libvorbis doesn't support this in the external API, but 
it should be a relatively straightforward change). Note, however, that in 
some cases this will degrade audio quality quite significantly.

> 2. In general, is there more documentation on the vorbis encoding
> algorithm? This could be very useful in deciding if and how the encoding
> process can be made parallel. I know quite a few things about digital
> signal coding theory so don't be afraid to send me complex things.

There's extensive documentation of the format (in the source tarballs and on 
the website), but little in the way of formal documentation of the particular 
algorithms libvorbis 1.0 uses. However, the format by no means requires that 
those particular algorithms be used. There are some overviews (with some 
technical detail) that other peope have written, a web search should turn 
them up.


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