[Vorbis-dev] Query in codebook decoding
sanjay.rajashekar at gmail.com
Tue Dec 11 22:12:29 PST 2007
Sorry for the wrong subject title last time. A little more clarification
When reading bit-by-bit, there is no MSb/LSb, just 'first bit' and
'last bit'. The Huffman tree is traversed from 'first bit' to last
bit'. This is a conceptual layer above the bitpacker; all you need to
know is what order the bits come out, which happens to be LSb-first.
For ex. say we have the following codewords in the codebook
entry 0: codeword0 - 00
entry 2: codeword1 - 0111
entry 6: codeword2 - 111
entry 7: codeword3 - 10
Now in the bitstream if there is [codeword0] followed by [codeword3]
followed by [codeword1], then will bitstream be
.... 0111 10 00 or will it be
.... 1110 01 00
If it is the second case, then we can traverse the tree as and when we get
the bits from from the bitstream. But if it is the first case, then how do
we do the decoding ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vorbis-dev