Table of Contents

NAME

QccWAVFilterBank - data structure QccWAVFilterBank and corresponding FBK file format for wavelet-based analysis/synthesis using a filter-bank implementation

SYNOPSIS

#include "libQccPack.h"

int QccWAVFilterBankInitialize(QccWAVFilterBank *filter_bank);
int QccWAVFilterBankAlloc(QccWAVFilterBank *filter_bank);
void QccWAVFilterBankFree(QccWAVFilterBank *filter_bank);
int QccWAVFilterBankPrint(const QccWAVFilterBank *filter_bank);

DESCRIPTION

QccPack provides data structure QccWAVFilterBank for representing the filter coefficients for a two-band filter bank. Such a two-band filter bank would be used for wavelet-based analysis and synthesis using filtering (as opposed to lifting; see QccWAVLiftingScheme(3) ). This filter-bank structure can be read from and written to FBK-format files, or a QccWAVFilterBank structure can be used without file input or output.

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).

DATA STRUCTURE

The QccWAVFilterBank data structure is defined as:

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:

filename
The name of the file.
magic_num, major_version, minor_version
The magic number and version of the file.
orthogonality
The orthogonality of the filter bank -- possible values are QCCWAVFILTERBANK_ORTHOGONAL, QCCWAVFILTERBANK_BIORTHOGONAL, or QCCWAVFILTERBANK_GENERAL (this last case is for when the filter bank is neither orthogonal nor biorthogonal).
lowpass_analysis_filter, highpass_analysis_filter
Filters for analysis.
lowpass_synthesis_filter, highpass_synthesis_filter
Filters for synthesis.

FILE FORMAT

For reading and writing structures of type QccWAVFilterBank, QccPack provides the FBK file format. This file format starts with an ASCII header followed by binary data. The ASCII header consists of magic-number/revision information followed by any amount of white space (space, `\t' (tab), `\n' (newline), `\r' (return)) and/or comments lines (lines starting with `#'). Following this white space, additional ASCII header information is given, separated by blanks and newlines. Binary data follows this ASCII header information.

The FBK file format consists of the following information:

FBKX.X
<white space>
orthogonality
causality
length
coefficients
.
.
.

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.

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.

ROUTINES

QccWAVFilterBankInitialize() should be called before any use of a QccWAVFilterBank structure. QccWAVFilterBankInitialize() initializes the fields of filter_bank to the following values:

filename: NULL string
magic_num: QCCFILTERBANK_MAGICNUM
major_version, minor_version: initialized to output of QccGetQccPackVersion(3)
orthogonality: -1 (undefined)

QccFilterInitialize(3) is called for each of the four filters.

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.

RETURN VALUE

These routines return 0 on success, and 1 on failure.

SEE ALSO

QccPackWAV(3) , QccPack(3)

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.

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads