|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTER.TERcoder.SegmentCoder.InitialCoding
public class InitialCoding
This class code the quantized DC components or the bitDepthAC_Block. Usage example:
construct
setParameters
run
get functions
Field Summary | |
---|---|
(package private) int |
bitDepthAC
Definition in SegmentCode2D.bitDepthAC |
(package private) int |
bitDepthDC
Definition in SegmentCode2D.bitDepthDC |
(package private) int |
blocksPerSegment
This integer determines the number of blocks in the segment |
(package private) int |
BPLL
For the residual subband indicates the number of bitplanes that are necessary zero |
(package private) boolean |
computeDistortion
|
(package private) DistortionCompute |
distortion
Definition in SegmentCode2D.distortion |
(package private) int |
gaggleSize
Specifies the size of a gaggle for the coded values |
(package private) int |
id
Specifies the frequency of appareance of id in the segment. |
(package private) boolean |
isDC
Indicate if the valuesToCode are DC components (true) or not (false). |
(package private) int |
optSelect
Specifies the method employed to select value of k parameters when coding the valuesToCode |
(package private) boolean |
parametersSet
To know if parameters are set. |
(package private) int |
q
This integer indicates the number of bitplanes quantized for DC components |
(package private) int[] |
valuesToCode
This array contains the values to be encoded. |
Constructor Summary | |
---|---|
InitialCoding(int[] valuesToCode)
Constructor that receives the values to be encoded. |
Method Summary | |
---|---|
int[] |
doDPCMandMap(int xMin,
int xMax)
This function performs DPCM and maps obtained values into non-negative integers. |
BitStream[] |
entropyCode(int[] values,
int N)
This function entropy codes the given values according to the paramateres selected by the user. |
int |
getCodeOption(int[] values,
int gaggle,
int codeLength,
int N)
This funtion selects for each gaggle the number of bits that should be split in the entropy coder |
int |
getCodeOptionLength(int N)
This funtion get the number of bits required to encode the code option for entropy. |
int |
getDinamicRange()
Get the number of quantized bit planes for DC components. |
void |
quantizeDCs(int N)
This function quantizes (and computes distortion if needed) the initial values. |
BitStream[] |
run()
Run the initial coding of either DC components or bitDepthAC_Block |
void |
setDinamicRange()
Set the quantization factor for initially DC coding. |
void |
setParameters(int bitDepthDC,
int bitDepthAC,
int optSelect,
int gaggleSize,
int id,
int BPLL,
boolean isDC,
DistortionCompute distortion)
Set the parameters used to perform the initial coding of DC or bitDepthACBlock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
boolean parametersSet
True indicates that they are set otherwise false.
int[] valuesToCode
int bitDepthAC
SegmentCode2D.bitDepthAC
int bitDepthDC
SegmentCode2D.bitDepthDC
int blocksPerSegment
int optSelect
Valid values are:
int gaggleSize
Valid values are positive values.
int id
Valid values are positive values. 0 value means that only one id is used in the segment.
int BPLL
Negative values are not allowed.
boolean isDC
DistortionCompute distortion
SegmentCode2D.distortion
int q
boolean computeDistortion
Constructor Detail |
---|
public InitialCoding(int[] valuesToCode)
valuesToCode
- defintion in valuesToCode
Method Detail |
---|
public void setParameters(int bitDepthDC, int bitDepthAC, int optSelect, int gaggleSize, int id, int BPLL, boolean isDC, DistortionCompute distortion)
bitDepthDC
- SegmentCode2D.bitDepthDC
bitDepthAC
- SegmentCode2D.bitDepthAC
optSelect
- optSelect
gaggleSize
- gaggleSize
id
- id
BPLL
- BPLL
isDC
- isDC
distortion
- distortion
public BitStream[] run() throws java.lang.Exception
ErrorException
- when something goes wrong, for example parameters are not set, and compression must be stopped.
java.lang.Exception
public BitStream[] entropyCode(int[] values, int N)
values
- array containing the values to be entropy coded.N
- number of bits needed to represent the values.
public int getCodeOption(int[] values, int gaggle, int codeLength, int N)
values
- array containing the values to be entropy encoded.gaggle
- indicates the gaggle that is going to be encoded.codeLength
- indicates the length of the code (i.e. the number of bits needed to represent the code option).N
- number of bits needed to represent the values.
public int getCodeOptionLength(int N)
N
- number of bits needed to represent the values.
public int[] doDPCMandMap(int xMin, int xMax)
xMin
- reprensents the minimum value that could be taken by the input values.xMax
- reprensents the maximum value that could be taken by the input values.
public void quantizeDCs(int N)
N
- number of bits to required to represent quantized DCs in two's-complementpublic void setDinamicRange()
public int getDinamicRange()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |