Skip to main content

Module entropy_coding

Module entropy_coding 

Source
Expand description

Entropy coding for JPEG XL encoder.

This module provides ANS (Asymmetric Numeral Systems) and Huffman encoding implementations for compressing symbols in the JXL bitstream.

Re-exports§

pub use ans::ANS_LOG_TAB_SIZE;
pub use ans::ANS_MAX_ALPHABET_SIZE;
pub use ans::ANS_SIGNATURE;
pub use ans::ANS_TAB_MASK;
pub use ans::ANS_TAB_SIZE;
pub use ans::ANSEncodingHistogram;
pub use ans::ANSHistogramStrategy;
pub use ans::AnsEncoder;
pub use ans::get_population_count_precision;
pub use histogram::HISTOGRAM_ROUNDING;
pub use histogram::Histogram;
pub use histogram::MIN_DISTANCE_FOR_DISTINCT;
pub use histogram::histogram_distance;
pub use histogram::histogram_kl_divergence;

Modules§

ans
ANS (Asymmetric Numeral Systems) encoder.
ans_decode
histogram
Histogram data structure with entropy calculations.

Structs§

ClusterResult
Result of clustering histograms.
HuffmanTable
Result of building a Huffman table.

Enums§

ClusteringType
Clustering aggressiveness level.
EntropyType
Entropy coding method - affects header cost estimation for clustering.
Lz77Method
LZ77 method selection.

Functions§

build_and_store_huffman_tree
Builds and stores a Huffman table from a histogram.
cluster_histograms
Full clustering pipeline.
convert_bit_depths_to_symbols
Converts code depths to canonical Huffman codes.
create_huffman_tree
Creates an optimal Huffman tree from symbol frequencies.
encode_context_map
Encode context map to bitstream.
fast_cluster_histograms
Fast k-means-like clustering.
inverse_move_to_front_transform
Inverse move-to-front transform (for testing).
move_to_front_transform
Move-to-front transform for better compression.
store_huffman_tree
Stores a full Huffman tree to the bitstream.
write_huffman_tree
Compresses a depth array into RLE-encoded code length codes.