1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! LZ4 HC (high-compression) block codec.
//!
//! This module implements the LZ4 HC variant of the LZ4 block format (see
//! `lz4hc.c` / `lz4hc.h` in the reference implementation). LZ4 HC produces
//! smaller output than the standard LZ4 block compressor by spending more time
//! searching for longer and better matches, at the cost of significantly slower
//! compression. Decompression speed is identical to standard LZ4: any LZ4
//! block decompressor handles HC-compressed data without modification.
//!
//! # Compression levels
//!
//! HC compression is parameterised by a level in the range
//! [`LZ4HC_CLEVEL_MIN`]..=[`LZ4HC_CLEVEL_MAX`] (2–12). Level
//! [`LZ4HC_CLEVEL_DEFAULT`] (9) balances compression ratio and speed well for
//! most workloads. Levels ≥ [`LZ4HC_CLEVEL_OPT_MIN`] (10–12) activate an
//! optimal parser that can improve ratios further at a substantial additional
//! time cost.
//!
//! # Submodules
//!
//! | Submodule | Responsibility |
//! |-----------------|-------------------------------------------------------------------|
//! | [`types`] | Compression-level table, hash constants, and compression context |
//! | [`encode`] | Core token-encoding helpers shared by all HC strategies |
//! | [`search`] | Hash-chain insertion and match-search routines |
//! | [`lz4mid`] | Mid-level path (levels ≤ 9): hash-table fill and compress loop |
//! | [`compress_hc`] | Main HC compress loop — greedy and optimal-parser variants |
//! | [`dispatch`] | Strategy dispatch: selects hc / lz4mid / optimal at runtime |
//! | [`api`] | Public API — one-shot and streaming compression entry points |
//!
//! The items most commonly needed by callers are re-exported at this level.
pub use ;
pub use ;