ZXC 0.15.0
High-performance asymmetric lossless compression library
Loading...
Searching...
No Matches
zxc_lz77_params_t Struct Reference

Search parameters for LZ77 compression levels. More...

#include <zxc_internal.h>

Data Fields

int search_depth
 Maximum number of candidates explored in the hash chain per position.
 
int sufficient_len
 "Good enough" match length: once a match reaches this threshold the chain walk stops immediately, avoiding wasted effort on an already excellent match.
 
int use_lazy
 Enable lazy matching.
 
int lazy_attempts
 Maximum number of candidates explored during lazy evaluation (same semantics as search_depth but applied to the ip+1 / ip+2 probes).
 
int lazy_len_threshold
 Skip lazy evaluation when the current match length already reaches this threshold: a match this long is unlikely to be beaten at the next byte.
 
uint32_t step_base
 Base step size when advancing through unmatched literals.
 
uint32_t step_shift
 Acceleration factor for step size: step = step_base + (distance >> step_shift).
 
uint32_t min_offset
 Shortest match distance the parser may emit; 1 = unconstrained.
 
uint8_t split_max
 Longest match re-emitted as inline pieces (zxc_glo_split_block), in the token's units (length - ZXC_LZ_MIN_MATCH_LEN); <= ZXC_GLO_INLINE_ML_CODE disables.
 

Detailed Description

Search parameters for LZ77 compression levels.

Each compression level maps to a specific set of parameters that control the trade-off between compression speed and ratio. Higher search depths and lazy matching improve ratio at the expense of throughput; larger step values accelerate literal scanning but may miss short matches.

Definition at line 1108 of file zxc_internal.h.

Field Documentation

◆ lazy_attempts

int zxc_lz77_params_t::lazy_attempts

Maximum number of candidates explored during lazy evaluation (same semantics as search_depth but applied to the ip+1 / ip+2 probes).

Only meaningful when use_lazy is non-zero.

Definition at line 1127 of file zxc_internal.h.

Referenced by zxc_lazy_probe().

◆ lazy_len_threshold

int zxc_lz77_params_t::lazy_len_threshold

Skip lazy evaluation when the current match length already reaches this threshold: a match this long is unlikely to be beaten at the next byte.

Set to 0 when use_lazy is disabled.

Definition at line 1132 of file zxc_internal.h.

Referenced by zxc_lz77_find_best_match().

◆ min_offset

uint32_t zxc_lz77_params_t::min_offset

Shortest match distance the parser may emit; 1 = unconstrained.

Skipped candidates do not end the chain walk, which continues to a legal one further back. See ZXC_LZ_MINDIST.

Definition at line 1146 of file zxc_internal.h.

Referenced by zxc_encode_block_ghi(), zxc_encode_block_glo(), zxc_lazy_probe(), and zxc_lz77_find_best_match().

◆ search_depth

int zxc_lz77_params_t::search_depth

Maximum number of candidates explored in the hash chain per position.

Higher values find better matches but increase CPU cost linearly.

Definition at line 1111 of file zxc_internal.h.

Referenced by zxc_lz77_find_best_match().

◆ split_max

uint8_t zxc_lz77_params_t::split_max

Longest match re-emitted as inline pieces (zxc_glo_split_block), in the token's units (length - ZXC_LZ_MIN_MATCH_LEN); <= ZXC_GLO_INLINE_ML_CODE disables.

GLO levels only.

Definition at line 1151 of file zxc_internal.h.

Referenced by zxc_encode_block_glo().

◆ step_base

uint32_t zxc_lz77_params_t::step_base

Base step size when advancing through unmatched literals.

1 = test every byte (best ratio), 4 = skip aggressively (fastest).

Definition at line 1136 of file zxc_internal.h.

Referenced by zxc_encode_block_ghi(), and zxc_encode_block_glo().

◆ step_shift

uint32_t zxc_lz77_params_t::step_shift

Acceleration factor for step size: step = step_base + (distance >> step_shift).

A larger value keeps the step conservative (grows slowly with distance); a smaller value ramps up quickly, skipping more in long literal runs.

Definition at line 1141 of file zxc_internal.h.

Referenced by zxc_encode_block_ghi(), and zxc_encode_block_glo().

◆ sufficient_len

int zxc_lz77_params_t::sufficient_len

"Good enough" match length: once a match reaches this threshold the chain walk stops immediately, avoiding wasted effort on an already excellent match.

Definition at line 1116 of file zxc_internal.h.

Referenced by zxc_lz77_find_best_match().

◆ use_lazy

int zxc_lz77_params_t::use_lazy

Enable lazy matching.

When set, after finding a match at position ip the compressor probes ip+1 (and ip+2 for level >= 4) to see if a longer match exists. If so, a literal is emitted and the better match is taken instead. Improves ratio but costs extra work.

Definition at line 1122 of file zxc_internal.h.

Referenced by zxc_lz77_find_best_match(), and zxc_lz77_optimal_parse_glo().


The documentation for this struct was generated from the following file: