C# Класс Blast.Blast.HuffmanTable

Huffman code decoding tables. count[1..MAXBITS] is the number of symbols of each length, which for a canonical code are stepped through in order. symbol[] are the symbol values in canonical order, where the number of entries is the sum of the counts in count[]. The decoding process can be seen in the function decode() below.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
DISTANCE_CODE HuffmanTable
LENGTH_CODE HuffmanTable
LITERAL_CODE HuffmanTable
count short[]
symbol short[]

Открытые методы

Метод Описание
HuffmanTable ( int symbolSize, byte compacted ) : System

Приватные методы

Метод Описание
Construct ( byte rep ) : int

Given a list of repeated code lengths rep[0..n-1], where each byte is a count (high four bits + 1) and a code length (low four bits), generate the list of code lengths. This compaction reduces the size of the object code. Then 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. Those tables are the number of codes of each length, and the symbols sorted by length, retaining their original order within each length. The return value is zero for a complete code set, negative for an over- subscribed code set, and positive for an incomplete code set. The tables can be used if the return value is zero or positive, but they cannot be used if the return value is negative. If the return value is zero, it is not possible for decode() using that table to return an error -- any stream of enough bits will resolve to a symbol. If the return value is positive, then it is possible for decode() using that table to return an error for received codes past the end of the incomplete lengths.

Описание методов

HuffmanTable() публичный Метод

public HuffmanTable ( int symbolSize, byte compacted ) : System
symbolSize int
compacted byte
Результат System

Описание свойств

DISTANCE_CODE публичное статическое свойство

public static HuffmanTable DISTANCE_CODE
Результат HuffmanTable

LENGTH_CODE публичное статическое свойство

public static HuffmanTable LENGTH_CODE
Результат HuffmanTable

LITERAL_CODE публичное статическое свойство

public static HuffmanTable LITERAL_CODE
Результат HuffmanTable

count публичное свойство

public short[] count
Результат short[]

symbol публичное свойство

public short[] symbol
Результат short[]