protected abstract static class CanonicalHuffmanRabaCoder.AbstractCodingSetup extends Object
Modifier | Constructor and Description |
---|---|
protected |
CanonicalHuffmanRabaCoder.AbstractCodingSetup() |
Modifier and Type | Method and Description |
---|---|
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 HuffmanCodec |
codec()
The codec used to encode and decode the logical byte[][].
|
abstract 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(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.
|
protected CanonicalHuffmanRabaCoder.AbstractCodingSetup()
public abstract int getSymbolCount()
public abstract HuffmanCodec codec()
public abstract HuffmanCodec.DecoderInputs decoderInputs()
protected static String printCodeBook(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.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.