001: /*
002: * $RCSfile: SynWTFilter.java,v $
003: * $Revision: 1.1 $
004: * $Date: 2005/02/11 05:02:34 $
005: * $State: Exp $
006: *
007: * Class: SynWTFilter
008: *
009: * Description: The abstract class for all synthesis wavelet
010: * filters.
011: *
012: *
013: *
014: * COPYRIGHT:
015: *
016: * This software module was originally developed by Raphaël Grosbois and
017: * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel
018: * Askelöf (Ericsson Radio Systems AB); and Bertrand Berthelot, David
019: * Bouchard, Félix Henry, Gerard Mozelle and Patrice Onno (Canon Research
020: * Centre France S.A) in the course of development of the JPEG2000
021: * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This
022: * software module is an implementation of a part of the JPEG 2000
023: * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio
024: * Systems AB and Canon Research Centre France S.A (collectively JJ2000
025: * Partners) agree not to assert against ISO/IEC and users of the JPEG
026: * 2000 Standard (Users) any of their rights under the copyright, not
027: * including other intellectual property rights, for this software module
028: * with respect to the usage by ISO/IEC and Users of this software module
029: * or modifications thereof for use in hardware or software products
030: * claiming conformance to the JPEG 2000 Standard. Those intending to use
031: * this software module in hardware or software products are advised that
032: * their use may infringe existing patents. The original developers of
033: * this software module, JJ2000 Partners and ISO/IEC assume no liability
034: * for use of this software module or modifications thereof. No license
035: * or right to this software module is granted for non JPEG 2000 Standard
036: * conforming products. JJ2000 Partners have full right to use this
037: * software module for his/her own purpose, assign or donate this
038: * software module to any third party and to inhibit third parties from
039: * using this software module for non JPEG 2000 Standard conforming
040: * products. This copyright notice must be included in all copies or
041: * derivative works of this software module.
042: *
043: * Copyright (c) 1999/2000 JJ2000 Partners.
044: *
045: *
046: *
047: */
048:
049: package jj2000.j2k.wavelet.synthesis;
050:
051: import jj2000.j2k.wavelet.*;
052: import jj2000.j2k.codestream.*;
053: import jj2000.j2k.io.*;
054: import jj2000.j2k.*;
055: import java.io.*;
056:
057: /**
058: * This abstract class defines the methods of all synthesis wavelet
059: * filters. Specialized abstract classes that work on particular data
060: * types (int, float) provide more specific method calls while
061: * retaining the generality of this one. See the SynWTFilterInt
062: * and SynWTFilterFloat classes. Implementations of snythesis
063: * filters should inherit from one of those classes.
064: *
065: * <P>The length of the output signal is always the sum of the length
066: * of the low-pass and high-pass input signals.
067: *
068: * <P>All synthesis wavelet filters should follow the following conventions:
069: *
070: * <P>- The first sample of the output corresponds to the low-pass
071: * one. As a consequence, if the output signal is of odd-length then
072: * the low-pass input signal is one sample longer than the high-pass
073: * input one. Therefore, if the length of output signal is N, the
074: * low-pass input signal is of length N/2 if N is even and N/2+1/2 if
075: * N is odd, while the high-pass input signal is of length N/2 if N
076: * is even and N/2-1/2 if N is odd.
077: *
078: * <P>- The normalization of the analysis filters is 1 for the DC gain
079: * and 2 for the Nyquist gain (Type I normalization), for both
080: * reversible and non-reversible filters. The normalization of the
081: * synthesis filters should ensure prefect reconstruction according to
082: * this normalization of the analysis wavelet filters.
083: *
084: * <P>The synthetize method may seem very complicated, but is designed to
085: * minimize the amount of data copying and redundant calculations when
086: * used for block-based or line-based wavelet transform
087: * implementations, while being applicable to full-frame transforms as
088: * well.
089: *
090: * @see SynWTFilterInt
091: *
092: * @see SynWTFilterFloat
093: * */
094: public abstract class SynWTFilter implements WaveletFilter, Markers {
095:
096: /**
097: * Reconstructs the output signal by the synthesis filter,
098: * recomposing the low-pass and high-pass input signals in one
099: * output signal. This method performs the upsampling and
100: * fitering with the low pass first filtering convention.
101: *
102: * <P>The input low-pass (high-pass) signal resides in the lowSig
103: * array. The index of the first sample to filter (i.e. that will
104: * generate the first (second) output sample). is given by lowOff
105: * (highOff). This array must be of the same type as the one for
106: * which the particular implementation works with (which is
107: * returned by the getDataType() method).
108: *
109: * <P>The low-pass (high-pass) input signal can be interleaved
110: * with other signals in the same lowSig (highSig) array, and this
111: * is determined by the lowStep (highStep) argument. This means
112: * that the first sample of the low-pass (high-pass) input signal
113: * is lowSig[lowOff] (highSig[highOff]), the second is
114: * lowSig[lowOff+lowStep] (highSig[highOff+highStep]), the third
115: * is lowSig[lowOff+2*lowStep] (highSig[highOff+2*highStep]), and
116: * so on. Therefore if lowStep (highStep) is 1 there is no
117: * interleaving. This feature allows to filter columns of a 2-D
118: * signal, when it is stored in a line by line order in lowSig
119: * (highSig), without having to copy the data, in this case the
120: * lowStep (highStep) argument should be the line width of the
121: * low-pass (high-pass) signal.
122: *
123: * <P>The output signal is placed in the outSig array. The outOff
124: * and outStep arguments are analogous to the lowOff and lowStep
125: * ones, but they apply to the outSig array. The outSig array must
126: * be long enough to hold the low-pass output signal.
127: *
128: * @param lowSig This is the array that contains the low-pass
129: * input signal. It must be of the correct type (e.g., it must be
130: * int[] if getDataType() returns TYPE_INT).
131: *
132: * @param lowOff This is the index in lowSig of the first sample to
133: * filter.
134: *
135: * @param lowLen This is the number of samples in the low-pass
136: * input signal to filter.
137: *
138: * @param lowStep This is the step, or interleave factor, of the
139: * low-pass input signal samples in the lowSig array. See above.
140: *
141: * @param highSig This is the array that contains the high-pass
142: * input signal. It must be of the correct type (e.g., it must be
143: * int[] if getDataType() returns TYPE_INT).
144: *
145: * @param highOff This is the index in highSig of the first sample to
146: * filter.
147: *
148: * @param highLen This is the number of samples in the high-pass
149: * input signal to filter.
150: *
151: * @param highStep This is the step, or interleave factor, of the
152: * high-pass input signal samples in the highSig array. See above.
153: *
154: * @param outSig This is the array where the output signal is
155: * placed. It must be of the same type as lowSig and it should be
156: * long enough to contain the output signal.
157: *
158: * @param outOff This is the index in outSig of the element where
159: * to put the first output sample.
160: *
161: * @param outStep This is the step, or interleave factor, of the
162: * output samples in the outSig array. See above.
163: *
164: *
165: *
166: *
167: * */
168: public abstract void synthetize_lpf(Object lowSig, int lowOff,
169: int lowLen, int lowStep, Object highSig, int highOff,
170: int highLen, int highStep, Object outSig, int outOff,
171: int outStep);
172:
173: /**
174: * Reconstructs the output signal by the synthesis filter,
175: * recomposing the low-pass and high-pass input signals in one
176: * output signal. This method performs the upsampling and
177: * fitering with the high pass first filtering convention.
178: *
179: * <P>The input low-pass (high-pass) signal resides in the lowSig
180: * array. The index of the first sample to filter (i.e. that will
181: * generate the first (second) output sample). is given by lowOff
182: * (highOff). This array must be of the same type as the one for
183: * which the particular implementation works with (which is
184: * returned by the getDataType() method).
185: *
186: * <P>The low-pass (high-pass) input signal can be interleaved
187: * with other signals in the same lowSig (highSig) array, and this
188: * is determined by the lowStep (highStep) argument. This means
189: * that the first sample of the low-pass (high-pass) input signal
190: * is lowSig[lowOff] (highSig[highOff]), the second is
191: * lowSig[lowOff+lowStep] (highSig[highOff+highStep]), the third
192: * is lowSig[lowOff+2*lowStep] (highSig[highOff+2*highStep]), and
193: * so on. Therefore if lowStep (highStep) is 1 there is no
194: * interleaving. This feature allows to filter columns of a 2-D
195: * signal, when it is stored in a line by line order in lowSig
196: * (highSig), without having to copy the data, in this case the
197: * lowStep (highStep) argument should be the line width of the
198: * low-pass (high-pass) signal.
199: *
200: * <P>The output signal is placed in the outSig array. The outOff
201: * and outStep arguments are analogous to the lowOff and lowStep
202: * ones, but they apply to the outSig array. The outSig array must
203: * be long enough to hold the low-pass output signal.
204: *
205: * @param lowSig This is the array that contains the low-pass
206: * input signal. It must be of the correct type (e.g., it must be
207: * int[] if getDataType() returns TYPE_INT).
208: *
209: * @param lowOff This is the index in lowSig of the first sample to
210: * filter.
211: *
212: * @param lowLen This is the number of samples in the low-pass
213: * input signal to filter.
214: *
215: * @param lowStep This is the step, or interleave factor, of the
216: * low-pass input signal samples in the lowSig array. See above.
217: *
218: * @param highSig This is the array that contains the high-pass
219: * input signal. It must be of the correct type (e.g., it must be
220: * int[] if getDataType() returns TYPE_INT).
221: *
222: * @param highOff This is the index in highSig of the first sample to
223: * filter.
224: *
225: * @param highLen This is the number of samples in the high-pass
226: * input signal to filter.
227: *
228: * @param highStep This is the step, or interleave factor, of the
229: * high-pass input signal samples in the highSig array. See above.
230: *
231: * @param outSig This is the array where the output signal is
232: * placed. It must be of the same type as lowSig and it should be
233: * long enough to contain the output signal.
234: *
235: * @param outOff This is the index in outSig of the element where
236: * to put the first output sample.
237: *
238: * @param outStep This is the step, or interleave factor, of the
239: * output samples in the outSig array. See above.
240: *
241: *
242: *
243: *
244: * */
245: public abstract void synthetize_hpf(Object lowSig, int lowOff,
246: int lowLen, int lowStep, Object highSig, int highOff,
247: int highLen, int highStep, Object outSig, int outOff,
248: int outStep);
249:
250: }
|