libg722_1  0.0.1
bitstream.h File Reference

Go to the source code of this file.

Functions

void g722_1_bitstream_put (g722_1_bitstream_state_t *s, uint8_t **c, uint32_t value, int bits)
 Put a chunk of bits into the output buffer.
uint32_t g722_1_bitstream_get (g722_1_bitstream_state_t *s, const uint8_t **c, int bits)
 Get a chunk of bits from the input buffer.
void g722_1_bitstream_flush (g722_1_bitstream_state_t *s, uint8_t **c)
 Flush any residual bit to the output buffer.
g722_1_bitstream_state_tg722_1_bitstream_init (g722_1_bitstream_state_t *s)
 Initialise a bitstream context.

Detailed Description


Function Documentation

void g722_1_bitstream_flush ( g722_1_bitstream_state_t s,
uint8_t **  c 
)

Flush any residual bit to the output buffer.

Parameters:
sA pointer to the bitstream context.
cA pointer to the bitstream output buffer.

References g722_1_bitstream_state_t::bitstream, and g722_1_bitstream_state_t::residue.

uint32_t g722_1_bitstream_get ( g722_1_bitstream_state_t s,
const uint8_t **  c,
int  bits 
)

Get a chunk of bits from the input buffer.

Parameters:
sA pointer to the bitstream context.
cA pointer to the bitstream input buffer.
bitsThe number of bits of value to be grabbed. 1 to 32 bits is valid.
Returns:
The value retrieved from the input buffer.

References g722_1_bitstream_state_t::bitstream, and g722_1_bitstream_state_t::residue.

Initialise a bitstream context.

Parameters:
sA pointer to the bitstream context.
Returns:
A pointer to the bitstream context.

References g722_1_bitstream_state_t::bitstream, and g722_1_bitstream_state_t::residue.

Referenced by g722_1_decode(), and g722_1_fillin().

void g722_1_bitstream_put ( g722_1_bitstream_state_t s,
uint8_t **  c,
uint32_t  value,
int  bits 
)

Put a chunk of bits into the output buffer.

Parameters:
sA pointer to the bitstream context.
cA pointer to the bitstream output buffer.
valueThe value to be pushed into the output buffer.
bitsThe number of bits of value to be pushed. 1 to 32 bits is valid.

References g722_1_bitstream_state_t::bitstream, and g722_1_bitstream_state_t::residue.