[Vorbis-dev] Reg. vorbis for real-time audio

Ralph Giles giles at xiph.org
Fri Aug 26 12:22:00 PDT 2005

On Fri, Aug 26, 2005 at 01:35:21PM -0500, Shashank Khanvilkar wrote:

> 1. I guess the codebooks are derived from the actual input data. 
> Probably the encoder may be making two passes through the input. The 
> first pass finds out the frequency of different symbols and the second 
> pass just replaces these symbols with the codewords.

It's certainly possible to write a two-pass encoder, but the one in
libvorbis works in a single pass. The codebooks are tuned for general
audio across many test files during development, and fixed per release.
The encoder "chooses" a set of codebooks based on the target 
quality/bitrate and then just makes choices of which available mode
to use for each block on the fly, I think with a 3 block look-ahead.

So it's not adaptive in the usual sense in that the codebooks are 
fixed at the start. But emphasis on codebooks plural lets the 
encoder tailor mode choices from that fixed set to match particular
input data and so encode in a single pass.

Note that the look-ahead, and the generally long block sizes, and
the latency of the Ogg container itself make vorbis a poor choice
for interactive audio streams. But for "live" broadcast where a
few seconds delay is in fact normal, it works great.

Hope that helps,

More information about the Vorbis-dev mailing list