[Speex-dev] A question about speex_bits_write function

yaseminyilmaz yaseminyilmaz at aytor.com
Sat Dec 9 00:56:40 PST 2006

Hi everybody,

I need clarification about speex_bits_write function usage. There is an
example usage of it.

nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES);

I examine the content of this function and which value should I set to
MAX_FRAME_BYTE. In speexenc project, it is 2000 and in manual it is 200. For
example, I set it to 200 but the length of bits->chars is 250 (bits->nbBits
is 2000), is this right? If so, max_nchars gets 200 value because following
statement in speex_bits_write and the condition of if statement does not
achieve. (in my environment, BYTES_PER_CHAR=1, speex_nb_mode, 8 kHz, 15

int max_nchars = max_nbytes/BYTES_PER_CHAR;

if (max_nchars > ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR))

max_nchars = ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR);


Excuse me if I make longer my question. Which value should I set to

Can you please help me?

Thanks in advance




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20061209/68cecd1b/attachment.htm

More information about the Speex-dev mailing list