-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathhuffCodes.h
More file actions
27 lines (21 loc) · 740 Bytes
/
huffCodes.h
File metadata and controls
27 lines (21 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include "bit_reader.h"
typedef struct
{
const unsigned char* Bits;
const unsigned short* Codes;
unsigned char* Lookup;
const int Length;
const int ValueCount;
const int ValueCountPower;
const int ValueBits;
const int ValueMax;
const int MaxBitSize;
} HuffmanCodebook;
int ReadHuffmanValue(const HuffmanCodebook* huff, BitReaderCxt* br, int isSigned);
void DecodeHuffmanValues(int* spectrum, int index, int bandCount, const HuffmanCodebook* huff, const int* values);
void InitHuffmanCodebook(const HuffmanCodebook* codebook);
extern HuffmanCodebook HuffmanScaleFactorsUnsigned[7];
extern HuffmanCodebook HuffmanScaleFactorsSigned[6];
extern HuffmanCodebook HuffmanSpectrum[2][8][4];
void InitHuffmanCodebooks();