| java.lang.Object jj2000.j2k.wavelet.Subband
All known Subclasses: jj2000.j2k.wavelet.analysis.SubbandAn, jj2000.j2k.wavelet.synthesis.SubbandSyn,
Subband | abstract public class Subband (Code) | | This abstract class represents a subband in a bidirectional tree structure
that describes the subband decomposition for a wavelet transform. This
class is implemented by the SubbandAn and SubbandSyn classes, which are for
the analysis and synthesis sides, respectively.
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: jj2000.j2k.wavelet.analysis.SubbandAn See Also: jj2000.j2k.wavelet.synthesis.SubbandSyn |
Field Summary | |
final public static int | WT_ORIENT_HH | final public static int | WT_ORIENT_HL | final public static int | WT_ORIENT_LH | final public static int | WT_ORIENT_LL | public int | anGainExp The base 2 exponent of the analysis gain of the subband. | public int | h | public boolean | isNode True if it is a node in the tree, false if it is a leaf. | public int | level The level in the tree to which this subband belongs, which is the
number of wavelet decompositions performed to produce this subband. | public int | nomCBlkH | public int | nomCBlkW | public Point | numCb The number of code-blocks (in both directions) contained in this
subband. | public int | orientation The orientation of this subband (WT_ORIENT_LL, WT_ORIENT_HL,
WT_ORIENT_LH, WT_ORIENT_HH). | public int | resLvl The resolution level to which this subband contributes. | public int | sbandIdx The subband index within its resolution level. | public int | ulcx The 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. | public int | ulcy The 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. | public int | ulx | public int | uly | public int | w |
Constructor Summary | |
public | Subband() Creates a Subband element with all the default values. | 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. |
WT_ORIENT_HH | final public static int WT_ORIENT_HH(Code) | | The ID for the HH orientation
|
WT_ORIENT_HL | final public static int WT_ORIENT_HL(Code) | | The ID for the HL (horizontal high-pass) orientation
|
WT_ORIENT_LH | final public static int WT_ORIENT_LH(Code) | | The ID for the LH (vertical high-pass) orientation
|
WT_ORIENT_LL | final public static int WT_ORIENT_LL(Code) | | The ID for the LL orientation
|
anGainExp | public int anGainExp(Code) | | The 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.
See Also: Subband.split |
h | public int h(Code) | | The height of the subband
|
isNode | public boolean isNode(Code) | | True if it is a node in the tree, false if it is a leaf. False by
default.
|
level | public int level(Code) | | The 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.
|
nomCBlkH | public int nomCBlkH(Code) | | The nominal code-block height
|
nomCBlkW | public int nomCBlkW(Code) | | The nominal code-block width
|
numCb | public Point numCb(Code) | | The number of code-blocks (in both directions) contained in this
subband.
|
orientation | public int orientation(Code) | | The 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.
|
resLvl | public int resLvl(Code) | | The 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.
|
sbandIdx | public int sbandIdx(Code) | | The 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 ulcx(Code) | | The 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 ulcy(Code) | | The 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 ulx(Code) | | The horizontal coordinate of the upper-left corner of the subband
|
uly | public int uly(Code) | | The vertical coordinate of the upper-left corner of the subband
|
w | public int w(Code) | | The width of the subband
|
Subband | public Subband()(Code) | | 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)(Code) | | 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 width Parameters: h - The top-level height Parameters: ulcx - The horizontal coordinate of the upper-left corner withrespect to the canvas origin, in the component grid. Parameters: ulcy - The vertical coordinate of the upper-left corner withrespect to the canvas origin, in the component grid. Parameters: lvls - The number of levels (or LL decompositions) in the tree. Parameters: hfilters - The horizontal wavelet filters (analysis or synthesis)for each resolution level, starting at resolution level 0. If there areless elements in the array than there are resolution levels, the lastelement is used for the remaining resolution levels. Parameters: vfilters - The vertical wavelet filters (analysis or synthesis)for each resolution level, starting at resolution level 0. If there areless elements in the array than there are resolution levels, the lastelement is used for the remaining resolution levels. See Also: WaveletTransform |
getHH | abstract public Subband getHH()(Code) | | Returns the HH child subband of this subband.
The HH child subband, or null if there are no childs. |
getHL | abstract public Subband getHL()(Code) | | Returns the HL (horizontal high-pass) child subband of this subband.
The HL child subband, or null if there are no childs. |
getHorWFilter | abstract public WaveletFilter getHorWFilter()(Code) | | This function returns the horizontal wavelet filter relevant to this
subband
The horizontal wavelet filter |
getLH | abstract public Subband getLH()(Code) | | Returns the LH (vertical high-pass) child subband of this subband.
The LH child subband, or null if there are no childs. |
getLL | abstract public Subband getLL()(Code) | | Returns the LL child subband of this subband.
The LL child subband, or null if there are no childs. |
getNextResLevel | public Subband getNextResLevel()(Code) | | Returns the first leaf subband element in the next higher resolution
level.
The first leaf element in the next higher resolution level, ornull if there is no higher resolution level. |
getParent | abstract public Subband getParent()(Code) | | 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).
The parent subband, or null for the root one. |
getSubband | public Subband getSubband(int x, int y)(Code) | | 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. Parameters: y - horizontal coordinate of the specified point. |
getSubbandByIdx | public Subband getSubbandByIdx(int rl, int sbi)(Code) | | 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. Parameters: sbi - The subband index, within the resolution level. |
getVerWFilter | abstract public WaveletFilter getVerWFilter()(Code) | | This function returns the vertical wavelet filter relevant to this
subband
The vertical wavelet filter |
initChilds | protected void initChilds()(Code) | | 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 | public Subband nextSubband()(Code) | | 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.
The next subband in the same resolution level, following thesubband index order, or null if already at last subband. |
split | abstract protected Subband split(WaveletFilter hfilter, WaveletFilter vfilter)(Code) | | 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 thissubband. Parameters: vfilter - The vertical wavelet filter used to decompose thissubband. A reference to the LL leaf (getLL()). |
toString | public String toString()(Code) | | Returns subband informations in a string.
Subband informations |
|
|