|
| void | add (int symbol, int code, int code_length) noexcept |
| | Add a symbol to the huffman_tree.
|
| |
|
state_t | start () const noexcept |
| |
| int | get (bool code_bit, state_t &state) const |
| | Get a symbol from the huffman-tree.
|
| |
|
int | get_symbol (nonstd::span< std::byte const > bytes, ssize_t &bit_offset) const noexcept |
| |
◆ add()
◆ from_lengths()
Build a canonical-huffman table from a set of lengths.
◆ get()
Get a symbol from the huffman-tree.
Before get() is called use start() to create a state to pass between invocations. State is invalid after get() returns a symbol or throws.
- Parameters
-
| code_bit | The next bit from the huffman encoded stream. |
| state | The state carried between invocations |
- See also
- start().
- Returns
- Positive numbers are symbols, negative means more code_bits are needed.
- Exceptions
-
| parse-error | on invalid code-bit sequence. |
The documentation for this class was generated from the following file: