Class Subband
- Direct Known Subclasses:
SubbandAn,SubbandSyn
The element can be either a node or a leaf of the tree. If it is a node then ther are 4 descendants (LL, HL, LH and HH). If it is a leaf ther are no descendants.
The tree is bidirectional. Each element in the tree structure has a "parent", which is the subband from which the element was obtained by decomposition. The only exception is the root element which has no parent (i.e.it's null), for obvious reasons.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe base 2 exponent of the analysis gain of the subband.intThe height of the subbandbooleanTrue if it is a node in the tree, false if it is a leaf.intThe level in the tree to which this subband belongs, which is the number of wavelet decompositions performed to produce this subband.intThe nominal code-block heightintThe nominal code-block widthThe number of code-blocks (in both directions) contained in this subband.intThe orientation of this subband (WT_ORIENT_LL, WT_ORIENT_HL, WT_ORIENT_LH, WT_ORIENT_HH).intThe resolution level to which this subband contributes.intThe subband index within its resolution level.intThe horizontal coordinate of the upper-left corner of the subband, with respect to the canvas origin, in the component's grid and subband's decomposition level.intThe vertical coordinate of the upper-left corner of the subband, with respect to the canvas origin, in the component's grid and subband's decomposition level.intThe horizontal coordinate of the upper-left corner of the subbandintThe vertical coordinate of the upper-left corner of the subbandintThe width of the subbandstatic final intThe ID for the HH orientationstatic final intThe ID for the HL (horizontal high-pass) orientationstatic final intThe ID for the LH (vertical high-pass) orientationstatic final intThe ID for the LL orientation -
Constructor Summary
ConstructorsConstructorDescriptionSubband()Creates a Subband element with all the default values.Subband(int w, int h, int ulcx, int ulcy, int lvls, WaveletFilter[] hfilters, WaveletFilter[] vfilters) Creates the top-level node and the entire subband tree, with the top-level dimensions, the number of decompositions, and the decomposition tree as specified. -
Method Summary
Modifier and TypeMethodDescriptionabstract SubbandgetHH()Returns the HH child subband of this subband.abstract SubbandgetHL()Returns the HL (horizontal high-pass) child subband of this subband.abstract WaveletFilterThis function returns the horizontal wavelet filter relevant to this subbandabstract SubbandgetLH()Returns the LH (vertical high-pass) child subband of this subband.abstract SubbandgetLL()Returns the LL child subband of this subband.Returns the first leaf subband element in the next higher resolution level.abstract SubbandReturns the parent of this subband.getSubband(int x, int y) Returns a reference to the Subband element to which the specified point belongs.getSubbandByIdx(int rl, int sbi) Returns a subband element in the tree, given its resolution level and subband index.abstract WaveletFilterThis function returns the vertical wavelet filter relevant to this subbandprotected voidInitializes the childs of this node with the correct values.Returns the next subband in the same resolution level, following the subband index order.protected abstract Subbandsplit(WaveletFilter hfilter, WaveletFilter vfilter) Splits the current subband in its four subbands.toString()Returns subband informations in a string.
-
Field Details
-
WT_ORIENT_LL
public static final int WT_ORIENT_LLThe ID for the LL orientation- See Also:
-
WT_ORIENT_HL
public static final int WT_ORIENT_HLThe ID for the HL (horizontal high-pass) orientation- See Also:
-
WT_ORIENT_LH
public static final int WT_ORIENT_LHThe ID for the LH (vertical high-pass) orientation- See Also:
-
WT_ORIENT_HH
public static final int WT_ORIENT_HHThe ID for the HH orientation- See Also:
-
isNode
public boolean isNodeTrue if it is a node in the tree, false if it is a leaf. False by default. -
orientation
public int orientationThe orientation of this subband (WT_ORIENT_LL, WT_ORIENT_HL, WT_ORIENT_LH, WT_ORIENT_HH). It is WT_ORIENT_LL by default. The orientation of the top-level node (i.e. the full image before any decomposition) is WT_ORIENT_LL. -
level
public int levelThe level in the tree to which this subband belongs, which is the number of wavelet decompositions performed to produce this subband. It is 0 for the top-level (i.e. root) node. It is 0 by default. -
resLvl
public int resLvlThe resolution level to which this subband contributes. Level 0 is the smallest resolution level (the one with the lowest frequency LL subband). It is 0 by default. -
numCb
The number of code-blocks (in both directions) contained in this subband. -
anGainExp
public int anGainExpThe base 2 exponent of the analysis gain of the subband. The analysis gain of a subband is defined as the gain of the previous subband (i.e. the one from which this one was obtained) multiplied by the line gain and by the column gain. The line (column) gain is the gain of the line (column) filter that was used to obtain it, which is the DC gain for a low-pass filter and the Nyquist gain for a high-pass filter. It is 0 by default.Using the base 2 exponent of the value contrains the possible gains to powers of 2. However this is perfectly compatible to the filter normalization policy assumed here. See the split() method for more details.
-
sbandIdx
public int sbandIdxThe subband index within its resolution level. This value uniquely identifies a subband within a resolution level and a decomposition level within it. Note that only leaf elements represent "real" subbands, while node elements represent only intermediate stages.It is defined recursively. The root node gets a value of 0. For a given node, with a subband index 'b', its LL descendant gets 4*b, its HL descendant 4*b+1, its LH descendant 4*b+2, and its HH descendant 4*b+3, for their subband indexes.
-
ulcx
public int ulcxThe horizontal coordinate of the upper-left corner of the subband, with respect to the canvas origin, in the component's grid and subband's decomposition level. This is the real horizontal index of the first column of this subband. If even the horizontal decomposition of this subband should be done with the low-pass-first convention. If odd it should be done with the high-pass-first convention. -
ulcy
public int ulcyThe vertical coordinate of the upper-left corner of the subband, with respect to the canvas origin, in the component's grid and subband's decomposition level. This is the real vertical index of the first column of this subband. If even the vertical decomposition of this subband should be done with the low-pass-first convention. If odd it should be done with the high-pass-first convention. -
ulx
public int ulxThe horizontal coordinate of the upper-left corner of the subband -
uly
public int ulyThe vertical coordinate of the upper-left corner of the subband -
w
public int wThe width of the subband -
h
public int hThe height of the subband -
nomCBlkW
public int nomCBlkWThe nominal code-block width -
nomCBlkH
public int nomCBlkHThe nominal code-block height
-
-
Constructor Details
-
Subband
public Subband()Creates a Subband element with all the default values. The dimensions are (0,0), the upper left corner is (0,0) and the upper-left corner with respect to the canvas is (0,0) too. -
Subband
public Subband(int w, int h, int ulcx, int ulcy, int lvls, WaveletFilter[] hfilters, WaveletFilter[] vfilters) Creates the top-level node and the entire subband tree, with the top-level dimensions, the number of decompositions, and the decomposition tree as specified.For the analysis subband gain calculation it is assumed that analysis filters are normalized with a DC gain of 1 and a Nyquist gain of 2.
This constructor does not initialize the value of the magBits member variable. This variable is normally initialized by the quantizer, on the encoder side, or the bit stream reader, on the decoder side.
- Parameters:
w- The top-level widthh- The top-level heightulcx- The horizontal coordinate of the upper-left corner with respect to the canvas origin, in the component grid.ulcy- The vertical coordinate of the upper-left corner with respect to the canvas origin, in the component grid.lvls- The number of levels (or LL decompositions) in the tree.hfilters- The horizontal wavelet filters (analysis or synthesis) for each resolution level, starting at resolution level 0. If there are less elements in the array than there are resolution levels, the last element is used for the remaining resolution levels.vfilters- The vertical wavelet filters (analysis or synthesis) for each resolution level, starting at resolution level 0. If there are less elements in the array than there are resolution levels, the last element is used for the remaining resolution levels.- See Also:
-
-
Method Details
-
getParent
Returns the parent of this subband. The parent of a subband is the subband from which this one was obtained by decomposition. The root element has no parent subband (null).- Returns:
- The parent subband, or null for the root one.
-
getLL
Returns the LL child subband of this subband.- Returns:
- The LL child subband, or null if there are no childs.
-
getHL
Returns the HL (horizontal high-pass) child subband of this subband.- Returns:
- The HL child subband, or null if there are no childs.
-
getLH
Returns the LH (vertical high-pass) child subband of this subband.- Returns:
- The LH child subband, or null if there are no childs.
-
getHH
Returns the HH child subband of this subband.- Returns:
- The HH child subband, or null if there are no childs.
-
split
Splits the current subband in its four subbands. This creates the four childs (LL, HL, LH and HH) and converts the leaf in a node.- Parameters:
hfilter- The horizontal wavelet filter used to decompose this subband.vfilter- The vertical wavelet filter used to decompose this subband.- Returns:
- A reference to the LL leaf (getLL()).
-
initChilds
protected void initChilds()Initializes the childs of this node with the correct values. The sizes of the child subbands are calculated by taking into account the position of the subband in the canvas.For the analysis subband gain calculation it is assumed that analysis filters are normalized with a DC gain of 1 and a Nyquist gain of 2.
-
nextSubband
Returns the next subband in the same resolution level, following the subband index order. If already at the last subband then null is returned. If this subband is not a leaf an IllegalArgumentException is thrown.- Returns:
- The next subband in the same resolution level, following the subband index order, or null if already at last subband.
-
getNextResLevel
Returns the first leaf subband element in the next higher resolution level.- Returns:
- The first leaf element in the next higher resolution level, or null if there is no higher resolution level.
-
getSubbandByIdx
Returns a subband element in the tree, given its resolution level and subband index. This method searches through the tree.- Parameters:
rl- The resolution level.sbi- The subband index, within the resolution level.
-
getSubband
Returns a reference to the Subband element to which the specified point belongs. The specified point must be inside this (i.e. the one defined by this object) subband. This method searches through the tree.- Parameters:
x- horizontal coordinate of the specified point.y- horizontal coordinate of the specified point.
-
toString
Returns subband informations in a string. -
getHorWFilter
This function returns the horizontal wavelet filter relevant to this subband- Returns:
- The horizontal wavelet filter
-
getVerWFilter
This function returns the vertical wavelet filter relevant to this subband- Returns:
- The vertical wavelet filter
-