public class RiceEncoder extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEBUG_LEV
For debugging: Higher values equals greater output, generally in
increments of 10
|
| Constructor and Description |
|---|
RiceEncoder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
beginResidual(boolean useFiveBitParam,
byte order,
EncodedElement ele)
Create the residual headers for a FLAC stream.
|
static int |
calculateEncodeSize(int[] values,
int inputOffset,
int inputStep,
int inputCount,
int bitParam)
Calculate how large a given set of values will be once it has been
rice-encoded.
|
int |
encodeRicePartition(int[] values,
int inputOffset,
int inputStep,
int inputCount,
EncodedElement destEle,
int bitParam,
boolean fiveBitParam)
Rice-encode a set of values, adding necessary headers for FLAC format.
|
static int |
encodeRicePartitionEscaped(int[] values,
int inputOffset,
int inputStep,
int inputCount,
EncodedElement destEle,
int bitParam,
boolean fiveBitParam) |
public static int DEBUG_LEV
public RiceEncoder()
public static int beginResidual(boolean useFiveBitParam,
byte order,
EncodedElement ele)
useFiveBitParam - Set TRUE if using a five-bit parameter size, FALSE
for a four-bit parameterorder - Specify order of partitions to be used(actual number of
partitions will be 2^order.ele - EncodedElement to write header to.public static int encodeRicePartitionEscaped(int[] values,
int inputOffset,
int inputStep,
int inputCount,
EncodedElement destEle,
int bitParam,
boolean fiveBitParam)
public int encodeRicePartition(int[] values,
int inputOffset,
int inputStep,
int inputCount,
EncodedElement destEle,
int bitParam,
boolean fiveBitParam)
values - array of integer values to saveinputOffset - start index in input arrayinputStep - number of values to skip between target values(for
interleaved data.inputCount - number of total values to encodebitParam - rice-parameter to use. This value should be based upon
the distribution of the input data(roughly speeking, each value
will require at least bitParam+1 bits to save, so this value
should reflect the average magnitude of input values.destEle - EncodedElement to save result to.fiveBitParam - Set true if this header should use a five-bit
rice-parameter, false for a four bit parameter.public static int calculateEncodeSize(int[] values,
int inputOffset,
int inputStep,
int inputCount,
int bitParam)
values - array of integer values to saveinputOffset - start index in input arrayinputStep - number of values to skip between target values(for
interleaved data.inputCount - number of total values to encodebitParam - rice-parameter to use. This value should be based upon
the distribution of the input data(roughly speeking, each value
will require at least bitParam+1 bits to save, so this value
should reflect the average magnitude of input values.Copyright © 2017. All rights reserved.