bitstream.h

Go to the documentation of this file.
00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * bitstream.h - Bitstream composition and decomposition routines.
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2006 Steve Underwood
00009  *
00010  * All rights reserved.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License version 2, as
00014  * published by the Free Software Foundation.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00024  *
00025  * $Id: bitstream.h,v 1.6 2007/04/08 08:16:17 steveu Exp $
00026  */
00027 
00028 /*! \file */
00029 
00030 #if !defined(_SPANDSP_BITSTREAM_H_)
00031 #define _SPANDSP_BITSTREAM_H_
00032 
00033 /*! \page bitstream_page Bitstream composition and decomposition
00034 \section bitstream_page_sec_1 What does it do?
00035 
00036 \section bitstream_page_sec_2 How does it work?
00037 */
00038 
00039 typedef struct
00040 {
00041     unsigned int bitstream;
00042     unsigned int residue;
00043 } bitstream_state_t;
00044 
00045 
00046 #if defined(__cplusplus)
00047 extern "C"
00048 {
00049 #endif
00050 
00051 bitstream_state_t *bitstream_init(bitstream_state_t *s);
00052 
00053 void bitstream_put(bitstream_state_t *s, uint8_t **c, unsigned int value, int bits);
00054 
00055 void bitstream_flush(bitstream_state_t *s, uint8_t **c);
00056 
00057 void bitstream_put2(bitstream_state_t *s, uint8_t **c, unsigned int value, int bits);
00058 
00059 void bitstream_flush2(bitstream_state_t *s, uint8_t **c);
00060 
00061 unsigned int bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits);
00062 
00063 unsigned int bitstream_get2(bitstream_state_t *s, const uint8_t **c, int bits);
00064 
00065 #if defined(__cplusplus)
00066 }
00067 #endif
00068 
00069 #endif
00070 /*- End of file ------------------------------------------------------------*/

Generated on Tue Jul 24 11:29:28 2007 for libspandsp by  doxygen 1.5.2