public class HuffmanTable
extends java.lang.Object
A class to store Huffman Tables, either as read from an SCP-ECG file or the default as specified in the SCP-ECG standard.
DefaultHuffmanTable
,
HuffmanDecoder
Modifier and Type | Field and Description |
---|---|
protected long[] |
baseCode |
protected int[] |
baseValueRepresentedByBaseCode |
protected int[] |
numberOfBitsInEntireCode |
protected int[] |
numberOfBitsInPrefix |
protected int |
numberOfCodeStructuresInTable |
protected int[] |
tableModeSwitch |
Modifier | Constructor and Description |
---|---|
protected |
HuffmanTable() |
|
HuffmanTable(int numberOfCodeStructuresInTable,
int[] numberOfBitsInPrefix,
int[] numberOfBitsInEntireCode,
int[] tableModeSwitch,
int[] baseValueRepresentedByBaseCode,
long[] baseCode)
Construct a Huffman Table from the supplied data as read from an SCP-ECG file.
|
Modifier and Type | Method and Description |
---|---|
long[] |
getBaseCode() |
int[] |
getBaseValueRepresentedByBaseCode() |
int[] |
getNumberOfBitsInEntireCode() |
int[] |
getNumberOfBitsInPrefix() |
int |
getNumberOfCodeStructuresInTable() |
int[] |
getTableModeSwitch() |
java.lang.String |
toString()
Dump the tables as a
String . |
protected long[] baseCode
protected int[] baseValueRepresentedByBaseCode
protected int[] numberOfBitsInEntireCode
protected int[] numberOfBitsInPrefix
protected int numberOfCodeStructuresInTable
protected int[] tableModeSwitch
protected HuffmanTable()
public HuffmanTable(int numberOfCodeStructuresInTable, int[] numberOfBitsInPrefix, int[] numberOfBitsInEntireCode, int[] tableModeSwitch, int[] baseValueRepresentedByBaseCode, long[] baseCode)
Construct a Huffman Table from the supplied data as read from an SCP-ECG file.
numberOfCodeStructuresInTable
- the number of codes (i.e. the size of all the array parameters)numberOfBitsInPrefix
- for each code, the number of prefix bits for each code (i.e. the Huffman code)numberOfBitsInEntireCode
- for each code, if > numberOfBitsInPrefix, used to find the number of original bits encodedtableModeSwitch
- for each code, a flag to indicate to switch to another table (1 indicates no switch)baseValueRepresentedByBaseCode
- for each code, the value that the code representsbaseCode
- the codes (with the order of bits reversed)public long[] getBaseCode()
public int[] getBaseValueRepresentedByBaseCode()
public int[] getNumberOfBitsInEntireCode()
public int[] getNumberOfBitsInPrefix()
public int getNumberOfCodeStructuresInTable()
public int[] getTableModeSwitch()
public java.lang.String toString()
Dump the tables as a String
.
toString
in class java.lang.Object
String