PTWM
entropy

ptwm_core::entropy::huffman

Pure-Rust canonical Huffman codec.

ptwm_core::entropy::huffman

Pure-Rust canonical Huffman codec.

rsmod

ptwm_core::entropy::huffman

crates/ptwm-core/src/entropy/huffman/mod.rs:1
mod huffman

Pure-Rust canonical Huffman codec.

Uses a canonical-code layout with a nibble-packed weight table and four interleaved 32-bit backward bitstreams (with fused decode in `decompress.rs`).
rsfn

ptwm_core::entropy::huffman::compress

crates/ptwm-core/src/entropy/huffman/mod.rs:30
pub fn compress(dst: &mut [u8], src: &[u8]) -> Result<usize, PtwmCoreError>

Pipeline-style entrypoint: returns the encoded length, or 0 for any non-encoded outcome. The caller (chunk pipeline) treats 0 as "store raw".

rsfn

ptwm_core::entropy::huffman::decompress

crates/ptwm-core/src/entropy/huffman/mod.rs:34
pub fn decompress(dst: &mut [u8], src: &[u8]) -> Result<usize, PtwmCoreError>
rsconst

ptwm_core::entropy::huffman::tree::MAX_TABLE_LOG

crates/ptwm-core/src/entropy/huffman/tree.rs:5
pub const MAX_TABLE_LOG

Maximum Huffman code length (bits). Controls the decode-table size (`1 << MAX_TABLE_LOG` entries) and the counts-per-length array. Exposed so consumers can probe the limit in tests; raising it requires also widening the decode-table index type in `bitstream.rs`.