nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
huffman.hpp File Reference
#include <memory_resource>
#include <nk/value/value.hpp>
#include <utility>

Go to the source code of this file.

Functions

std::pair< Value, double > nk::comm::huffmandict (const Value &symbols, const Value &probs, std::pmr::memory_resource *mr=nullptr)
 Build a canonical Huffman dictionary ([dict, avglen] = huffmandict(symbols, probs)).
Value nk::comm::huffmanenco (const Value &sig, const Value &dict, std::pmr::memory_resource *mr=nullptr)
 Encode a symbol sequence using a Huffman dictionary (enc = huffmanenco(sig, dict)).
Value nk::comm::huffmandeco (const Value &bits, const Value &dict, std::pmr::memory_resource *mr=nullptr)
 Decode a Huffman bit stream (dec = huffmandeco(bits, dict)).