PTWM
context_mixing

ptwm_core::entropy::context_mixing::coder

Bit-level encode/decode driver. Ties the context models + gated mixer to the shared range coder, coding each byte MSB-first. The payload is self-delimiting: a u32 LE length prefix precedes the coded bits, so decode never depends on the container's decoded_len.

ptwm_core::entropy::context_mixing::coder

Bit-level encode/decode driver. Ties the context models + gated mixer to the shared range coder, coding each byte MSB-first. The payload is self-delimiting: a u32 LE length prefix precedes the coded bits, so decode never depends on the container's decoded_len.

rsmod

ptwm_core::entropy::context_mixing::coder

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

Bit-level encode/decode driver. Ties the context models + gated mixer to the shared range coder, coding each byte MSB-first. The payload is self-delimiting: a u32 LE length prefix precedes the coded bits, so decode never depends on the container's `decoded_len`.

rsfn

ptwm_core::entropy::context_mixing::coder::decode_plane

crates/ptwm-core/src/entropy/context_mixing/coder.rs:60
pub fn decode_plane(payload: &[u8]) -> Result<Vec<u8>, PtwmCoreError>

Decode a plane produced by [`encode_plane`].

rsfn

ptwm_core::entropy::context_mixing::coder::encode_plane

crates/ptwm-core/src/entropy/context_mixing/coder.rs:26
pub fn encode_plane(data: &[u8]) -> Vec<u8>

Encode a plane. Output = `[len: u32 LE][range-coded bits]`.

rsconst

ptwm_core::entropy::context_mixing::coder::MAX_LEN

crates/ptwm-core/src/entropy/context_mixing/coder.rs:16
pub const MAX_LEN

Absolute cap on the framed length (mirrors rans.rs) — guards a hostile prefix from driving a multi-GiB decode, and bounds the encoder's usize→u32 length cast.