int QccWAVFilterBankInitialize(QccWAVFilterBank
*filter_bank);
int QccWAVFilterBankAlloc(QccWAVFilterBank *filter_bank);
void QccWAVFilterBankFree(QccWAVFilterBank *filter_bank);
int QccWAVFilterBankPrint(const
QccWAVFilterBank *filter_bank);
The main component of a QccWAVFilterBank structure is a set of four QccFilter structures; each of these structures contain the filter coefficients for the two analysis filters (highpass and lowpass) and the two synthesis filters (highpass and lowpass) of a biorthogonal filter bank (orthogonal filters are supported as a special case).
typedef struct
{
QccString filename;
QccString magic_num;
int major_version;
int minor_version;
int orthogonality;
QccFilter lowpass_analysis_filter;
QccFilter highpass_analysis_filter;
QccFilter lowpass_synthesis_filter;
QccFilter highpass_synthesis_filter;
} QccWAVFilterBank;
The fields of QccWAVFilterBank are as follows:
The FBK file format consists of the following information:
where FBK is the magic number, X.X is the version number, <white space> is white space and/or comment lines, orthogonality is the orthogonality of the filter bank (one of QCCWAVFILTERBANK_ORTHOGONAL, QCCWAVFILTERBANK_BIORTHOGONAL, or QCCWAVFILTERBANK_GENERAL), causality is the causality of the first filter (one of QCCFILTER_CAUSAL or QCCFILTER_ANTICAUSAL), and coefficients are the first filter coefficients listed in order of increasing indices. If there are other filters in the file (see below), the causality, length, and coefficients of these follow in turn.FBKX.X
<white space>
orthogonality
causality
length
coefficients
.
.
.
For an orthogonal filter bank, the FBK file contains only one set of filter coefficients, those of the scaling filter (i.e., the lowpass synthesis filter); the other three filters can be obtained by a call to QccWAVFilterBankMakeOrthogonal(3) .
For a biorthogonal filter bank, the FBK file contains two sets of filter coefficients. The first filter in the file is the primary scaling filter (i.e, the lowpass synthesis filter); the second filter is the dual scaling filter (i.e., the lowpass analysis filter). The other two filters (the two wavelet or highpass filters) can by obtained by a call to QccWAVFilterBankMakeBiorthogonal(3) .
For a QCCWAVFILTERBANK_GENERAL type of filter bank, all four filters are stored in the file, in the order of lowpass analysis, highpass analysis, lowpass synthesis, and highpass synthesis.
QccFilterInitialize(3) is called for each of the four filters.filename: NULL string
magic_num: QCCFILTERBANK_MAGICNUM
major_version, minor_version: initialized to output of QccGetQccPackVersion(3)
orthogonality: -1 (undefined)
QccWAVFilterBankAlloc() allocates the filter bank by calling QccFilterAlloc(3) for each of the four filters of the filter bank. The lengths of each of the four filters must be set prior to calling QccWAVFilterBankAlloc().
QccWAVFilterBankFree() frees the filter bank by calling QccFilterFree(3) for each of the four filters of the filter bank.
QccWAVFilterBankPrint() prints the contents of filter_bank to stdout.
M. Antonini, M. Barlaud, P. Mathieu, and I. Daubechies, "Image Coding Using Wavelet Transform," IEEE Transactions on Image Processing, vol. 1, pp. 205-220, April 1992.