bitstream.c File Reference

#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "g722_1/g722_1.h"
#include "bitstream.h"

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:
s A pointer to the bitstream context.
c A 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:
s A pointer to the bitstream context.
c A pointer to the bitstream input buffer.
bits The 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.

g722_1_bitstream_state_t* g722_1_bitstream_init ( g722_1_bitstream_state_t s  ) 

Initialise a bitstream context.

Parameters:
s A 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:
s A pointer to the bitstream context.
c A pointer to the bitstream output buffer.
value The value to be pushed into the output buffer.
bits The 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.


Generated on 29 Mar 2018 for libg722_1 by  doxygen 1.6.1