[Vorbis-dev] Doubts in codebook decoding

Sanjay Rajashekar sanjay.rajashekar at gmail.com
Tue Dec 11 09:04:28 PST 2007


Hi,

I am trying to implement ogg vorbis real time decoder on SHARC ADSP 21364
processor.

I am writing my own version of the decoder using the documentation
vorbis_I_spec.pdf from xiph.org. However I am facing certain hurdles in
floor curve decoding during audio packet decode. In the spec it says that

[cval] = read from packet using codebook number [so and so] in *scalar
context*.(page no 43). Now please tell me the following:

1. Vorbis uses an LSB bit packer. But to decode bit-by-bit from the
bitstream using the huffman decode tree we need the MSB of the codeword
first. How is this issue overcome in the reference implementation? I was not
able to understand what was going on from the reference implementation.

2. Currently, to keep track of unused entries and to reduce memory usage we
have adopted the bitpacking scheme of vorbis. For example:

...00010110 implies that entry numbers 1,2 and 4 are being used whereas the
others are not.
entry 1: codeword 0
entry 2: codeword 1
entry 4: codeword 2 and so on ..

This is done during setup. Later, during audio packet decode we are using
this information during scalar context reading from codebook. So while
reading from the audio packet and walking the huffman tree, if we encounter
codeword 0, then the output of the scalar context read is 0x01.
codeword 0 => output 0x01;
codeword 2 => output 0x04  .. etc

Is this right?

Regards,
Sanjay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20071211/bd72157a/attachment.htm


More information about the Vorbis-dev mailing list