]> Dirac: Wavelet transform
Dirac Home
Navigation item arrowHome
Navigation item arrowDocumentation
Navigation item arrowDirac Algorithm
Navigation item arrowContents
Navigation item arrowIntroduction
Navigation item arrowArchitecture
Navigation item arrowRDO
Navigation item arrowTransform coding
Navigation item arrowMotion estimation
Navigation item arrowMacroblocks
Navigation item arrowMotion vector coding

SourceForge.net Logo
Valid XHTML 1.1!
Wavelet transform

Previous: Transform coding architecture
Next: Parent-Child relationships

The discrete wavelet transform is now extremely well-known and is described in numerous references. In Dirac it plays the same role of the DCT in MPEG-2 in decorrelating data in a roughly frequency-sensitive way, whilst having the advantage of preserving fine details better. In one dimension it consists of the iterated application of a complementary pair of half-band filters followed by subsampling by a factor 2:

Downloading a GIF rendering as your browser doesn't support SVG. Please ignore the "install additional plugins" message if you see it. More details Sorry, your browser can't connect to the server to download a GIF substitute.
        Either install an SVG-enabled browser or connect to the internet to download the diagram.

Figure: Perfect reconstruction analysis and synthesis filter pairs

These filters are termed the analysis filters. Corresponding synthesis filters can undo the aliasing introduced by the critical sampling and perfectly reconstruct the input. Clearly not just any pair of half-band filters can do this, and there is an extensive mathematical theory of wavelet filter banks. The filters split the signal into a LH and HF part; the wavelet transform then iteratively decomposes the LF component to produce an octave-band decomposition of the signal.

Applied to two-dimensional images, wavelet filters are normally applied in both vertical and horizontal directions to each image component to produce four so-called subbands termed Low-Low (LL), Low-High (LH), High-Low (HL) and High-High (HH). In the case of two dimensions, only the LL band is iteratively decomposed to obtain the decomposition of the two-dimensional spectrum shown below:

Downloading a GIF rendering as your browser doesn't support SVG. Please ignore the "install additional plugins" message if you see it. More details Sorry, your browser can't connect to the server to download a GIF substitute.
        Either install an SVG-enabled browser or connect to the internet to download the diagram.

Figure: wavelet transform frequency decomposition

The number of samples in each resulting subband is as implied by the diagram: the critical sampling ensures that after each decomposition the resulting bands all have one quarter of the samples of the input signal.

photograph of girl (LENA) decomposed by 3-level wavelet transform

Figure: 3-level wavelet transform of LENA

Wavelet filters

The choice of wavelet filters has an impact on compression performance, filters having to have both compact impulse response in order to reduce ringing artefacts and other properties in order to represent smooth areas compactly. It also has an impact on encoding and decoding speed in software.

There are numerous filters supported by Dirac to allow a trade-off between complexity and performance. These are configurable in the reference software. These filters are all defined using the 'lifting scheme' for speed.

The lifting stages are defined as follows. One fiter available in Dirac is a lifting approximation of the Daubechies (9,7) wavelet: for this we have (s denoting sum and d denoting difference),

s n 0 = x 2n d n 0 = x 2n+1 d n 1 =  d n 0 -(6497(  s n 0  + s n+1 0 ))/4096 s n 1 =  s n 0 -(217(  d n 1  + d n-1 1 ))/4096 d n 2 =  d n 1 +(3616(  s n 1  + s n+1 1 ))/4096 s n 2 =  s n 1 +(1817(  d n 2  + d n-1 2 ))/4096

The magic numbers are integer approximations of the Daubechies lifting ceofficients. This makes the transform fully invertible, where a floating point implementation wouldn't quite be. The implementation ignores scaling coefficients, since these can be taken into account in quantiser selection by weighting quantiser noise appropriately. The problem with this filter is that it has four lifting stages, and so it takes longer in software. At the other extreme, there is the (5,3) filter:

d n 1 =  d n 0 -(  s n 0  + s n+1 0 )/2 s n 1 =  s n 0 +(  d n 1  + d n-1 1 )/4

We can improve the (5,3) high pass filter, and get an approximating of the Daubechies low-pass filter by having more taps in the first lifing stage. This is the Deslauriers-Dubuc (9,7) filter:

d n 1 =  d n 0 -(-  s n-1 0 +9 s n 0  +9 s n+1 0 - s n+2 0 )/16 s n 1 =  s n 0 +(  d n 1  + d n-1 1 )/4

The Deslauriers-Dubuc (13,7) extends this further to provide better frequency selectivity in the low pass filter, still only using two lifting stages:

d n 1 =  d n 0 -(-  s n-1 0 +9 s n 0  +9 s n+1 0 - s n+2 0 )/16 s n 1 =  s n 0 +(-  d n+1 1  + 9 d n 1  +9 d n-1 1 - d n-2 1 )/32

Padding and invertibility

Clearly, applying an N-level wavelet transform requires N levels of subsamplings, and so for reversibility, it is necessary that 2N divides all the dimensions of each component. So if this condition is not met, the input picture components are padded as they are read in, by edge values for best compression performance.

Previous: Transform coding architecture
Next: Parent-Child relationships