001/* 002 * $RCSfile: WaveletFilter.java,v $ 003 * $Revision: 1.1 $ 004 * $Date: 2005/02/11 05:02:28 $ 005 * $State: Exp $ 006 * 007 * Class: WaveletFilter 008 * 009 * Description: Defines the interface for WT filters (analysis 010 * and synthesis) 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 047package jj2000.j2k.wavelet; 048 049/** 050 * This interface defines how a wavelet filter implementation should 051 * present itself. This interface defines only the commonalities 052 * between the analysis and synthesis filters. The AnWTFilter 053 * and SynWTFilter classes provide the specifics of analysis and 054 * synthesis filters. 055 * 056 * <P>Both analysis and filters must be able to return the 057 * extent of the negative and positive support for both synthesis and 058 * analysis sides. This simplifies the sue of some functionalities 059 * that need extra information about the filters. 060 * 061 * @see jj2000.j2k.wavelet.analysis.AnWTFilter 062 * 063 * @see jj2000.j2k.wavelet.synthesis.SynWTFilter 064 * */ 065public interface WaveletFilter { 066 067 /** The ID for integer lifting spteps implementations */ 068 public final static int WT_FILTER_INT_LIFT = 0; 069 070 /** The ID for floating-point lifting spteps implementations */ 071 public final static int WT_FILTER_FLOAT_LIFT = 1; 072 073 /** The ID for floatring-poitn convolution implementations */ 074 public final static int WT_FILTER_FLOAT_CONVOL = 2; 075 076 /** 077 * Returns the negative support of the low-pass analysis 078 * filter. That is the number of taps of the filter in the 079 * negative direction. 080 * 081 * <P>A MORE PRECISE DEFINITION IS NEEDED 082 * 083 * @return The number of taps of the low-pass analysis filter in 084 * the negative direction 085 */ 086 public int getAnLowNegSupport(); 087 088 /** 089 * Returns the positive support of the low-pass analysis 090 * filter. That is the number of taps of the filter in the 091 * negative direction. 092 * 093 * <P>A MORE PRECISE DEFINITION IS NEEDED 094 * 095 * @return The number of taps of the low-pass analysis filter in 096 * the positive direction 097 */ 098 public int getAnLowPosSupport(); 099 100 /** 101 * Returns the negative support of the high-pass analysis 102 * filter. That is the number of taps of the filter in the 103 * negative direction. 104 * 105 * <P>A MORE PRECISE DEFINITION IS NEEDED 106 * 107 * @return The number of taps of the high-pass analysis filter in 108 * the negative direction 109 */ 110 public int getAnHighNegSupport(); 111 112 /** 113 * Returns the positive support of the high-pass analysis 114 * filter. That is the number of taps of the filter in the 115 * negative direction. 116 * 117 * <P>A MORE PRECISE DEFINITION IS NEEDED 118 * 119 * @return The number of taps of the high-pass analysis filter in 120 * the positive direction 121 */ 122 public int getAnHighPosSupport(); 123 124 /** 125 * Returns the negative support of the low-pass synthesis 126 * filter. That is the number of taps of the filter in the 127 * negative direction. 128 * 129 * <P>A MORE PRECISE DEFINITION IS NEEDED 130 * 131 * @return The number of taps of the low-pass synthesis filter in 132 * the negative direction 133 */ 134 public int getSynLowNegSupport(); 135 136 /** 137 * Returns the positive support of the low-pass synthesis 138 * filter. That is the number of taps of the filter in the 139 * negative direction. 140 * 141 * <P>A MORE PRECISE DEFINITION IS NEEDED 142 * 143 * @return The number of taps of the low-pass synthesis filter in 144 * the positive direction 145 */ 146 public int getSynLowPosSupport(); 147 148 /** 149 * Returns the negative support of the high-pass synthesis 150 * filter. That is the number of taps of the filter in the 151 * negative direction. 152 * 153 * <P>A MORE PRECISE DEFINITION IS NEEDED 154 * 155 * @return The number of taps of the high-pass synthesis filter in 156 * the negative direction 157 */ 158 public int getSynHighNegSupport(); 159 160 /** 161 * Returns the positive support of the high-pass synthesis 162 * filter. That is the number of taps of the filter in the 163 * negative direction. 164 * 165 * <P>A MORE PRECISE DEFINITION IS NEEDED 166 * 167 * @return The number of taps of the high-pass synthesis filter in 168 * the positive direction 169 */ 170 public int getSynHighPosSupport(); 171 172 /** 173 * Returns the implementation type of this filter, as defined in 174 * this class, such as WT_FILTER_INT_LIFT, WT_FILTER_FLOAT_LIFT, 175 * WT_FILTER_FLOAT_CONVOL. 176 * 177 * @return The implementation type of this filter: 178 * WT_FILTER_INT_LIFT, WT_FILTER_FLOAT_LIFT, WT_FILTER_FLOAT_CONVOL. 179 */ 180 public int getImplType(); 181 182 /** 183 * Returns the type of data on which this filter works, as defined 184 * in the DataBlk interface. 185 * 186 * @return The type of data as defined in the DataBlk interface. 187 * 188 * @see jj2000.j2k.image.DataBlk 189 */ 190 public int getDataType(); 191 192 /** 193 * Returns the reversibility of the filter. A filter is considered 194 * reversible if it is suitable for lossless coding. 195 * 196 * @return true if the filter is reversible, false otherwise. 197 */ 198 public boolean isReversible(); 199 200 /** 201 * Returns true if the wavelet filter computes or uses the 202 * same "inner" subband coefficient as the full frame wavelet transform, 203 * and false otherwise. In particular, for block based transforms with 204 * reduced overlap, this method should return false. The term "inner" 205 * indicates that this applies only with respect to the coefficient that 206 * are not affected by image boundaries processings such as symmetric 207 * extension, since there is not reference method for this. 208 * 209 * <P>The result depends on the length of the allowed overlap when 210 * compared to the overlap required by the wavelet filter. It also 211 * depends on how overlap processing is implemented in the wavelet 212 * filter. 213 * 214 * @param tailOvrlp This is the number of samples in the input 215 * signal before the first sample to filter that can be used for 216 * overlap. 217 * 218 * @param headOvrlp This is the number of samples in the input 219 * signal after the last sample to filter that can be used for 220 * overlap. 221 * 222 * @param inLen This is the lenght of the input signal to filter.The 223 * required number of samples in the input signal after the last sample 224 * depends on the length of the input signal. 225 * 226 * @return true if the overlaps are large enough and correct processing is 227 * performed, false otherwise. 228 */ 229 public boolean isSameAsFullWT(int tailOvrlp, int headOvrlp, int inLen); 230 231}