libg722_1  0.0.1
bitstream.h
Go to the documentation of this file.
1 /*
2  * g722_1 - a library for the G.722.1 and Annex C codecs
3  *
4  * bitstream.h
5  *
6  * Copyright (C) 2006 Steve Underwood
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  */
12 
13 /*! \file */
14 
15 #if !defined(_G722_1_BITSTREAM_H_)
16 #define _G722_1_BITSTREAM_H_
17 
18 #if 0
19 /*! Bitstream handler state */
20 typedef struct
21 {
22  /*! The bit stream. */
23  uint32_t bitstream;
24  /*! The residual bits in bitstream. */
25  int residue;
27 #endif
28 
29 #if defined(__cplusplus)
30 extern "C"
31 {
32 #endif
33 
34 /*! \brief Put a chunk of bits into the output buffer.
35  \param s A pointer to the bitstream context.
36  \param c A pointer to the bitstream output buffer.
37  \param value The value to be pushed into the output buffer.
38  \param bits The number of bits of value to be pushed. 1 to 32 bits is valid. */
39 void g722_1_bitstream_put(g722_1_bitstream_state_t *s, uint8_t **c, uint32_t value, int bits);
40 
41 /*! \brief Get a chunk of bits from the input buffer.
42  \param s A pointer to the bitstream context.
43  \param c A pointer to the bitstream input buffer.
44  \param bits The number of bits of value to be grabbed. 1 to 32 bits is valid.
45  \return The value retrieved from the input buffer. */
46 uint32_t g722_1_bitstream_get(g722_1_bitstream_state_t *s, const uint8_t **c, int bits);
47 
48 /*! \brief Flush any residual bit to the output buffer.
49  \param s A pointer to the bitstream context.
50  \param c A pointer to the bitstream output buffer. */
52 
53 /*! \brief Initialise a bitstream context.
54  \param s A pointer to the bitstream context.
55  \return A pointer to the bitstream context. */
57 
58 #if defined(__cplusplus)
59 }
60 #endif
61 
62 #endif
63 /*- End of file ------------------------------------------------------------*/
void g722_1_bitstream_flush(g722_1_bitstream_state_t *s, uint8_t **c)
Flush any residual bit to the output buffer.
Definition: bitstream.c:92
Definition: g722_1/g722_1.h:50
g722_1_bitstream_state_t * g722_1_bitstream_init(g722_1_bitstream_state_t *s)
Initialise a bitstream context.
Definition: bitstream.c:102
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.
Definition: bitstream.c:27
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.
Definition: bitstream.c:55