Hi,<br><br>I am trying to implement ogg vorbis real time decoder on SHARC ADSP 21364 processor. <br><br>I am writing my own version of the decoder using the documentation vorbis_I_spec.pdf from <a href="http://xiph.org">xiph.org
</a>. However I am facing certain hurdles in floor curve decoding during audio packet decode. In the spec it says that <br><br>[cval] = read from packet using codebook number [so and so] in <b>scalar context</b>.(page no 43). Now please tell me the following:
<br><br>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.
<br><br>2. Currently, to keep track of unused entries and to reduce memory usage we have adopted the bitpacking scheme of vorbis. For example:<br><br>...00010110 implies that entry numbers 1,2 and 4 are being used whereas the others are not.
<br>entry 1: codeword 0<br>entry 2: codeword 1<br>entry 4: codeword 2 and so on ..<br><br>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. 
<br>codeword 0 =&gt; output 0x01;<br>codeword 2 =&gt; output 0x04&nbsp; .. etc<br><br>Is this right?<br><br>Regards,<br>Sanjay<br>