Wavelet transform


Data Structures

struct  filter_t_tag
struct  filterbank_t_tag

Defines

#define MODE_NORMAL   0
#define MODE_OTLPF   1
#define CAUSAL   0
#define ANTICAUSAL   1
#define SYMMETRIC_WHOLE   2
#define SYMMETRIC_HALF   3
#define LOWPASS_ANALYSIS   0
#define HIGHPASS_ANALYSIS   1
#define LOWPASS_SYNTHESIS   2
#define HIGHPASS_SYNTHESIS   3
#define ORTHOGONAL   0
#define BIORTHOGONAL   1
#define PHASE_EVEN   0
#define PHASE_ODD   1

Typedefs

typedef struct filter_t_tag filter_t
typedef struct filterbank_t_tag filterbank_t

Functions

local int periodic_extension (int index, int length)
local int symmetric_W_extension (int index, int length)
local int symmetric_H_extension (int index, int length)
local void downsample_signal (coeff_t *input_signal, coeff_t *output_signal, int input_length, int output_length, int phase)
local void upsample_signal (coeff_t *input_signal, coeff_t *output_signal, int input_length, int output_length, int phase)
local void filter_periodic (coeff_t *input_signal, coeff_t *output_signal, int signal_length, filter_t *filter)
local void filter_symmetric (coeff_t *input_signal, coeff_t *output_signal, int signal_length, filter_t *filter)
local void analysis_1D (coeff_t *input_signal, coeff_t *output_signal, coeff_t *temp, int signal_length, filterbank_t *fb)
local void synthesis_1D (coeff_t *input_signal, coeff_t *output_signal, coeff_t *temp1, coeff_t *temp2, coeff_t *temp3, int signal_length, filterbank_t *fb)
void analysis_2D (coeff_t **input_signal, coeff_t **output_signal, int signal_length, int mode, filterbank_t *fb)
void synthesis_2D (coeff_t **input_signal, coeff_t **output_signal, int signal_length, int mode, filterbank_t *fb)

Variables

filterbank_tfilterbanks []

Detailed Description


Define Documentation

#define MODE_NORMAL   0

Normal mode

This mode assumes that image is square and height = width = 2 ^ N.

Referenced by analysis_2D(), speck_init(), and synthesis_2D().

#define MODE_OTLPF   1

OTLPF mode

This mode also assumes that image is square, but height = width = (2 ^ N) + 1. In a few words, OTLPF is some kind of hack to reduce boundary artefacts when image is broken into several tiles. Due to mathematical constrains this method can be applied to biorthogonal filters only. For more information see references.

Referenced by analysis_2D(), and synthesis_2D().

#define CAUSAL   0

Causal filter: h[i] = 0, i < 0

Referenced by filter_periodic().

#define ANTICAUSAL   1

Anticausal filter: h[i] = 0, i > 0

Referenced by filter_periodic().

#define SYMMETRIC_WHOLE   2

Symmetric-whole filter: h[-i] = h[i]

Referenced by filter_symmetric().

#define SYMMETRIC_HALF   3

Symmetric-half filter: h[-i] = h[i - 1]

#define LOWPASS_ANALYSIS   0

Lowpass analysis filter

Referenced by filter_symmetric().

#define HIGHPASS_ANALYSIS   1

Highpass analysis filter

Referenced by filter_symmetric().

#define LOWPASS_SYNTHESIS   2

Lowpass synthesis filter

#define HIGHPASS_SYNTHESIS   3

Highpass synthesis filter

#define ORTHOGONAL   0

#define BIORTHOGONAL   1

Biothogonal filterbank

Referenced by analysis_1D(), eps_get_fb_info(), and synthesis_1D().

#define PHASE_EVEN   0

Even subsampling phase

Referenced by analysis_1D(), and synthesis_1D().

#define PHASE_ODD   1

Odd subsampling phase

Referenced by analysis_1D(), and synthesis_1D().


Typedef Documentation

typedef struct filter_t_tag filter_t

Filter structure

This structure represents a standalone filter.

Note:
There is no need to keep all coefficients for symmetric filters. Only half (h[i], i >= 0) of them is kept.

Filterbank structure

Filter bank consists of two filter pairs.


Function Documentation

local int periodic_extension ( int  index,
int  length 
) [inline]

