igzip: Use blind union to represent overlapped tables in hufftables_icf

Change-Id: I0260a705db81f4e7731d4d40757c5919be002e8f
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
This commit is contained in:
Roy Oursler 2018-12-14 09:25:12 -07:00
parent 342cae57fc
commit c0467e56d5
2 changed files with 12 additions and 3 deletions

View File

@ -23,7 +23,7 @@ struct deflate_icf *encode_deflate_icf_base(struct deflate_icf *next_in,
while (next_in < end_in && !is_full(bb)) {
lsym = hufftables->lit_len_table[next_in->lit_len];
dsym = hufftables->dist_table[next_in->lit_dist];
dsym = hufftables->dist_lit_table[next_in->lit_dist];
// insert ll code, dist_code, and extra_bits
write_bits_unsafe(bb, lsym.code_and_extra, lsym.length);

View File

@ -138,8 +138,17 @@ struct rl_code {
};
struct hufftables_icf {
struct huff_code dist_table[31];
struct huff_code lit_len_table[513];
union {
struct {
struct huff_code dist_lit_table[288];
struct huff_code len_table[256];
};
struct {
struct huff_code dist_table[31];
struct huff_code lit_len_table[513];
};
};
};
/**