[Vorbis-dev] Query on Codewords length

Monty xiphmont at xiph.org
Wed Mar 30 23:21:59 PST 2005




On Thu, Mar 31, 2005 at 12:38:08PM +0530, valmick.guha at wipro.com wrote:
> We are porting the Ogg Vorbis fixed point decoder to a 24 bit fixed
> point precision processor. We are trying to reduce the number of cycles
> for MIPS optimization. In this process we observed that most of the
> songs do not have "maximum codeword length" greater than 24 bits.

Correct; you will be able to tell this from the codebooks in use when
loading the headers.

> I would like to know, what is the chance of getting a codeword of length
> greater than 24 bits in a song or for songs of different qualities while
> encoding? 

It is always possible that an encoder may decide to use codewords over
24 bits; this is not governed by anything ther than the encoder's
whim, that is, there is no aspect of a given mode, bitrate, or sample
rate that would disallow use of greater than 24 bit codewords.

That said, the liklihood of them being employed is admittedly fairly
low.

> The maximum possible codeword length being 32 bits, we are currently
> storing it in double word. If the likeliness of it occurring is very
> less then we plan to use only single word ( 24 bits ) operations for the
> Huffman decoding.

If it occurred and your decoder could not handle it, it would render
the entire file undecodable.

I agree that the optimization is a good one (Tremor's low-memory
version does something similar).  Hoever, there should also be
facility for supporting the occasional codebook using > 24 bit
codewords.

Monty


More information about the Vorbis-dev mailing list