void speex_bits_advance | ( | SpeexBits * | bits, | |
int | n | |||
) |
Advances the position of the "bit cursor" in the stream
bits | Bit-stream to operate on | |
n | Number of bits to advance |
void speex_bits_destroy | ( | SpeexBits * | bits | ) |
Frees all resources associated to a SpeexBits struct. Right now this does nothing since no resources are allocated, but this could change in the future.
void speex_bits_init | ( | SpeexBits * | bits | ) |
Initializes and allocates resources for a SpeexBits struct
void speex_bits_init_buffer | ( | SpeexBits * | bits, | |
void * | buff, | |||
int | buf_size | |||
) |
Initializes SpeexBits struct using a pre-allocated buffer
void speex_bits_insert_terminator | ( | SpeexBits * | bits | ) |
Insert a terminator so that the data can be sent as a packet while auto-detecting the number of frames in each packet
bits | Bit-stream to operate on |
int speex_bits_nbytes | ( | SpeexBits * | bits | ) |
Returns the number of bytes in the bit-stream, including the last one even if it is not "full"
bits | Bit-stream to operate on |
void speex_bits_pack | ( | SpeexBits * | bits, | |
int | data, | |||
int | nbBits | |||
) |
Append bits to the bit-stream
bits | Bit-stream to operate on | |
data | Value to append as integer | |
nbBits | number of bits to consider in "data" |
int speex_bits_peek | ( | SpeexBits * | bits | ) |
Get the value of the next bit in the stream, without modifying the "cursor" position
bits | Bit-stream to operate on |
unsigned int speex_bits_peek_unsigned | ( | SpeexBits * | bits, | |
int | nbBits | |||
) |
Same as speex_bits_unpack_unsigned, but without modifying the cursor position
bits | Bit-stream to operate on | |
nbBits | Number of bits to look for |
void speex_bits_read_from | ( | SpeexBits * | bits, | |
char * | bytes, | |||
int | len | |||
) |
Initializes the bit-stream from the data in an area of memory
void speex_bits_read_whole_bytes | ( | SpeexBits * | bits, | |
char * | bytes, | |||
int | len | |||
) |
Append bytes to the bit-stream
bits | Bit-stream to operate on | |
bytes | pointer to the bytes what will be appended | |
len | Number of bytes of append |
int speex_bits_remaining | ( | SpeexBits * | bits | ) |
Returns the number of bits remaining to be read in a stream
bits | Bit-stream to operate on |
void speex_bits_reset | ( | SpeexBits * | bits | ) |
Resets bits to initial value (just after initialization, erasing content)
void speex_bits_rewind | ( | SpeexBits * | bits | ) |
Rewind the bit-stream to the beginning (ready for read) without erasing the content
void speex_bits_set_bit_buffer | ( | SpeexBits * | bits, | |
void * | buff, | |||
int | buf_size | |||
) |
Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data)
int speex_bits_unpack_signed | ( | SpeexBits * | bits, | |
int | nbBits | |||
) |
Interpret the next bits in the bit-stream as a signed integer
bits | Bit-stream to operate on | |
nbBits | Number of bits to interpret |
unsigned int speex_bits_unpack_unsigned | ( | SpeexBits * | bits, | |
int | nbBits | |||
) |
Interpret the next bits in the bit-stream as an unsigned integer
bits | Bit-stream to operate on | |
nbBits | Number of bits to interpret |
int speex_bits_write | ( | SpeexBits * | bits, | |
char * | bytes, | |||
int | max_len | |||
) |
Write the content of a bit-stream to an area of memory
bits | Bit-stream to operate on | |
bytes | Memory location where to write the bits | |
max_len | Maximum number of bytes to write (i.e. size of the "bytes" buffer) |
int speex_bits_write_whole_bytes | ( | SpeexBits * | bits, | |
char * | bytes, | |||
int | max_len | |||
) |
Like speex_bits_write, but writes only the complete bytes in the stream. Also removes the written bytes from the stream