blob: cbb9f82dfd24411a2edc41c843b2f4f9ad046e23 [file] [log] [blame]
Benny Prijonoc5859882006-07-31 15:25:14 +00001
2 /******************************************************************
3
4 iLBC Speech Coder ANSI-C Source Code
5
6 packing.h
7
8 Copyright (C) The Internet Society (2004).
9 All Rights Reserved.
10
11 ******************************************************************/
12
13 #ifndef __PACKING_H
14 #define __PACKING_H
15
16 void packsplit(
17 int *index, /* (i) the value to split */
18 int *firstpart, /* (o) the value specified by most
19 significant bits */
20 int *rest, /* (o) the value specified by least
21 significant bits */
22 int bitno_firstpart, /* (i) number of bits in most
23 significant part */
24 int bitno_total /* (i) number of bits in full range
25 of value */
26 );
27
28 void packcombine(
29 int *index, /* (i/o) the msb value in the
30 combined value out */
31 int rest, /* (i) the lsb value */
32 int bitno_rest /* (i) the number of bits in the
33 lsb part */
34 );
35
36 void dopack(
37 unsigned char **bitstream, /* (i/o) on entrance pointer to
38 place in bitstream to pack
39 new data, on exit pointer
40 to place in bitstream to
41 pack future data */
42 int index, /* (i) the value to pack */
43 int bitno, /* (i) the number of bits that the
44 value will fit within */
45 int *pos /* (i/o) write position in the
46 current byte */
47 );
48
49
50
51
52
53 void unpack(
54 unsigned char **bitstream, /* (i/o) on entrance pointer to
55 place in bitstream to
56 unpack new data from, on
57 exit pointer to place in
58 bitstream to unpack future
59 data from */
60 int *index, /* (o) resulting value */
61 int bitno, /* (i) number of bits used to
62 represent the value */
63 int *pos /* (i/o) read position in the
64 current byte */
65 );
66
67 #endif
68