Lz4Sequence structs describing the compressed
representation. The final sequence will have matchLen == 0.
Find sequences using a lazy matching algorithm (HC mode).
This implements the LZ4 High Compression (HC) strategy used for levels 7-9. Unlike greedy matching, lazy matching defers the decision to emit a match: after finding a match at position P, it checks if position P+1 has a longer match. If so, the byte at P is emitted as a literal and the better match at P+1 is used instead.
This approach trades compression speed for better compression ratios, as it can find longer matches that span across initial match positions.
The algorithm ensures the last LZ4_MIN_MATCH bytes are emitted as literals (LZ4 format requirement for safe decoding).
src | Input data to compress. |
hashBits | Number of hash bits for the table (determines table size). |
Lz4Sequence structs describing the compressed
representation. The final sequence will have matchLen == 0.