Make clear that this isn't the official version
[dirac-spec-errata.git] / lifting.tex
blobfcf2c085a8662e84f76fd1b9065641f4d9cb57bc
1 \label{transformandlifting}
2 This is an informative annex introducing the fundamentals of wavelet
3 filtering and the lifting scheme.
5 \subsection{Wavelet filter banks}
7 Figure \ref{fig:decimatereconstruct} below illustrates a single stage of a
8 generalized wavelet decimation followed by reconstruction. The aim is to
9 get perfect reconstruction of the output so that it is identical to the original input.
10 \end{informative*}
11 \setlength{\unitlength}{1em}
12 \begin{figure}[!ht]
13 \begin{picture}(50,20)
14 \put(0,10){\line(1,0){5}}
15 \put(5,5){\line(0,1){10}}
17 \put(5,5){\line(1,0){2}}
18 \put(5,15){\line(1,0){2}}
20 \put(7,3){\framebox(8,4){\Large $h(-z)$}}
21 \put(7,13){\framebox(8,4){\Large $g(-z)$}}
23 \put(15,5){\line(1,0){2}}
24 \put(15,15){\line(1,0){2}}
26 \put(18.5,5){\circle{3}}\put(18,5){\Large $\downarrow 2$}
27 \put(18.5,15){\circle{3}}\put(18,15){\Large $\downarrow 2$}
29 \put(20,5){\line(1,0){2}}
30 \put(20,15){\line(1,0){2}}
32 \put(24,5){\line(1,0){2}}
33 \put(24,15){\line(1,0){2}}
35 \put(27.5,5){\circle{3}}\put(27,5){\Large $\uparrow 2$}
36 \put(27.5,15){\circle{3}}\put(27,15){\Large $\uparrow 2$}
38 \put(29,5){\line(1,0){2}}
39 \put(29,15){\line(1,0){2}}
41 \put(31,3){\framebox(8,4){\Large $\tilde{h}(z)$}}
42 \put(31,13){\framebox(8,4){\Large $\tilde{g}(z)$}}
44 \put(39,5){\line(1,0){2}}
45 \put(39,15){\line(1,0){2}}
47 \put(39.5,10){\line(1,0){6.5}}
48 \put(41,5){\line(0,1){10}}
50 \put(41,10){\circle{3}}
51 \end{picture}
52 \caption{Wavelet decimation and reconstruction}\label{fig:decimatereconstruct}
53 \end{figure}
54 \begin{informative*}
55 The filters $h(z)$ and $g(z)$ are the low-pass and high-pass analysis
56 filters, whilst $\tilde{h}(z)$ and $\tilde{g}(z)$ are the
57 synthesis filters. The filters must satisfy the conditions
58 \begin{eqnarray*}
59 h(z)\tilde{h}(z^{-1})+g(z)\tilde{g}(z^{-1}) & = & 2 \text{ (Perfect reconstruction)}\\
60 h(z)\tilde{h}(-z^{-1})+g(z)\tilde{g}(-z^{-1}) & = & 0 \text{ (Alias cancellation)}
61 \end{eqnarray*}
62 These conditions imply that the synthesis filters are derived from the analysis filters and vice-versa:
63 \begin{eqnarray*}
64 \tilde{g}(z) & = & z^{-1}h(-z^{-1}) \\
65 \tilde{h}(z) & = & z^{-1}g(-z^{-1})
66 \end{eqnarray*}
68 If we have an {\em orthogonal} wavelet decomposition, then additionally $H=\tilde{h}$ and $g=\tilde{g}$
69 and there is a single ``mother'' wavelet.
71 The next figure (F.2) illustrates how the frequency components are distributed both during decimation and reconstruction. This figures illustrates how the alias frequencies created during the decimation process are cancelled out during the reconstruction process. This feature of alias cancellation results from the wavelet process and is a specific attribute of wavelet coding. It is important to note that if the decoder receives imperfect signals (caused, for example, by quantisation errors) then the imperfections will result in distortion in the reconstructed output.
74 Figure F.2 -Illustration of the alias frequency generation and cancellation in a wavelet filter bank
75 A single wavelet stage is insufficient for most video coding applications. The figure below illustrates how only the low-pass path is passed on to the next wavelet decimation step. Because each step of the wavelet decimation is self-contained, the reconstructed output is still identical to the input (barring quantisation errors).
77 Figure F.3 -Two-step wavelet processing filter bank
78 The application of wavelet filter banks in picture coding results in a two-dimensional decimation process as illustrated in figure F.4 below.
80 Figure F.4 -Decomposition of a single image into 7 wavelet frequency bands
81 The final figure illustrates how a real image is decimated to produce a low-frequency proxy in the top-left corner and a range of increasing frequency band components extending to the right side for increasing horizontal frequencies and downwards for increasing vertical frequencies.
83 Figure F.5 -Decomposition of the EBU "Boats" picture into 7 wavelet frequency bands
85 \subsection{Lifting}
86 \label{lifting}
88 For any set of filters, the analysis and synthesis filter banks shown
89 in Figure \ref{fig:decimatereconstruct} can easily be re-expressed as polyphase
90 filter banks by means of applying {\em matrices} of filters in the subsampled
91 domain. This is shown in Figure \ref{fig:polyphase}, where $A(z)$ is the $z-$transform
92 of the analysis polyphase filter matrix, and $S(z)$ is the $z-$transform
93 of the synthesis polyphase filter matrix (the entries of both matrices being Laurent
94 polynomials).
95 \end{informative*}
96 \setlength{\unitlength}{1em}
97 \begin{figure}[!ht]
98 \begin{picture}(50,20)
99 % Analysis side
100 \put(0,9){\line(1,0){2}}
102 \put(2,5){\line(0,1){8}}
104 \put(2,5){\line(1,0){1}}\put(3,3.5){\framebox(3,3){\Large $z$}}\put(6,5){\line(1,0){1}}
105 \put(2,13){\line(1,0){5}}
107 \put(8.5,5){\circle{3}}\put(8,5){\Large $\downarrow 2$}
108 \put(8.5,13){\circle{3}}\put(8,13){\Large $\downarrow 2$}
110 \put(10,5){\line(1,0){2}}
111 \put(10,13){\line(1,0){2}}
113 \put(12,4){\framebox(8,10){\Large $A(z)$}}
115 \put(20,5){\line(1,0){1}}
116 \put(20,13){\line(1,0){1}}
118 % Synthesis side
119 \put(23,5){\line(1,0){1}}
120 \put(23,13){\line(1,0){1}}
122 \put(24,4){\framebox(8,10){\Large $S(z)$}}
124 \put(32,5){\line(1,0){2}}
125 \put(32,13){\line(1,0){2}}
127 \put(35.5,5){\circle{3}}\put(35,5){\Large $\uparrow 2$}
128 \put(35.5,13){\circle{3}}\put(35,13){\Large $\uparrow 2$}
130 \put(37,5){\line(1,0){1}}\put(38,3.5){\framebox(3,3){\Large $z^{-1}$}}\put(41,5){\line(1,0){1}}
131 \put(37,13){\line(1,0){5}}
134 \put(41,9){\line(1,0){4}}
135 \put(42,5){\line(0,1){8}}
137 \put(42,9){\circle{2}}
139 \end{picture}
140 \caption{Polyphase representation of wavelet filter banks}\label{fig:polyphase}
141 \end{figure}
142 \begin{informative*}
143 In this representation, linear combinations of filters operate on both even and
144 odd samples to produce new even and odd samples:
146 \left(
147 \begin{array}{c}
148 x^{out}_e(z) \\
149 x^{out}_o(z)
150 \end{array}
151 \right)
152 = A(z)
153 \left(
154 \begin{array}{c}
155 x^{in}_e(z) \\
156 x^{in}_o(z)
157 \end{array}
158 \right)
161 Since the filter process is invertible, it can be shown that the analysis and
162 synthesis matrices are related by $A(z)=(S(z^{-1})^T)^{-1}$. Hence, in particular
163 both the analysis and synthesis matrices are invertible. It can be shown that
164 this means that they are (up to gain factors and delays) factorisable into
165 products of upper and lower triangular matrices:
166 \[A(z)=
167 \left(
168 \begin{array}{cc}
169 1 & a_1(z) \\
170 0 & 1
171 \end{array}
172 \right)
173 \left(
174 \begin{array}{cc}
175 1 & 0 \\
176 b_1(z) & 1
177 \end{array}
178 \right)
179 \left(
180 \begin{array}{cc}
181 1 & a_2(z) \\
182 0 & 1
183 \end{array}
184 \right)
185 \ldots
188 Each upper- or lower-triangular polyphase matrix represents a so-called {\em lifting} stage
189 whereby either even coefficients are modified solely by odd coefficients or odd coefficients
190 solely by even coefficients. For example, if
192 \left(
193 \begin{array}{c}
194 x^{out}_e(z) \\
195 x^{out}_o(z)
196 \end{array}
197 \right)
199 \left(
200 \begin{array}{cc}
201 1 & a(z) \\
202 0 & 1
203 \end{array}
204 \right)
205 \left(
206 \begin{array}{c}
207 x^{in}_e(z) \\
208 x^{in}_o(z)
209 \end{array}
210 \right)
212 then
213 \begin{eqnarray*}
214 x^{out}_e(z) & = & x^{in}_e(z) + a(z)x^{in}_o(z) \\
215 x^{out}_o(z) & = & x^{out}_o(z)\\
216 \end{eqnarray*}
217 and the filter $a(z)$ has been applied to the odd coefficients and then used to modify
218 the even coefficients. Not only is this computationally efficient, breaking long
219 filters into a number of shorter filter applied successively but the
220 factorisation into such filter stages allows for all computations to be done in-place,
221 without additional memory.