- /* NOTE: the calculation *should* be as follows:
- *
- * u32 max_offset = window_size - LZX_MIN_MATCH_LEN;
- * u32 max_adjusted_offset = max_offset + LZX_OFFSET_OFFSET;
- * u32 num_offset_slots = 1 + lzx_get_offset_slot_raw(max_adjusted_offset);
- *
- * However since LZX_MIN_MATCH_LEN == LZX_OFFSET_OFFSET, we would get
- * max_adjusted_offset == window_size, which would bump the number of
- * offset slots up by 1 since every valid LZX window size is equal to a
- * offset slot base value. The format doesn't do this, and instead
- * disallows matches with minimum length and maximum offset. This sets
- * max_adjusted_offset = window_size - 1, so instead we must calculate:
- *
- * num_offset_slots = 1 + lzx_get_offset_slot_raw(window_size - 1);
- *
- * ... which is the same as
- *
- * num_offset_slots = lzx_get_offset_slot_raw(window_size);
- *
- * ... since every valid window size is equal to an offset base value.
- */
- unsigned num_offset_slots = lzx_get_offset_slot_raw(window_size);
-
- /* Now calculate the number of main symbols as LZX_NUM_CHARS literal
- * symbols, plus 8 symbols per offset slot (since there are 8 possible
- * length headers, and we need all (offset slot, length header)
- * combinations). */
- return LZX_NUM_CHARS + (num_offset_slots << 3);