2
|
1
|
|
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(int *index, /* (i) the value to split */
|
|
17 int *firstpart, /* (o) the value specified by most
|
|
18 significant bits */
|
|
19 int *rest, /* (o) the value specified by least
|
|
20 significant bits */
|
|
21 int bitno_firstpart, /* (i) number of bits in most
|
|
22 significant part */
|
|
23 int bitno_total /* (i) number of bits in full range
|
|
24 of value */
|
|
25 );
|
|
26
|
|
27 void packcombine(int *index, /* (i/o) the msb value in the
|
|
28 combined value out */
|
|
29 int rest, /* (i) the lsb value */
|
|
30 int bitno_rest /* (i) the number of bits in the
|
|
31 lsb part */
|
|
32 );
|
|
33
|
|
34 void dopack(unsigned char **bitstream, /* (i/o) on entrance pointer to
|
|
35 place in bitstream to pack
|
|
36 new data, on exit pointer
|
|
37 to place in bitstream to
|
|
38 pack future data */
|
|
39 int index, /* (i) the value to pack */
|
|
40 int bitno, /* (i) the number of bits that the
|
|
41 value will fit within */
|
|
42 int *pos /* (i/o) write position in the
|
|
43 current byte */
|
|
44 );
|
|
45
|
|
46
|
|
47
|
|
48
|
|
49
|
|
50 void unpack(unsigned char **bitstream, /* (i/o) on entrance pointer to
|
|
51 place in bitstream to
|
|
52 unpack new data from, on
|
|
53 exit pointer to place in
|
|
54 bitstream to unpack future
|
|
55 data from */
|
|
56 int *index, /* (o) resulting value */
|
|
57 int bitno, /* (i) number of bits used to
|
|
58 represent the value */
|
|
59 int *pos /* (i/o) read position in the
|
|
60 current byte */
|
|
61 );
|
|
62
|
|
63 #endif
|