Digital Signal Processing Reference
In-Depth Information
F
) using equations which will correlate the pixels to the
vertical and horizontal cosine frequencies. In the equations, “
(
u
,
v
u
”
and “
” correspond to both the indices in the DCT array, and the
cosine frequencies as shown in
Figure 12.3
.
The relationship is given in the DCT equation, shown below
for the eight by eight size.
v
C
u
C
v
X
7
x
¼
0
X
7
Fðu; vÞ¼¥
y
¼
0
f
ð
x
;
y
Þ
cos
ðð
2x
þ
1
Þup=
16
Þ
cos
ðð
2y
þ
1
Þvp=
16
Þ
where
p
2
C
u
¼
=
2 when
u¼
0
;
C
u
¼
1 when
u ¼
1
::
7
p
2
C
v
¼
=
2 when
v ¼
0
;
C
u
¼
1
when
v ¼
1
::
7
f(x,y)
¼
the pixel value at that location
This represents 64 different equations, for each combination
of
u
,
v.
For example:
8
X
7
x
¼
0
X
7
Fð
0
;
0
Þ¼
1
=
y
¼
0
f
ð
x
;
y
Þ
Simply put, the summation of all 64 pixel values divided by
eight.
F
(0, 0) is the DC level of the pixel block.
4
X
7
x
¼
0
X
7
Fð
4
;
2
Þ¼
1
=
y
¼
0
f
ð
x
;
y
Þ
cos
ðð
2x
þ
1
Þ
4
p=
16
cos
ðð
2y
þ
1
Þ
2
p=
16
Þ
The nested summations indicate that for each of the 64
DCT coefficients, we need to perform 64 summations. This
requires 64
64
¼
4096 calculations, which is very process
intensive.
The DCT is a reversible transform (provided enough numer-
ical precision is used), and the pixels can be recovered from the
DCT coefficients as shown below:
4C
u
C
v
X
7
u
¼
0
X
7
f
ð
x
;
y
Þ¼
1
=
v
¼
0
Fðu; vÞ
cos
ðð
2x
þ
1
Þup=
16
Þ
cos
ðð
2y
þ
1
Þvp=
16
Þ
p
2
C
u
¼
=
u ¼
0
;
C
u
¼
1
u ¼
1
::
2
when
when
7
p
2
C
v
¼
=
2
when
v ¼
0
;
C
v
¼
1
when
v ¼
1
::
7
Another way to look at the DCT is through the concept of basis
functions.