nk
1.0.0
C++ Numerical Computing Runtime
Toggle main menu visibility
Loading...
Searching...
No Matches
huffman.hpp
Go to the documentation of this file.
1
3
// toolboxes/comm/include/nk/comm/source/huffman.hpp
4
//
5
// Huffman entropy coding (huffmandict + huffmanenco / huffmandeco).
6
7
#pragma once
8
9
#include <memory_resource>
10
#include <nk/value/value.hpp>
11
#include <utility>
12
13
namespace
nk::comm {
14
17
18
35
std::pair<Value, double>
36
huffmandict
(
const
Value
&symbols,
const
Value
&probs,
37
std::pmr::memory_resource *mr =
nullptr
);
38
51
Value
huffmanenco
(
const
Value
&sig,
const
Value
&dict,
52
std::pmr::memory_resource *mr =
nullptr
);
53
67
Value
huffmandeco
(
const
Value
&bits,
const
Value
&dict,
68
std::pmr::memory_resource *mr =
nullptr
);
69
70
72
}
// namespace nk::comm
nk::Value
Core MATLAB-compatible multidimensional array and scalar value type.
Definition
value.hpp:61
nk::comm::huffmandeco
Value huffmandeco(const Value &bits, const Value &dict, std::pmr::memory_resource *mr=nullptr)
Decode a Huffman bit stream (dec = huffmandeco(bits, dict)).
nk::comm::huffmanenco
Value 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)).
nk::comm::huffmandict
std::pair< Value, double > huffmandict(const Value &symbols, const Value &probs, std::pmr::memory_resource *mr=nullptr)
Build a canonical Huffman dictionary ([dict, avglen] = huffmandict(symbols, probs)).
src
toolboxes
comm
include
nk
comm
source
huffman.hpp
Generated by
1.17.0