adjusted_offset = seq->adjusted_offset_and_match_hdr >> 9;
num_extra_bits = lzx_extra_offset_bits[offset_slot];
- extra_bits = adjusted_offset - lzx_offset_slot_base[offset_slot];
+ extra_bits = adjusted_offset - (lzx_offset_slot_base[offset_slot] +
+ LZX_OFFSET_ADJUSTMENT);
#define MAX_MATCH_BITS (MAIN_CODEWORD_LIMIT + LENGTH_CODEWORD_LIMIT + \
14 + ALIGNED_CODEWORD_LIMIT)
for (; adjusted_offset < ARRAY_LEN(c->offset_slot_tab_1);
adjusted_offset++)
{
- if (adjusted_offset >= lzx_offset_slot_base[slot + 1])
+ if (adjusted_offset >= lzx_offset_slot_base[slot + 1] +
+ LZX_OFFSET_ADJUSTMENT)
slot++;
c->offset_slot_tab_1[adjusted_offset] = slot;
}
for (; adjusted_offset < LZX_MAX_WINDOW_SIZE;
adjusted_offset += (u32)1 << 14)
{
- if (adjusted_offset >= lzx_offset_slot_base[slot + 1])
+ if (adjusted_offset >= lzx_offset_slot_base[slot + 1] +
+ LZX_OFFSET_ADJUSTMENT)
slot++;
c->offset_slot_tab_2[adjusted_offset >> 14] = slot;
}