public class LsHeader extends Object
Currently, the header definition is hard-wired for 8 predictor coefficients. But this value is subject to change in the future.
Modifier and Type | Field and Description |
---|---|
protected int |
codecIndex |
static int |
COMPRESSION_TYPE_DEFLATE |
static int |
COMPRESSION_TYPE_HUFFMAN |
protected int |
compressionType |
protected int |
headerSize |
protected int |
nCoefficients |
protected int |
nInitializerCodes |
protected int |
nInteriorCodes |
protected int |
seed |
protected float[] |
u |
Constructor and Description |
---|
LsHeader(byte[] packing,
int packingOffset)
Constructs a instance populated with parameters extracted from the
packing
|
Modifier and Type | Method and Description |
---|---|
int |
getCodecIndex()
Get the codec index from the packing
|
int |
getCodedInitializerLength()
Get the length of the encoded text (M32 codes) for the initializers
|
int |
getCodedInteriorLength()
Get the length of the encoded text (M32 codes) for the interior.
|
int |
getCompressionType()
Indicates whether the data was compresses using Huffman coding or
Deflate.
|
int |
getHeaderSize()
Get the size of the header, in bytes
|
float[] |
getOptimalPredictorCoefficients()
Get the optimal predictor coefficients from the packing
|
int |
getPredictorCoefficientCount()
Gets the number of predictors coefficients defined for the encoding
|
int |
getSeed()
Get the seed value from the packing
|
static byte[] |
packHeader(int codecIndex,
int nCoefficients,
int seed,
float[] u,
int nInitializationCodes,
int nInteriorCodes,
int compressionTypeCode)
Packs the metadata ("header") for a LSOP compression into an array of bytes
|
static byte[] |
packHeader(int codecIndex,
LsOptimalPredictorResult result,
int compressionTypeCode) |
public static final int COMPRESSION_TYPE_HUFFMAN
public static final int COMPRESSION_TYPE_DEFLATE
protected final int codecIndex
protected final int nCoefficients
protected final int seed
protected final float[] u
protected final int nInitializerCodes
protected final int nInteriorCodes
protected final int compressionType
protected final int headerSize
public LsHeader(byte[] packing, int packingOffset)
packing
- an array of bytes containing the encoded parameters;
it is assumed that the packing is at least as long as the required storagepackingOffset
- the starting position within the encoded packingpublic static byte[] packHeader(int codecIndex, int nCoefficients, int seed, float[] u, int nInitializationCodes, int nInteriorCodes, int compressionTypeCode)
codecIndex
- the index of the CODEC as defined by the calling application.nCoefficients
- the number of coefficientsseed
- the seed valueu
- the compression coefficients, should be dimensioned
to at least nCoefficientsnInitializationCodes
- the number of M32 codes in the initializernInteriorCodes
- the number of M32 codes in the interiorcompressionTypeCode
- indicates which standard compression method
(Huffman or Deflate) was used to compress the M32 code sequencepublic static byte[] packHeader(int codecIndex, LsOptimalPredictorResult result, int compressionTypeCode)
public int getCodecIndex()
public int getPredictorCoefficientCount()
public int getSeed()
public float[] getOptimalPredictorCoefficients()
public int getCodedInitializerLength()
public int getCodedInteriorLength()
public int getCompressionType()
public int getHeaderSize()
Copyright © 2022. All rights reserved.