|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTER.TERcoder.SegmentCoder.CodeBlockAC
public class CodeBlockAC
This class codes as many bitplanes of a block of AC components as the user
requires. Usage example:
construct
setParameters
run
get functions
Field Summary | |
---|---|
(package private) int |
bitDepthAC_Block
Determines, for each block, the number of bits needed to represent the magnitude of AC components |
(package private) int |
blockNumber
Indicates the position of the gaggle inside the channel |
(package private) byte[][][][] |
blockStatus
This array contains the status of each of the components in the block. |
(package private) int[] |
BP
For each family and generation indicates the number of bitplanes that are necessary zero due the weighting stage |
(package private) int |
channel
Indicates the channel where the block belongs |
(package private) int[] |
codeLength
Stores for each of the entropy coder options the number of bits required to encode the gaggle. |
(package private) boolean |
computeDistortion
Indicates whether the decrease of the distortion must be computed in order to stop coding process at a given point. |
(package private) byte[] |
D
Indicate whether the descendants (all the components except the parents) are or have been significant for each of the families. |
(package private) DistortionCompute |
distortion
Definition in SegmentCode2D.distortion |
(package private) byte |
Ds
Indicate whether the descendants (all the components except the parents) are or have been significant. |
(package private) int |
entropyCode
Indicates how the obtained code stream is going to be entropy encoded. |
(package private) float[][][] |
imageSamples
Definition in Coder.imageSamplesFloat |
(package private) boolean |
parametersSet
To know if parameters are set. |
(package private) BitStream[] |
refinementAC
This array contains the refinement bits of the block in a bit plane. |
(package private) int |
resolutionLevels
Definition in SegmentCode2D.resolutionLevels |
(package private) byte[][] |
significantPiramid
Represents the significance of each subband of the block (significantPiramid[level of resolution][family]) |
(package private) ByteStream[][][] |
sortingAC
This array contains the significance (and its contexts if needed) of a block in a bitplane. |
(package private) int |
threshold
|
(package private) int[] |
WTLevels
Definition in ForwardWaveletTransform.WTLevels |
(package private) int[][] |
xInit
Indicates the initial row of each of the subbands of the block inside the whole image. |
(package private) int[][] |
yInit
Indicates the initial column of each of the subbands of the block inside the whole image. |
Constructor Summary | |
---|---|
CodeBlockAC(float[][][] imageSamples,
int[] resolutionLevels)
Constructor that receives the values of the block to be further encoded. |
Method Summary | |
---|---|
private boolean |
bitPlaneOfZeros(int rLevel,
int subband,
int bitPlane)
This function indicates if the bits of the coefficients are necessarily zero due to the subband scaling operation |
private void |
codeSquare(int bitPlane,
int rLevel,
int subband)
This function create the words needed to encode each of the squares (subbands) contained in a block. |
private int[][] |
codeWords(int[][] initialWords,
int bitPlane,
int rLevel,
int subband,
int pass)
Given a set of words or transition words it encodes it for a given pass. |
byte[][][][] |
getBlockStatus()
|
int[] |
getCodeLength()
|
byte[] |
getD()
|
byte |
getDs()
|
byte |
getRecommededContext(int stage,
int length,
boolean impossiblePattern)
This function indicates which context correspond to each coded word given its stage, lentgh, ... |
BitStream[] |
getRefinementAC()
|
private void |
initBlockStatus()
Initialize the array with contains the status of each AC component of the block |
private void |
initStreams(int bitPlane)
Initialize the bit streams and the byte streams used to store the significance block and to store the the contexts of the encoded words to be further entropy encoded. |
void |
refinementCoding(int bitPlane)
Perform the refinement of the components of the block for the given bitPlane |
ByteStream[][][] |
run(int bitPlane)
Runs the block coder algorithm |
void |
setParameters(int[] WTLevels,
int resolutionLevels,
int channel,
int blockNumber,
byte[][][][] blockStatus,
int bitDepthAC_Block,
int entropyAC,
int[] BP,
DistortionCompute distortion,
byte Ds,
byte[] D,
int[] codeLength)
Set the parameters used to code a block |
void |
significanceCoding(int bitPlane)
The significance of the block is encoded for the given bitPlane. |
void |
updateLeastSignificantBP(int bitPlane)
This function update the blockStatus for the values that should not be further encoded due to the weighting step for a given bitplane |
private void |
updateLengthEntropyEncoder(int word,
byte context)
This function computes the lenght that would use any of the entropy encoding options. |
private void |
updateStreams(int rLevel,
int subband,
int pass,
int word,
int length,
int stage,
boolean impossiblePattern)
Here are stored words and additional information which is needed to entropy encode each block |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
ByteStream[][][] sortingAC
byte[][][][] blockStatus
int bitDepthAC_Block
int resolutionLevels
SegmentCode2D.resolutionLevels
int entropyCode
BitStream[] refinementAC
DistortionCompute distortion
SegmentCode2D.distortion
byte Ds
byte[] D
int[] BP
Negative values are not allowed.
boolean parametersSet
True indicates that they are set otherwise false.
int[] codeLength
Negative values are not allowed.
float[][][] imageSamples
Coder.imageSamplesFloat
int[] WTLevels
ForwardWaveletTransform.WTLevels
int channel
int blockNumber
int[][] xInit
int[][] yInit
byte[][] significantPiramid
boolean computeDistortion
int threshold
Constructor Detail |
---|
public CodeBlockAC(float[][][] imageSamples, int[] resolutionLevels)
imageSamples
- Coder.imageSamplesFloat
resolutionLevels
- SegmentCode2D.resolutionLevels
Method Detail |
---|
public void setParameters(int[] WTLevels, int resolutionLevels, int channel, int blockNumber, byte[][][][] blockStatus, int bitDepthAC_Block, int entropyAC, int[] BP, DistortionCompute distortion, byte Ds, byte[] D, int[] codeLength)
WTLevels
- definition in ForwardWaveletTransform.WTLevels
resolutionLevels
- definition in SegmentCode2D.resolutionLevels
channel
- definition in channel
blockNumber
- definition in blockNumber
blockStatus
- definition in blockStatus
bitDepthAC_Block
- definition in bitDepthAC_Block
entropyAC
- definition in EncodeGaggleAC.entropyAC
BP
- definition in BP
distortion
- distortion
Ds
- Ds
D
- D
codeLength
- codeLength
public ByteStream[][][] run(int bitPlane) throws java.lang.Exception
bitPlane
- indicates the bitplane that must be coded
java.lang.Exception
- when something goes wrong and block coding must be stoppedpublic void significanceCoding(int bitPlane)
bitPlane
- indicates the bitplane that must be codedprivate boolean bitPlaneOfZeros(int rLevel, int subband, int bitPlane)
rLevel
- indicates the resolution level of the subband to be encodedsubband
- determines the subband once is known the resolution levelbitPlane
- indicates the bitplane that is being encoded
private void codeSquare(int bitPlane, int rLevel, int subband)
bitPlane
- indicates the bitplane that is being encodedrLevel
- indicates the resolution level of the subband to be encodedsubband
- determines the subband once is known the resolution levelprivate int[][] codeWords(int[][] initialWords, int bitPlane, int rLevel, int subband, int pass)
initialWords
- contains the set of words to be encodedbitPlane
- indicates the bitplane that is being encodedrLevel
- indicates the resolution level of the subband to be encodedsubband
- determines the subband once is known the resolution levelpass
- indicates the coding pass that is being encoded
private void updateStreams(int rLevel, int subband, int pass, int word, int length, int stage, boolean impossiblePattern)
rLevel
- indicates the resolution level of the subband to be encodedsubband
- determines the subband once is known the resolution levelpass
- indicates the coding pass that is being encodedword
- contains a word that has been encodedlength
- indicates the lenght of the word to be encoded. Valid values are between 1 and 4.stage
- indicates if the word corresponds to the significance encoding, the sign encoding or the refinement.
impossiblePattern
- indicates if all zeros value if possiblepublic void refinementCoding(int bitPlane)
bitPlane
- indicates the bitplane that is being encodedprivate void updateLengthEntropyEncoder(int word, byte context)
word
- contains a word that has been encodedcontext
- indicates the kind of word to be encoded, i.e. the lenght and the encoding passprivate void initBlockStatus()
private void initStreams(int bitPlane)
bitPlane
- indicates the bitplane that is going to be encodedpublic void updateLeastSignificantBP(int bitPlane)
bitPlane
- indicates the bitplane for which the blockStatus is updatedpublic byte getRecommededContext(int stage, int length, boolean impossiblePattern)
stage
- indicates if the word corresponds to the significance encoding, the sign encoding or the refinement.
length
- indicates the lenght of the word to be encoded. Valid values are between 1 and 4.impossiblePattern
- indicates if all zeros value if possible.
public byte[][][][] getBlockStatus()
public byte[] getD()
public byte getDs()
public BitStream[] getRefinementAC()
public int[] getCodeLength()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |