[vorbis-dev] read codebook function
Carsten Haese
carsten at xiph.org
Thu Feb 19 06:38:18 PST 2004
On Thu, 2004-02-19 at 09:22, Adriano Almeida wrote:
> Anexed is my function for reading codebooks and the Vq Table. My problem is:
> I read a codeBook number of 41, so i called this function above 41 times.
> The firtst time, the sync patterns (BCV) is alligned correctly, so it reads correctly. the sencond time it is executed, the patter is not there anymore and there are only 8 BCV in my file.
You seem to assume that codebooks always begin on byte boundaries. This
is not necessarily true, since the length of a codebook is not
necessarily a multiple of 8 bits. The first codebook will begin on a
byte boundary, and a few others might begin on a byte boundary simply by
coincidence, but in general a codebook can begin anywhere within a byte.
The sync pattern is not a 3 byte pattern. It's a 24 bit pattern that
should immediately follow the last *bit* of the previous codebook.
Hope this helps,
-Carsten
<p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list