packing.h

00001 /*
00002  * iLBC - a library for the iLBC codec
00003  *
00004  * packing.h - The iLBC low bit rate speech codec.
00005  *
00006  * Adapted by Steve Underwood <steveu@coppice.org> from the reference
00007  * iLBC code supplied in RFC3951.
00008  *
00009  * Original code Copyright (C) The Internet Society (2004).
00010  * All changes to produce this version Copyright (C) 2008 by Steve Underwood
00011  * All Rights Reserved.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  *
00017  * $Id: packing.h,v 1.2 2008/03/06 12:27:38 steveu Exp $
00018  */
00019 
00020 #ifndef __PACKING_H
00021 #define __PACKING_H
00022 
00023 void packsplit(int *index,              /* (i) the value to split */
00024                int *firstpart,          /* (o) the value specified by most
00025                                                significant bits */
00026                int *rest,               /* (o) the value specified by least
00027                                                significant bits */
00028                int bitno_firstpart,     /* (i) number of bits in most
00029                                                significant part */
00030                int bitno_total          /* (i) number of bits in full range
00031                                                of value */
00032 );
00033 
00034 void packcombine(int *index,            /* (i/o) the msb value in the combined value out */
00035                  int rest,              /* (i) the lsb value */
00036                  int bitno_rest);       /* (i) the number of bits in the lsb part */
00037 
00038 void dopack(uint8_t **bitstream,        /* (i/o) on entrance pointer to
00039                                                  place in bitstream to pack
00040                                                  new data, on exit pointer
00041                                                  to place in bitstream to
00042                                                  pack future data */
00043             int index,                  /* (i) the value to pack */
00044             int bitno,                  /* (i) the number of bits that the
00045                                                value will fit within */
00046             int *pos);                  /* (i/o) write position in the current byte */
00047 
00048 void unpack(const uint8_t **bitstream,  /* (i/o) on entrance pointer to
00049                                                  place in bitstream to
00050                                                  unpack new data from, on
00051                                                  exit pointer to place in
00052                                                  bitstream to unpack future
00053                                                  data from */
00054             int *index,                 /* (o) resulting value */
00055             int bitno,                  /* (i) number of bits used to
00056                                                represent the value */
00057             int *pos);                  /* (i/o) read position in the current byte */
00058 
00059 #endif

Generated on Sat May 23 12:24:23 2009 for libvoipcodecs by  doxygen 1.5.5