bitstream.h

Go to the documentation of this file.
00001 /*
00002  * g722_1 - a library for the G.722.1 and Annex C codecs
00003  *
00004  * bitstream.h
00005  *
00006  * Copyright (C) 2006 Steve Underwood
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011  */
00012 
00013 /*! \file */
00014 
00015 #if !defined(_G722_1_BITSTREAM_H_)
00016 #define _G722_1_BITSTREAM_H_
00017 
00018 #if 0
00019 /*! Bitstream handler state */
00020 typedef struct
00021 {
00022     /*! The bit stream. */
00023     uint32_t bitstream;
00024     /*! The residual bits in bitstream. */
00025     int residue;
00026 } g722_1_bitstream_state_t;
00027 #endif
00028 
00029 #if defined(__cplusplus)
00030 extern "C"
00031 {
00032 #endif
00033 
00034 /*! \brief Put a chunk of bits into the output buffer.
00035     \param s A pointer to the bitstream context.
00036     \param c A pointer to the bitstream output buffer.
00037     \param value The value to be pushed into the output buffer.
00038     \param bits The number of bits of value to be pushed. 1 to 32 bits is valid. */
00039 void g722_1_bitstream_put(g722_1_bitstream_state_t *s, uint8_t **c, uint32_t value, int bits);
00040 
00041 /*! \brief Get a chunk of bits from the input buffer.
00042     \param s A pointer to the bitstream context.
00043     \param c A pointer to the bitstream input buffer.
00044     \param bits The number of bits of value to be grabbed. 1 to 32 bits is valid.
00045     \return The value retrieved from the input buffer. */
00046 uint32_t g722_1_bitstream_get(g722_1_bitstream_state_t *s, const uint8_t **c, int bits);
00047 
00048 /*! \brief Flush any residual bit to the output buffer.
00049     \param s A pointer to the bitstream context.
00050     \param c A pointer to the bitstream output buffer. */
00051 void g722_1_bitstream_flush(g722_1_bitstream_state_t *s, uint8_t **c);
00052 
00053 /*! \brief Initialise a bitstream context.
00054     \param s A pointer to the bitstream context.
00055     \return A pointer to the bitstream context. */
00056 g722_1_bitstream_state_t *g722_1_bitstream_init(g722_1_bitstream_state_t *s);
00057 
00058 #if defined(__cplusplus)
00059 }
00060 #endif
00061 
00062 #endif
00063 /*- End of file ------------------------------------------------------------*/

Generated on 29 Mar 2018 for libg722_1 by  doxygen 1.6.1