1 | /* |
---|
2 | lzw.h |
---|
3 | |
---|
4 | Original version: Ed McCreight: 19 Feb 90 |
---|
5 | Edit History: |
---|
6 | Ed McCreight: 23 Feb 90 |
---|
7 | End Edit History. |
---|
8 | |
---|
9 | Lempel-Ziv-Welch filters |
---|
10 | */ |
---|
11 | |
---|
12 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
---|
13 | * |
---|
14 | * The LZW compression method is said to be the subject of patents |
---|
15 | * owned by the Unisys Corporation. For further information, consult |
---|
16 | * the PostScript Language Reference Manual, second edition |
---|
17 | * (Addison Wesley, 1990, ISBN 0-201-18127-4). |
---|
18 | * |
---|
19 | * This source code is provided to you by Adobe on a non-exclusive, |
---|
20 | * royalty-free basis to facilitate your development of PostScript |
---|
21 | * language programs. You may incorporate it into your software as is |
---|
22 | * or modified, provided that you include the following copyright |
---|
23 | * notice with every copy of your software containing any portion of |
---|
24 | * this source code. |
---|
25 | * |
---|
26 | * Copyright 1990-91 Adobe Systems Incorporated. All Rights Reserved. |
---|
27 | * |
---|
28 | * Adobe does not warrant or guarantee that this source code will |
---|
29 | * perform in any manner. You alone assume any risks and |
---|
30 | * responsibilities associated with implementing, using or |
---|
31 | * incorporating this source code into your software. |
---|
32 | * |
---|
33 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
---|
34 | |
---|
35 | #ifndef LZW_H |
---|
36 | |
---|
37 | #define LZW_H |
---|
38 | |
---|
39 | #ifndef CHKSYNCH |
---|
40 | #define CHKSYNCH 0 /* for debugging */ |
---|
41 | #endif /* CHKSYNCH */ |
---|
42 | #define SYNCHPAT 0x0C |
---|
43 | #define SYNCHLEN 4 |
---|
44 | |
---|
45 | #define LZWMAXCODE 4096 /* codes */ |
---|
46 | #define LZWMINCODELEN 9 /* bits */ |
---|
47 | #define LZWMAXCODELEN 12 /* bits */ |
---|
48 | |
---|
49 | /* This LZW coding is intended to be identical to the TIFF 5.0 spec. |
---|
50 | |
---|
51 | Codes 0 - 255 represent their literal byte values |
---|
52 | Code 256 is the "Clear" code |
---|
53 | Code 257 is the "EOD" code |
---|
54 | Codes >=258 represent multi-byte sequences |
---|
55 | */ |
---|
56 | #define LZW_CLEAR 256 |
---|
57 | #define LZW_EOD 257 |
---|
58 | #define NLITCODES 258 |
---|
59 | |
---|
60 | typedef struct _t_LZWCodeRec |
---|
61 | { |
---|
62 | unsigned short prevCodeWord; |
---|
63 | unsigned char finalChar; |
---|
64 | unsigned char seqLen; |
---|
65 | /* 0 means undefined, |
---|
66 | 1 means special code (LZW_CLEAR, LZW_EOD), |
---|
67 | 2 means length 1, |
---|
68 | 3 means length 2, |
---|
69 | ..., |
---|
70 | 255 means length 254 or longer |
---|
71 | */ |
---|
72 | } |
---|
73 | LZWCodeRec, * LZWCode; |
---|
74 | |
---|
75 | #endif /* LZW_H */ |
---|
76 | |
---|