Periodic signal extension

This function extends signal in a periodic fashion. For example: ... 2 3 4 | 1 2 3 4 | 1 2 3 ... This kind of extension is used with orthogonal filters.

Parameters:
index Sample index
length Signal length
Returns:
Real sample index within array bounds
Note:
Actually, signal is not extended as the function name states. This function just computes real sample index within array bounds.

References ABS.

Referenced by filter_periodic().

local int symmetric_W_extension ( int  index,
int  length 
) [inline]

Symmetric-whole signal extension

This function extends signal in symmetric-whole fasion. For example: ... 4 3 2 | 1 2 3 4 | 3 2 1 ... This kind of extension is used with biorthogonal filters of odd length.

Parameters:
index Sample index
length Signal length
Returns:
Real sample index within array bounds
Note:
Actually, signal is not extended as the function name states. This function just computes real sample index within array bounds.

References ABS.

Referenced by filter_symmetric().

local int symmetric_H_extension ( int  index,
int  length 
) [inline]

Symmetric-half signal extension

This function extends signal in symmetric-half fasion. For example: ... 3 2 1 | 1 2 3 4 | 4 3 2 ... (i.e. boundary samples are duplicated). This kind of extension is used with biorthogonal filters of even length.

Parameters:
index Sample index
length Signal length
Returns:
Real sample index within array bounds
Note:
Actually, signal is not extended as the function name states. This function just computes real sample index within array bounds.

References ABS.

local void downsample_signal ( coeff_t input_signal,
coeff_t output_signal,
int  input_length,
int  output_length,
int  phase 
) [inline]

Signal downsampling

This function downsamples signal by the factor of two. Depending on phase, PHASE_EVEN or PHASE_ODD, odd-numbered (1, 3, 5, ...) or even-numbered (0, 2, 4, ...) samples are rejected respectively.

Parameters:
input_signal Input signal
output_signal Output signal
input_length Input signal length
output_length Output signal length
phase Downsampling phase
Returns:
VOID
Note:
Caller must allocate enough space for output_signal beforehand.

Referenced by analysis_1D().

local void upsample_signal ( coeff_t input_signal,
coeff_t output_signal,
int  input_length,
int  output_length,
int  phase 
) [inline]

Signal upsampling

This function is inverse to the previous one. It inserts zeros between input_signal samples. Depending on phase, PHASE_EVEN or PHASE_ODD, zeros are insered into the odd-numbered (1, 3, 5, ...) or even-numbered (0, 2, 4, ...) positions respectively.

Parameters:
input_signal Input signal
output_signal Output signal
input_length Input signal length
output_length Output signal length
phase Upsampling phase
Returns:
VOID
Note:
Caller must allocate enough space for output_signal beforehand.

Referenced by synthesis_1D().

local void filter_periodic ( coeff_t input_signal,
coeff_t output_signal,
int  signal_length,
filter_t filter 
) [inline]

Periodic signal filtering

This function filters input_signal of length signal_length into the output_signal using specified filter. Boundary samples are evaluated using peridic extension.

Parameters:
input_signal Input signal
output_signal Output signal
signal_length Signal length
filter Filter
Returns:
VOID
Note:
filter must be orthogonal.

signal_length must be even.

References ANTICAUSAL, CAUSAL, filter_t_tag::causality, filter_t_tag::coeffs, filter_t_tag::length, and periodic_extension().

Referenced by analysis_1D(), and synthesis_1D().

local void filter_symmetric ( coeff_t input_signal,
coeff_t output_signal,
int  signal_length,
filter_t filter 
) [inline]

Symmetric signal filtering

This function filters input_signal of length signal_length into the output_signal using specified filter. Boundary samples are evaluated using symmetric extension.

Parameters:
input_signal Input signal
output_signal Output signal
signal_length Signal length
filter Filter
Returns:
VOID
Note:
filter must be biorthogonal.

signal_length can be either even or odd.

Todo:
Add support for even-length biorthogonal filters.

References filter_t_tag::causality, filter_t_tag::coeffs, HIGHPASS_ANALYSIS, filter_t_tag::length, LOWPASS_ANALYSIS, symmetric_W_extension(), SYMMETRIC_WHOLE, and filter_t_tag::type.

Referenced by analysis_1D(), and synthesis_1D().

