📄 subbandan.java
字号:
/*
* CVS identifier:
*
* $Id: SubbandAn.java,v 1.29 2000/09/05 09:26:01 grosbois Exp $
*
* Class: SubbandAn
*
* Description: Element for a tree structure for a descripotion
* of subbands on the anslysis side.
*
*
*
* COPYRIGHT:
*
* This software module was originally developed by Rapha雔 Grosbois and
* Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel
* Askel鰂 (Ericsson Radio Systems AB); and Bertrand Berthelot, David
* Bouchard, F閘ix Henry, Gerard Mozelle and Patrice Onno (Canon Research
* Centre France S.A) in the course of development of the JPEG2000
* standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This
* software module is an implementation of a part of the JPEG 2000
* Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio
* Systems AB and Canon Research Centre France S.A (collectively JJ2000
* Partners) agree not to assert against ISO/IEC and users of the JPEG
* 2000 Standard (Users) any of their rights under the copyright, not
* including other intellectual property rights, for this software module
* with respect to the usage by ISO/IEC and Users of this software module
* or modifications thereof for use in hardware or software products
* claiming conformance to the JPEG 2000 Standard. Those intending to use
* this software module in hardware or software products are advised that
* their use may infringe existing patents. The original developers of
* this software module, JJ2000 Partners and ISO/IEC assume no liability
* for use of this software module or modifications thereof. No license
* or right to this software module is granted for non JPEG 2000 Standard
* conforming products. JJ2000 Partners have full right to use this
* software module for his/her own purpose, assign or donate this
* software module to any third party and to inhibit third parties from
* using this software module for non JPEG 2000 Standard conforming
* products. This copyright notice must be included in all copies or
* derivative works of this software module.
*
* Copyright (c) 1999/2000 JJ2000 Partners.
*
*
*
*/
package jj2000.j2k.wavelet.analysis;
import jj2000.j2k.wavelet.*;
/**
* This class represents a subband in a bidirectional tree structure
* that describes the subband decomposition for a wavelet transform,
* specifically for the analysis side.
*
* <P>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 there are no descendants.
*
* <P>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.
* */
public class SubbandAn extends Subband {
/**
* The reference to the parent of this subband. It is null for the
* root element. It is null by default. */
public SubbandAn parent = null;
/**
* The reference to the LL subband resulting from the
* decomposition of this subband. It is null by default. */
public SubbandAn subb_LL;
/**
* The reference to the HL subband (horizontal high-pass)
* resulting from the decomposition of this subband. It is null by
* default. */
public SubbandAn subb_HL;
/**
* The reference to the LH subband (vertical high-pass) resulting
* from the decomposition of this subband. It is null by default.
* */
public SubbandAn subb_LH;
/**
* The reference to the HH subband resulting from the
* decomposition of this subband. It is null by default.
*/
public SubbandAn subb_HH;
/** The horizontal analysis filter used to decompose this
subband. This is applicable to "node" elements only. The
default value is null. */
public AnWTFilter hFilter;
/** The vertical analysis filter used to decompose this
subband. This is applicable to "node" elements only. The
default value is null. */
public AnWTFilter vFilter;
/**
* The L2-norm of the synthesis basis waveform of this subband,
* applicable to "leafs" only. By default it is -1 (i.e. not
* calculated yet).
* */
public float l2Norm = -1.0f;
/**
* The contribution to the MSE or WMSE error that would result in the
* image if there was an error of exactly one quantization step size in
* the sample of the subband. This value is expressed relative to a
* nominal dynamic range in the image domain of exactly 1.0. This field
* contains valid data only after quantization 9See Quantizer).
*
* @see jj2000.j2k.quantization.quantizer.Quantizer
* */
public float stepWMSE;
/**
* Creates a SubbandAn element with all the default values. The
* dimensions are (0,0) and the upper left corner is (0,0).
*
*
* */
public SubbandAn() {
}
/**
* 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.
*
* <P>This constructor just calls the same constructor of the
* super class, and then calculates the L2-norm (or energy weight)
* of each leaf.
*
* <P>This constructor does not initialize the value of the magBits or
* stepWMSE member variables. This variables are normally initialized by
* the quantizer (see Quantizer).
*
* @param w The top-level width
*
* @param h The top-level height
*
* @param ulcx The horizontal coordinate of the upper-left corner with
* respect to the canvas origin, in the component grid.
*
* @param ulcy The vertical coordinate of the upper-left corner with
* respect to the canvas origin, in the component grid.
*
* @param lvls The number of levels (or LL decompositions) in the
* tree.
*
* @param hfilters The horizontal wavelet analysis filters for each
* resolution level, starting at resolution level 0.
*
* @param vfilters The vertical wavelet analysis filters for each
* resolution level, starting at resolution level 0.
*
* @see Subband#Subband(int,int,int,int,int,
* WaveletFilter[],WaveletFilter[])
*
* @see jj2000.j2k.quantization.quantizer.Quantizer
*
*
* */
public SubbandAn(int w, int h, int ulcx, int ulcy, int lvls,
WaveletFilter hfilters[], WaveletFilter vfilters[]) {
super(w,h,ulcx,ulcy,lvls,hfilters,vfilters);
// Caculate the L2-norms
calcL2Norms();
}
/**
* 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).
*
* @return The parent subband, or null for the root one.
*
*
* */
public Subband getParent() {
return parent;
}
/**
* Returns the LL child subband of this subband.
*
* @return The LL child subband, or null if there are no childs.
*
*
* */
public Subband getLL() {
return subb_LL;
}
/**
* Returns the HL (horizontal high-pass) child subband of this
* subband.
*
* @return The HL child subband, or null if there are no childs.
*
*
* */
public Subband getHL() {
return subb_HL;
}
/**
* Returns the LH (vertical high-pass) child subband of this
* subband.
*
* @return The LH child subband, or null if there are no childs.
*
*
* */
public Subband getLH() {
return subb_LH;
}
/**
* Returns the HH child subband of this subband.
*
* @return The HH child subband, or null if there are no childs.
*
*
* */
public Subband getHH() {
return subb_HH;
}
/**
* Splits the current subband in its four subbands. It changes the
* status of this element (from a leaf to a node, and sets the
* filters), creates the childs and initializes them. An
* IllegalArgumentException is thrown if this subband is not a
* leaf.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -