pub struct EntropyChannelDescriptor {
pub coder: u8,
pub coder_version: u16,
pub scale_bits: u8,
pub lane_count: u8,
pub model_id: u32,
pub symbol_count: u64,
pub decoded_length: u64,
pub initial_state: u32,
pub payload: Vec<u8>,
}Expand description
A complete decoder-entry descriptor for one entropy channel.
Fields§
§coder: u8Coder selector (must be CODER_ORDER0_BYTE_RANS).
coder_version: u16Coder wire version (must be CODER_VERSION_1).
scale_bits: u8Model scale bits; must match the referenced model.
lane_count: u8Lane count (only single-lane channels are supported).
model_id: u32Index into the descriptor’s entropy-model table.
symbol_count: u64Number of symbols encoded.
decoded_length: u64Exact decoded length in bytes.
initial_state: u32Decoder initial state (scalar single lane).
payload: Vec<u8>Renormalization payload in forward decoder-consumption order.
Implementations§
Source§impl EntropyChannelDescriptor
impl EntropyChannelDescriptor
Sourcepub fn encode(&self) -> Result<Vec<u8>>
pub fn encode(&self) -> Result<Vec<u8>>
Canonical wire encoding (little-endian):
[coder u8][coder_version u16][scale_bits u8][lane_count u8]
[model_id u32][symbol_count u64][decoded_length u64]
[initial_state u32][payload_len u32][payload].
Sourcepub fn header_bytes(&self) -> Result<Vec<u8>>
pub fn header_bytes(&self) -> Result<Vec<u8>>
The fixed WIRE_HEADER_LEN-byte header alone, in the exact layout
encode uses, without the renormalization payload.
The final payload_len field still reflects the payload length, so the
header is a complete description of everything except the payload bytes.
This is the “channel header” shareable unit (Phase 11.14): two channels
whose only difference is their payload share one header.