diff options
author | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
commit | 6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch) | |
tree | 91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /contrib/extractor/libmpq/huffman.h | |
parent | 2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff) | |
parent | f385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'contrib/extractor/libmpq/huffman.h')
-rw-r--r-- | contrib/extractor/libmpq/huffman.h | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/contrib/extractor/libmpq/huffman.h b/contrib/extractor/libmpq/huffman.h index 1f8eae54eb4..cce32dd6718 100644 --- a/contrib/extractor/libmpq/huffman.h +++ b/contrib/extractor/libmpq/huffman.h @@ -27,32 +27,32 @@ #ifndef _HUFFMAN_H #define _HUFFMAN_H -#define PTR_NOT(ptr) (struct huffman_tree_item *)(~(unsigned long)(ptr)) -#define PTR_PTR(ptr) ((struct huffman_tree_item *)(ptr)) -#define PTR_INT(ptr) (long)(ptr) +#define PTR_NOT(ptr) (struct huffman_tree_item *)(~(unsigned long)(ptr)) +#define PTR_PTR(ptr) ((struct huffman_tree_item *)(ptr)) +#define PTR_INT(ptr) (long)(ptr) -#define INSERT_ITEM 1 -#define SWITCH_ITEMS 2 /* Switch the item1 and item2 */ +#define INSERT_ITEM 1 +#define SWITCH_ITEMS 2 /* Switch the item1 and item2 */ /* * Input stream for Huffmann decompression */ struct huffman_input_stream { - unsigned char *in_buf; /* 00 - Input data */ - unsigned long bit_buf; /* 04 - Input bit buffer */ - unsigned int bits; /* 08 - Number of bits remaining in 'byte' */ + unsigned char *in_buf; /* 00 - Input data */ + unsigned long bit_buf; /* 04 - Input bit buffer */ + unsigned int bits; /* 08 - Number of bits remaining in 'byte' */ }; /* * Huffmann tree item. */ struct huffman_tree_item { - struct huffman_tree_item *next; /* 00 - Pointer to next huffman_tree_item */ - struct huffman_tree_item *prev; /* 04 - Pointer to prev huffman_tree_item (< 0 if none) */ - unsigned long dcmp_byte; /* 08 - Index of this item in item pointer array, decompressed byte value */ - unsigned long byte_value; /* 0C - Some byte value */ - struct huffman_tree_item *parent; /* 10 - Pointer to parent huffman_tree_item (NULL if none) */ - struct huffman_tree_item *child; /* 14 - Pointer to child huffman_tree_item */ + struct huffman_tree_item *next; /* 00 - Pointer to next huffman_tree_item */ + struct huffman_tree_item *prev; /* 04 - Pointer to prev huffman_tree_item (< 0 if none) */ + unsigned long dcmp_byte; /* 08 - Index of this item in item pointer array, decompressed byte value */ + unsigned long byte_value; /* 0C - Some byte value */ + struct huffman_tree_item *parent; /* 10 - Pointer to parent huffman_tree_item (NULL if none) */ + struct huffman_tree_item *child; /* 14 - Pointer to child huffman_tree_item */ }; /* @@ -66,40 +66,40 @@ struct huffman_tree_item { * directly stores output byte to output stream. */ struct huffman_decompress { - unsigned long offs00; /* 00 - 1 if resolved */ - unsigned long bits; /* 04 - Bit count */ - union { - unsigned long dcmp_byte; /* 08 - Byte value for decompress (if bitCount <= 7) */ - struct huffman_tree_item *p_item; /* 08 - THTreeItem (if number of bits is greater than 7 */ - }; + unsigned long offs00; /* 00 - 1 if resolved */ + unsigned long bits; /* 04 - Bit count */ + union { + unsigned long dcmp_byte; /* 08 - Byte value for decompress (if bitCount <= 7) */ + struct huffman_tree_item *p_item; /* 08 - THTreeItem (if number of bits is greater than 7 */ + }; }; /* * Structure for Huffman tree. */ struct huffman_tree { - unsigned long cmp0; /* 0000 - 1 if compression type 0 */ - unsigned long offs0004; /* 0004 - Some flag */ + unsigned long cmp0; /* 0000 - 1 if compression type 0 */ + unsigned long offs0004; /* 0004 - Some flag */ - struct huffman_tree_item items0008[0x203]; /* 0008 - huffman tree items */ + struct huffman_tree_item items0008[0x203]; /* 0008 - huffman tree items */ - /* Sometimes used as huffman tree item */ - struct huffman_tree_item *item3050; /* 3050 - Always NULL (?) */ - struct huffman_tree_item *item3054; /* 3054 - Pointer to huffman_tree_item */ - struct huffman_tree_item *item3058; /* 3058 - Pointer to huffman_tree_item (< 0 if invalid) */ + /* Sometimes used as huffman tree item */ + struct huffman_tree_item *item3050; /* 3050 - Always NULL (?) */ + struct huffman_tree_item *item3054; /* 3054 - Pointer to huffman_tree_item */ + struct huffman_tree_item *item3058; /* 3058 - Pointer to huffman_tree_item (< 0 if invalid) */ - /* Sometimes used as huffman tree item */ - struct huffman_tree_item *item305C; /* 305C - Usually NULL */ - struct huffman_tree_item *first; /* 3060 - Pointer to top (first) Huffman tree item */ - struct huffman_tree_item *last; /* 3064 - Pointer to bottom (last) Huffman tree item (< 0 if invalid) */ - unsigned long items; /* 3068 - Number of used huffman tree items */ + /* Sometimes used as huffman tree item */ + struct huffman_tree_item *item305C; /* 305C - Usually NULL */ + struct huffman_tree_item *first; /* 3060 - Pointer to top (first) Huffman tree item */ + struct huffman_tree_item *last; /* 3064 - Pointer to bottom (last) Huffman tree item (< 0 if invalid) */ + unsigned long items; /* 3068 - Number of used huffman tree items */ - struct huffman_tree_item *items306C[0x102]; /* 306C - huffman_tree_item pointer array */ - struct huffman_decompress qd3474[0x80]; /* 3474 - Array for quick decompression */ + struct huffman_tree_item *items306C[0x102]; /* 306C - huffman_tree_item pointer array */ + struct huffman_decompress qd3474[0x80]; /* 3474 - Array for quick decompression */ - //unsigned char table1502A630[]; /* Some table to make struct size flexible */ + //unsigned char table1502A630[]; /* Some table to make struct size flexible */ }; int libmpq_huff_init_tree(struct huffman_tree *ht, struct huffman_tree_item *hi, unsigned int cmp); int libmpq_huff_do_decompress(struct huffman_tree *ht, struct huffman_input_stream *is, unsigned char *out_buf, unsigned int out_length); -#endif /* _HUFFMAN_H */ +#endif /* _HUFFMAN_H */ |