Skip to content

Commit

Permalink
rm DECODE_TABLE_WORKING_SPACE macro
Browse files Browse the repository at this point in the history
  • Loading branch information
maharmstone committed Mar 22, 2023
1 parent aeb5547 commit 8f2ed42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
7 changes: 0 additions & 7 deletions src/ebiggers/decompress_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,6 @@ read_huffsym(struct input_bitstream *is, const u16 decode_table[],
(max_codeword_len))] \
_aligned_attribute(DECODE_TABLE_ALIGNMENT)

/*
* Declare the temporary "working_space" array needed for building the decode
* table for a Huffman code.
*/
#define DECODE_TABLE_WORKING_SPACE(name, num_syms, max_codeword_len) \
u16 name[2 * ((max_codeword_len) + 1) + (num_syms)]

extern int
make_huffman_decode_table(u16 decode_table[], unsigned num_syms,
unsigned table_bits, const u8 lens[],
Expand Down
16 changes: 4 additions & 12 deletions src/ebiggers/lzx_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,10 @@ struct lzx_decompressor {
};

union {
DECODE_TABLE_WORKING_SPACE(maincode_working_space,
LZX_MAINCODE_MAX_NUM_SYMBOLS,
LZX_MAX_MAIN_CODEWORD_LEN);
DECODE_TABLE_WORKING_SPACE(lencode_working_space,
LZX_LENCODE_NUM_SYMBOLS,
LZX_MAX_LEN_CODEWORD_LEN);
DECODE_TABLE_WORKING_SPACE(alignedcode_working_space,
LZX_ALIGNEDCODE_NUM_SYMBOLS,
LZX_MAX_ALIGNED_CODEWORD_LEN);
DECODE_TABLE_WORKING_SPACE(precode_working_space,
LZX_PRECODE_NUM_SYMBOLS,
LZX_MAX_PRE_CODEWORD_LEN);
u16 maincode_working_space[2 * (LZX_MAX_MAIN_CODEWORD_LEN + 1) + LZX_MAINCODE_MAX_NUM_SYMBOLS];
u16 lencode_working_space[2 * (LZX_MAX_LEN_CODEWORD_LEN + 1) + LZX_LENCODE_NUM_SYMBOLS];
u16 alignedcode_working_space[2 * (LZX_MAX_ALIGNED_CODEWORD_LEN + 1) + LZX_ALIGNEDCODE_NUM_SYMBOLS];
u16 precode_working_space[2 * (LZX_MAX_PRE_CODEWORD_LEN + 1) + LZX_PRECODE_NUM_SYMBOLS];
};

unsigned window_order;
Expand Down
3 changes: 1 addition & 2 deletions src/ebiggers/xpress_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ struct xpress_decompressor {
XPRESS_TABLEBITS, XPRESS_MAX_CODEWORD_LEN);
u8 lens[XPRESS_NUM_SYMBOLS];
};
DECODE_TABLE_WORKING_SPACE(working_space, XPRESS_NUM_SYMBOLS,
XPRESS_MAX_CODEWORD_LEN);
u16 working_space[2 * (XPRESS_MAX_CODEWORD_LEN + 1) + XPRESS_NUM_SYMBOLS]
} _aligned_attribute(DECODE_TABLE_ALIGNMENT);

int
Expand Down

0 comments on commit 8f2ed42

Please sign in to comment.