One-shot LZMA range decoder. More...
#include <xz.hpp>
Public Member Functions | |
| range_decoder (std::span< std::byte const > input) | |
| Initializes a decoder from one complete LZMA chunk. | |
| std::uint8_t | decode_bit (std::uint16_t &probability) |
| Decodes one adaptive binary symbol. | |
| std::uint32_t | decode_tree (std::span< std::uint16_t > probabilities, std::uint32_t leaf_base) |
| Decodes a most-significant-bit-first probability tree. | |
| std::uint32_t | decode_reverse_tree (std::span< std::uint16_t > probabilities, std::ptrdiff_t base, std::uint8_t bit_count) |
| Decodes a least-significant-bit-first probability tree. | |
| std::uint32_t | decode_direct (std::uint8_t bit_count) |
| Decodes equiprobable direct bits. | |
| void | finish () |
| Validate exact consumption and the LZMA terminal range state. | |
|
inlineexplicit |
|
inlinenodiscard |
Decodes one adaptive binary symbol.
| probability | Probability updated in place after the decision. |
Definition at line 191 of file xz.hpp.
References rpnx::compression::xz_codec::probability_move_bits, and rpnx::compression::xz_codec::probability_total.
Referenced by rpnx::compression::xz_codec::decode_length(), rpnx::compression::xz_codec::decode_lzma_chunk(), decode_reverse_tree(), and decode_tree().
|
inlinenodiscard |
Decodes equiprobable direct bits.
| bit_count | Number of bits to decode. |
Definition at line 257 of file xz.hpp.
Referenced by rpnx::compression::xz_codec::decode_lzma_chunk().
|
inlinenodiscard |
Decodes a least-significant-bit-first probability tree.
| probabilities | Backing probability table updated in place. |
| base | Offset immediately before the tree's root. |
| bit_count | Tree depth. |
Definition at line 234 of file xz.hpp.
References decode_bit(), rpnx::compression::invalid_data, and rpnx::compression::xz.
Referenced by rpnx::compression::xz_codec::decode_lzma_chunk().
|
inlinenodiscard |
Decodes a most-significant-bit-first probability tree.
| probabilities | Tree probabilities updated in place. |
| leaf_base | First leaf index, which must be a power of two. |
leaf_base. Definition at line 213 of file xz.hpp.
References decode_bit(), rpnx::compression::invalid_data, and rpnx::compression::xz.
Referenced by rpnx::compression::xz_codec::decode_length(), and rpnx::compression::xz_codec::decode_lzma_chunk().
|
inline |
Validate exact consumption and the LZMA terminal range state.
Definition at line 276 of file xz.hpp.
References rpnx::compression::invalid_data, and rpnx::compression::xz.
Referenced by rpnx::compression::xz_codec::decode_lzma_chunk().