Académique Documents
Professionnel Documents
Culture Documents
Introduction
The DFT is not the only transform that is widely used in applications
Published standards for image and video coding (compression) make use of the DCT
1. JPEG (1989)
2. MPEG1, 2, and 4
2.1. MPEG1 (1992): video CD players, storage and retrieval of moving pictures and audio on storage media
2.2. MPEG2 (1994): HDTV, DVD, standard for Digital TV (cable)
2.3. MPEG3, originally targeted for HDTV, was incorporated into MPEG2
2.4. MPEG4 (late 1998): standard for multimedia applications, targeted for wireless video
3. H.261, H.263
3.1. H.261 (circa 1993): video conferencing
3.2. H.263 (circa 1995): wireless video
These standards provide instructions for decoding the signal, but there is often considerable freedom for
encoding the signal. For more information go to http://drogo.cselt.it/mpeg/.
Compression
Two classes of compression algorithms try to reduce the number of bits required to represent a signal.
For wireless video, need compression ratios up to 1000:1. Can get near lossless video compression at 8:1 with
little degradation.
Compression algorithms work by removing redundancy in the signal. In video signals, the redundancy can be of
three forms.
A 2-D DCT of each block is computed and the transform coefficients are quantized. Quantized coefficients are
coded losslessly. The choice of quantization affects the transmission rate and distortion.
Advantages of the DCT (relative to the DFT)
real-valued
better energy compaction (much of the signal energy can be represented by only a few coefficients)
2-D DCT
X c k1 , k2
x n1 , n2
N1 1 N 2 1
n1 0 n2 0
4 x n1 , n2
N1 1 N2 1
N1 N 2
k1 0 k 2 0
1 2 , k 0
C k
1, k 0
2n 1 k 2n 1 k
1
1
2
2
cos
cos
2N
2
N
1
2
C k1 C k 2 X c k1 , k2
2n 1 k
2n 1 k
1
1
2
2
cos
cos
2
N
2N
1
2
1. The DFT is related to the Fourier Series coefficients of a periodically extended sequence.
2. The DCT is related to the Fourier Series coefficients of a symmetrically extended sequence.
3. The 2-D DCT is a separable transform. It can be evaluated using a row-column decomposition. For a 8 x8
DCT, we need 16 1-D DCTs. Calling 16 functions may lead to unacceptable overhead for 8-point DCTs.
1-D DCT
2n 1k
X c k 2 x n cos
n 0
2N
N 1
x n
yn
N 1
Y k
yne
2
kn
2N
N 1
2
kn
2N
2 N 1
n 0
xne
n 0
N 1
xne
xne
n 0
2N
2N
x2 N 1 ne
2
kn
2N
n N
2
kn
2N
n 0
N 1
2 N 1
N 1
xne
2
k 2 N 1 n
2N
n 0
2
j
kn
2N
2
kn
2N
2
k
2N
j
kn j
k
j 2N k j 22N kn
2N
2N
xne
e
e
e
n 0
N 1
k
2n 1
2 xncos
2N
n 0
N 1
N 1
2N 1
k 0, 1, . . . , N 1.
X
k
exp
j
k
3. Set c
Y k , for
2N
This requires N+N log2(2N) complex multiplies. Another algorithm can be developed that requires fewer
multiplies by using a shorter DFT.
Y k
2 N1
yn W 2 N
nk
n 0
Divide the sum into two components, one over the even samples and one over the odd samples.
N 1
N 1
r 0
N 1
r 0
rk
N
N 1
k
2N
y2r 1W
r 0
rk
N
k 0, 1,...,2 N 1
k 0, 1,...,2 N 1
G[k ] W2kN H [k ]
Note that
W22Nrk exp( 2
2rk
rk
) exp( 2 ) WNrk
2N
N
g n y 2n ,
n 0,1,..., N 1
h n y 2n 1,
n 0, 1,..., N 1
x[n]
c
a
0
d d
y[n]
c
b
a
N-1
a
N-1
2N-1
g n a, c, d, b
h n b, d, c, a g N 1 n
H k WN k GN k N WN k G* k
Therefore,
Y k Gk e
k
2N
k
N
G * k ,
k 0, 1,..., 2 N 1
k
2N
Y k Gk e
G * k , k 0, 1,..., 2 N 1
k
j k
j
*
2N
2N
, k 0, 1,..., 2 N 1
X c k Re e
G
k
e
G
k
2k
j
j 2Nk
Re e
Gk e 2 N G * k
3k / 2
k / 2
k / 2
j
j
j 2N
*
2
N
2N
e
Re e
G
k
e
G
k
3k k
X c k 2 cos
cos
ReGk ,
4N 4N
k 0,1,..., N 1
n 0,1,...,
g N 1 n x2n 1,
N
1
2
n 0,1,...,
N
1
2
3k k
X c k 2 cos
cos
ReGk
4N 4N
The coefficients in front of Greal[k] can be pre-computed for different values of k for a given N.
Note: Special algorithms exist for computing DFTs of real arrays.