Skip to main content

Module source_coder

Module source_coder 

Source
Expand description

Shared trait wrappers for the source-coding implementations in this crate.

The individual modules such as crate::lz77, crate::lz78, and crate::lzw intentionally expose plain function-based APIs because that keeps each algorithm easy to read in isolation. This module adds a thin trait layer on top so generic code can work with any of those codecs through one unified interface.

§Design

The trait uses associated functions rather than instance methods because the current codecs are stateless. Each implementation is represented by a zero-sized wrapper type that simply forwards to the existing module-level functions.

See the book entry Entropy coding.

Structs§

ArithmeticSourceCoder
Zero-sized wrapper for the arithmetic coding implementation.
HuffmanSourceCoder
Zero-sized wrapper for the Huffman implementation.
Lz77SourceCoder
Zero-sized wrapper for the sliding-window LZ77 implementation.
Lz78SourceCoder
Zero-sized wrapper for the explicit-dictionary LZ78 implementation.
LzwSourceCoder
Zero-sized wrapper for the Welch-style LZW implementation.
ShannonFanoSourceCoder
Zero-sized wrapper for the Shannon-Fano implementation.

Traits§

SourceCoder
Common interface for byte-oriented source coders in this crate.