[speex-dev] speex_decode() doesn't empty buffer in u-wideband and quality 4

Jean-Marc Valin Jean-Marc.Valin at USherbrooke.ca
Sun Jan 4 01:05:42 PST 2004


Actually, the way it's done speex_bits_remaining() might return a
non-zero value if the number of bits in the stream is not a multiple of
8 (whole bytes). When you read the bytes, there's just no way to know
whether all of the bits in the last byte are used. The normal way to
know if you're at the end is to call speex_decode and look at the return
value. Otherwise, you'll need to check for number of bits remaining. If
it's < 5 bits, it's sure to be the end. Otherwise, you'll need to look
for a 01111 pattern (the terminator). speex_decode all does that for you
though.

        Jean-Marc

Le sam 27/12/2003 à 20:55, Bjoern Rasmussen a écrit :
> Hello there
> 
> I'm having trouble decoding speex frames when using 32KHz audio and quality 
> setting 4. If I encode three frames and then decode the three frames then 
> the speex_bits_remaining() still reports that there are bits remaining. All 
> other band modes and qualities reports that the buffer is emptied.
> 
> Here's an example that shows 4 bits remaing in the buffer after the frames 
> have been decoded: http://www.bearware.dk/temp/speex.c
> 
> Both Speex 1.0.3 and 1.1.3 reports that the buffer isn't emptied.
> 
> Best regards
> 
> Bjoern D. Rasmussen
> 
> _________________________________________________________________
> F alle de nye og sjove ikoner med MSN Messenger http://messenger.msn.dk
> 
> --- >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 'speex-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.

-- 
Jean-Marc Valin, M.Sc.A., ing. jr.
LABORIUS (http://www.gel.usherb.ca/laborius)
Université de Sherbrooke, Québec, Canada


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Ceci est une partie de message numériquement signée.
Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20040104/a5561cc3/signature-0001.pgp


More information about the Speex-dev mailing list