Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reading Entropy Decoder Configuration

This chapter describes how to read struct EntropyDecoder from a bitstream.

read!(struct EntropyDecoder(num_dist, lz77_allowed)) reads entropy decoder configuration, in the following order:

  1. (Optional) LZ77 stream configuration.
  2. Distribution clustering.
  3. Which entropy coding type to use (prefix code or ANS).
  4. Hybrid integer configuration for each post-clustered distribution.
  5. Post-clustered symbol probability distributions.

Subchapters will explain each topic in detail.

Also, EntropyDecoder has a helper method parse:

/// Read an entropy decoder configuration with LZ77 allowed.
pub fn EntropyDecoder::parse(num_dist: u32) -> EntropyDecoder {
    read!(struct EntropyDecoder(num_dist, true))
}