www.pudn.com > EZW_.rar > FILTER.H
#ifndef __FILTER_H_ #define __FILTER_H_ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* Port to C from C++ * * Mow-Song, Ng 2/9/2002 * msng@mmu.edu.my * http://www.pesona.mmu.edu.my/~msng * * I do not claim copyright to the code, but if you use them or modify them, * please drop me a mail. * */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* * $LOG * ---- * - Found a bug in the symmetry of filter, it was never set!!! * If the wavelet transform is called without specifying the symmetry * (==-1), then it will rely on the symmetry of the wavelet used. * In my code, since I used biorthogonal filters most of the time, I have * specify the symmetry as TRUE. This is alright for filters like Antonini, * Adelson, Villa1810 etc. However, the problem appears in orthogonal * filters like Haar, Daub4, Daub6 and Daub8, which requires that the * symmetry set to FALSE to use periodic extension. * */ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /* Original copyright info */ /*---------------------------------------------------------------------------*/ // Baseline Wavelet Transform Coder Construction Kit // // Geoff Davis // gdavis@cs.dartmouth.edu // http://www.cs.dartmouth.edu/~gdavis // // Copyright 1996 Geoff Davis 9/11/96 // // Permission is granted to use this software for research purposes as // long as this notice stays attached to this software. // /*---------------------------------------------------------------------------*/ #include#include #include #include "global.h" #include "memchk.h" typedef struct FilterStruct { int size, firstIndex, center; Real *coeff; } FILTER; typedef struct FilterSetStruct { int symmetric; FILTER *analysisLow; FILTER *analysisHigh; FILTER *synthesisLow; FILTER *synthesisHigh; } FILTERSET; /* FILTER */ FILTER * FilterAllocDef(void); FILTER * FilterAlloc(int size, int firstIndex, Real *coeff); FILTER * FilterAllocCopy(FILTER *filterSrc); void FilterDealloc(FILTER *filter); void FilterInit(FILTER *filter, int size, int firstIndex, Real *coeff); Real FilterCoeff(FILTER *filter, int index); void FilterCopy(FILTER *filterDest, FILTER *filterSrc); /* FILTERSET */ FILTERSET * FilterSetAllocDef(void); FILTERSET * FilterSetAlloc(int symmetric, Real *anLow, int anLowSize, int anLowFirst, Real *synLow, int synLowSize, int synLowFirst); FILTERSET * FilterSetAllocCopy(FILTERSET *filtersetSrc); void FilterSetDealloc(FILTERSET *filterset); void FilterSetCopy(FILTERSET *filtersetDest, FILTERSET *filtersetSrc); void InitializeFilterSets(void); void RemoveFilterSets(void); void FilterError(char *fmt, ...); void FilterWarning(char *fmt, ...); #endif