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 * $Id: bitstream.h,v 1.2 2008/10/17 13:18:21 steveu Exp $ 00013 */ 00014 00015 /*! \file */ 00016 00017 #if !defined(_G722_1_BITSTREAM_H_) 00018 #define _G722_1_BITSTREAM_H_ 00019 00020 #if 0 00021 /*! Bitstream handler state */ 00022 typedef struct 00023 { 00024 /*! The bit stream. */ 00025 uint32_t bitstream; 00026 /*! The residual bits in bitstream. */ 00027 int residue; 00028 } g722_1_bitstream_state_t; 00029 #endif 00030 00031 #if defined(__cplusplus) 00032 extern "C" 00033 { 00034 #endif 00035 00036 /*! \brief Put a chunk of bits into the output buffer. 00037 \param s A pointer to the bitstream context. 00038 \param c A pointer to the bitstream output buffer. 00039 \param value The value to be pushed into the output buffer. 00040 \param bits The number of bits of value to be pushed. 1 to 32 bits is valid. */ 00041 void g722_1_bitstream_put(g722_1_bitstream_state_t *s, uint8_t **c, uint32_t value, int bits); 00042 00043 /*! \brief Get a chunk of bits from the input buffer. 00044 \param s A pointer to the bitstream context. 00045 \param c A pointer to the bitstream input buffer. 00046 \param bits The number of bits of value to be grabbed. 1 to 32 bits is valid. 00047 \return The value retrieved from the input buffer. */ 00048 uint32_t g722_1_bitstream_get(g722_1_bitstream_state_t *s, const uint8_t **c, int bits); 00049 00050 /*! \brief Flush any residual bit to the output buffer. 00051 \param s A pointer to the bitstream context. 00052 \param c A pointer to the bitstream output buffer. */ 00053 void g722_1_bitstream_flush(g722_1_bitstream_state_t *s, uint8_t **c); 00054 00055 /*! \brief Initialise a bitstream context. 00056 \param s A pointer to the bitstream context. 00057 \return A pointer to the bitstream context. */ 00058 g722_1_bitstream_state_t *g722_1_bitstream_init(g722_1_bitstream_state_t *s); 00059 00060 #if defined(__cplusplus) 00061 } 00062 #endif 00063 00064 #endif 00065 /*- End of file ------------------------------------------------------------*/
1.6.1