public class CodecStats extends Object
This statistics collector is suited to the standard compressors implemented by the Gridfour API. If desired, it may be used for other compressor implementations.
Constructor and Description |
---|
CodecStats(PredictorModelType pcType)
Construct a statistics object for the specified predictor model.
|
Modifier and Type | Method and Description |
---|---|
void |
addCountsForM32(int nM32,
byte[] m32)
Add counts for the M32 symbols derived from the predictor
for the tile.
|
void |
addToCounts(int nBytesForTile,
int nSymbolsInTile,
int nBitsOverhead)
Add metadata about the tile to the counts
|
void |
clear()
Clear any accumulated counts
|
double |
getAverageLength()
Get the average length of encoded tiles, in bytes.
|
double |
getAverageMCodeLength()
Gets the average length of the M32 code length across tiles.
|
double |
getAverageObservedMCodes()
Gets the average number of unique M32 codes observed in
the compressed tile.
|
double |
getAverageOverhead()
Get the average overhead per tile.
|
double |
getBitsPerSymbol()
Get the number of bits per symbol in the pre-compression encoding.
|
double |
getEntropy()
Get the entropy for the data.
|
String |
getLabel()
Get a label for the predictor.
|
long |
getTileCount()
Get the number of tiles that have been counted.
|
public CodecStats(PredictorModelType pcType)
pcType
- a valid predictor model type.public String getLabel()
public void addToCounts(int nBytesForTile, int nSymbolsInTile, int nBitsOverhead)
nBytesForTile
- the number of byts for the compressed version of the
tile.nSymbolsInTile
- the number of values in the tile, typically
the number of cells in the grid.nBitsOverhead
- Any compressor-specific overhead that an
implementation wishes to track.public void addCountsForM32(int nM32, byte[] m32)
nM32
- the total number of symbols in the encoded datam32
- the encoded datapublic double getEntropy()
public void clear()
public double getBitsPerSymbol()
public long getTileCount()
public double getAverageMCodeLength()
public double getAverageObservedMCodes()
public double getAverageOverhead()
public double getAverageLength()
Copyright © 2022. All rights reserved.