1 | | |
2 | | |
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
18 | | |
19 | | |
20 | | |
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
35 | | |
36 | | |
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
42 | | |
| | | #define GIF_LZW | | #ifdef GIF_LZW | typedef unsigned short lzwcode_t; | #else | typedef unsigned long lzwcode_t; | #endif | | struct lzw | { | unsigned long codes; | unsigned long bits; | unsigned long codebits; | unsigned long outlen,outpos,outbit; | unsigned char *out,lastout; | struct lzwc | { | unsigned char c; | lzwcode_t firstchild; | lzwcode_t next; | } *code; | lzwcode_t current,firstfree; | #ifndef GIF_LZW | unsigned long alloced; | #endif | }; | | #define LZWCNULL ((lzwcode_t)(~0)) | | void lzw_add(struct lzw *lzw,int c); | void lzw_quit(struct lzw *lzw); | void lzw_init(struct lzw *lzw,int bits); | unsigned long lzw_unpack(unsigned char *dest,unsigned long destlen, | unsigned char *src,unsigned long srclen, | int bits); | | | | | |
|