WIP: MVP
This commit is contained in:
@ -3,6 +3,9 @@
|
||||
|
||||
#include "bitstream.h"
|
||||
|
||||
#define HEADER_SIZE 128
|
||||
#define MAX_LEN 16
|
||||
|
||||
#ifndef HUFFMAN_TABLE
|
||||
#define HUFFMAN_TABLE
|
||||
|
||||
@ -10,16 +13,18 @@ class HuffmanTable
|
||||
{
|
||||
private:
|
||||
std::unordered_map<char, std::pair<int, short> > huffmanCodes;
|
||||
std::vector<char> symbols;
|
||||
std::array<int, 16> counts;
|
||||
public:
|
||||
// Given the list of code lengths length[0..n-1] representing a canonical
|
||||
// Huffman code for n symbols, construct the tables required to decode those
|
||||
// codes.
|
||||
HuffmanTable(uint8_t *header);
|
||||
HuffmanTable(const char *header);
|
||||
|
||||
// Build from input stream
|
||||
HuffmanTable(std::basic_istream<char> &is);
|
||||
|
||||
uint8_t *to_header();
|
||||
char *to_header();
|
||||
|
||||
std::pair<int, short> operator[](const char &c);
|
||||
|
||||
|
Reference in New Issue
Block a user