|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.raba.codec.CanonicalHuffmanRabaCoder.AbstractCodingSetup
protected abstract static class CanonicalHuffmanRabaCoder.AbstractCodingSetup
Abstract base class for preparing a logical byte[][] for coding.
| Constructor Summary | |
|---|---|
protected |
CanonicalHuffmanRabaCoder.AbstractCodingSetup()
|
| Method Summary | |
|---|---|
protected it.unimi.dsi.fastutil.bytes.Byte2IntOpenHashMap |
buildSymbolTable(int[] frequency,
int[] packedFrequency,
byte[] symbol2byte)
Build the symbol table, populating the packedFrequency array, etc. |
int |
byte2symbol(byte b)
Mapping from byte values to symbol indices. |
abstract it.unimi.dsi.compression.HuffmanCodec |
codec()
The codec used to encode and decode the logical byte[][]. |
abstract it.unimi.dsi.compression.HuffmanCodec.DecoderInputs |
decoderInputs()
The data required to reconstruct the decoder. |
protected int[] |
getFrequencyCount(IRaba raba)
Create a frequency table reporting the #of occurrences of for every possible byte value. |
protected int[] |
getPackedFrequencyCount(IRaba raba)
Return a dense array of the non-zero frequency counts in byte value order. |
abstract int |
getSymbolCount()
Return the #of distinct symbols used to generate the code. |
protected int |
getSymbolCount(int[] frequency)
Compute the number of distinct bytes. |
protected static String |
printCodeBook(it.unimi.dsi.bits.BitVector[] codeWords,
com.bigdata.btree.raba.codec.CanonicalHuffmanRabaCoder.Symbol2Byte symbol2byte)
Format the code book as a multi-line string. |
byte |
symbol2byte(int symbol)
Mapping from symbol indices to byte values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected CanonicalHuffmanRabaCoder.AbstractCodingSetup()
| Method Detail |
|---|
public abstract int getSymbolCount()
public abstract it.unimi.dsi.compression.HuffmanCodec codec()
public abstract it.unimi.dsi.compression.HuffmanCodec.DecoderInputs decoderInputs()
protected static String printCodeBook(it.unimi.dsi.bits.BitVector[] codeWords,
com.bigdata.btree.raba.codec.CanonicalHuffmanRabaCoder.Symbol2Byte symbol2byte)
codeWords - The code words.symbol2byte - The mapping from symbol indices to byte value.
protected int[] getPackedFrequencyCount(IRaba raba)
raba - The logical byte[][].
protected int[] getFrequencyCount(IRaba raba)
raba - The data.
protected int getSymbolCount(int[] frequency)
frequency - An array of 256 elements giving the frequency of
occurrence for each possible byte value.
protected it.unimi.dsi.fastutil.bytes.Byte2IntOpenHashMap buildSymbolTable(int[] frequency,
int[] packedFrequency,
byte[] symbol2byte)
frequency - An array of 256 frequency counts. Each element of the
array gives the frequency of occurrence of the
corresponding byte value.packedFrequency - The non-zero symbol frequency counts. This array is
correlated with the packed symbol table. The array must be
pre-allocated by the caller with nsymbol elements.symbol2byte - The forward lookup symbol table. The array must be
pre-allocated by the caller with nsymbol elements.
public int byte2symbol(byte b)
b - The byte value.
-1
if the byte value was not assigned to any symbol.public byte symbol2byte(int symbol)
symbol - The symbol index.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||