local void analysis_1D ( coeff_t input_signal,
coeff_t output_signal,
coeff_t temp,
int  signal_length,
filterbank_t fb 
)

One dimensional wavelet decomposition

This function performes one stage of 1D wavelet decomposition of input_signal using filter bank fb. The result is stored in output_signal. This operation requires one temporary array of length signal_length. On return, the first half of output_signal will be occupied with lowpass coefficients, the second half - with highpass coefficients.

Parameters:
input_signal Input signal
output_signal Output signal
temp Temporary array
signal_length Signal length
fb Filter bank
Returns:
VOID
Note:
If signal_length is odd and fb is biorthogonal, then there will be one extra lowpass coefficient.

References BIORTHOGONAL, downsample_signal(), filter_periodic(), filter_symmetric(), filterbank_t_tag::highpass_analysis, filterbank_t_tag::lowpass_analysis, ORTHOGONAL, PHASE_EVEN, PHASE_ODD, SQRT2, and filterbank_t_tag::type.

Referenced by analysis_2D().

local void synthesis_1D ( coeff_t input_signal,
coeff_t output_signal,
coeff_t temp1,
coeff_t temp2,
coeff_t temp3,
int  signal_length,
filterbank_t fb 
)

One dimensional wavelet reconstruction

This function performes one stage of 1D wavelet reconstruction of input_signal using filter bank fb. The result is stored in output_signal. This operation requires tree temporary arrays of length signal_length.

Parameters:
input_signal Input signal
output_signal Output signal
temp1 Temporary array 1
temp2 Temporary array 2
temp3 Temporary array 3
signal_length Signal length
fb Filter bank
Returns:
VOID

References BIORTHOGONAL, filter_periodic(), filter_symmetric(), filterbank_t_tag::highpass_synthesis, filterbank_t_tag::lowpass_synthesis, ORTHOGONAL, PHASE_EVEN, PHASE_ODD, SQRT2, filterbank_t_tag::type, and upsample_signal().

Referenced by synthesis_2D().

void analysis_2D ( coeff_t **  input_signal,
coeff_t **  output_signal,
int  signal_length,
int  mode,
filterbank_t fb 
)

Two dimensional wavelet decomposition

This function performes N stages of 2D wavelet decomposition of input_signal using filter bank fb. Image is assumed to be square: if mode = MODE_NORMAL, then width = height = signal_length = 2 ^ N; if mode = MODE_OTLPF, then width = height = signal_length = (2 ^ N) + 1.

Parameters:
input_signal Input signal
output_signal Output signal
signal_length Signal length (width = height)
mode Either MODE_NORMAL or MODE_OTLPF
fb Filter bank
Returns:
VOID

References analysis_1D(), daub97lift_analysis_1D_even(), daub97lift_analysis_1D_odd(), filterbank_t_tag::id, MODE_NORMAL, MODE_OTLPF, number_of_bits(), and xmalloc().

Referenced by eps_encode_grayscale_block(), and eps_encode_truecolor_block().

void synthesis_2D ( coeff_t **  input_signal,
coeff_t **  output_signal,
int  signal_length,
int  mode,
filterbank_t fb 
)

Two dimensional wavelet reconstruction

This function performes N stages of 2D wavelet reconstruction of input_signal using filter bank fb. Image is assumed to be square: if mode = MODE_NORMAL, then width = height = signal_length = 2 ^ N; if mode = MODE_OTLPF, then width = height = signal_length = (2 ^ N) + 1.

Parameters:
input_signal Input signal
output_signal Output signal
signal_length Signal length (width = height)
mode Either MODE_NORMAL or MODE_OTLPF
fb Filter bank
Returns:
VOID

References daub97lift_synthesis_1D_even(), daub97lift_synthesis_1D_odd(), filterbank_t_tag::id, MODE_NORMAL, MODE_OTLPF, number_of_bits(), synthesis_1D(), and xmalloc().

Referenced by eps_decode_grayscale_block(), and eps_decode_truecolor_block().


Variable Documentation

External array of all available filter banks

This array hold pointers to all available filter banks. Last element is always NULL.

Referenced by eps_get_fb_info(), and get_fb().


Generated on Fri May 27 14:50:00 2011 for EPSILON by  doxygen 1.5.6