pub struct LevelParams {
pub strategy: Strategy,
pub window_log: u32,
pub hash_log: u32,
pub chain_log: u32,
pub search_log: u32,
pub min_match: u32,
pub target_length: u32,
pub search_strength: u32,
pub force_raw_literals: bool,
}Expand description
Compression parameters for a specific level.
Obtain via level_params or construct directly for custom tuning.
Pass to compress_with_params.
Fields§
§strategy: StrategyMatch finder.
window_log: u32Log2 of the window size in bytes, WINDOW_LOG_MIN to
WINDOW_LOG_MAX.
hash_log: u32Log2 of the entries of the Fast table, or of the DFast long table.
chain_log: u32DFast short table log. Same as hashLog for Fast strategy.
search_log: u32C zstd’s searchLog. The Fast and DFast finders ignore it.
min_match: u32Bytes the Fast table hashes, 4 to 8, or the DFast short table, 4 or 5. A Fast match needs 8 equal bytes at 8, else 4.
target_length: u32Fast only: the search step starts at target_length + 1 bytes, at
least 2, as in C zstd. Above 1, with min_match 5 or more, it also
keeps dense literals raw.
search_strength: u32The search step grows by one every 2^search_strength bytes
without a match. C zstd has no such parameter.
force_raw_literals: boolKeep literals raw and use the predefined sequence tables. Blocks over 32 KiB that are almost all literals may still take Huffman literals.
Implementations§
Source§impl LevelParams
impl LevelParams
Sourcepub fn with_window_log(self, window_log: u32) -> Self
pub fn with_window_log(self, window_log: u32) -> Self
Sets the window to 2^window_log bytes.
compress_with_params clamps it to
WINDOW_LOG_MIN..=WINDOW_LOG_MAX and to the input.