Altera Corporation 7–53
September 2004 Stratix Device Handbook, Volume 2
Implementing High Performance DSP Functions in Stratix & Stratix GX Devices
For 1-D with input data x(n) of size N, the DCT coefficients Y(k) are:
for 0
≤ k ≤ N–1
where:
for k = 0
for 1
≤ k ≤ N –1
For 2-D with input data x(m,n) of size N × N, the DCT coefficients for the
output image, Y(p,q) are:
where:
for p = 0
for q = 0
for 1
≤ p ≤ N –1
for 1
≤ q ≤ N–1
2-D DCT Algorithm
The 2-D DCT can be thought of as an extended 1-D DCT applied twice;
once in the x direction and again in the y direction. Because the 2-D DCT
is a separable transform, it is possible to calculate it using efficient 1-D
algorithms. Figure 7–32 illustrates the concept of a separable transform.
Yk()
α k()
2
-----------
xn()
2n 1+()πk
2N
---------------------------
⎝⎠
⎛⎞
cos
n0=
–
∑
=
α k()
1
N
----=
α k()
2
N
----=
Yp q,()
α p()αq()
2
-----------------------
xm n,()
2m 1+()πp
2N
-----------------------------
⎝⎠
⎛⎞
cos
2n 1+()πq
2N
---------------------------
⎝⎠
⎛⎞
cos
n0=
N1–
∑
m0=
N1–
∑
=
α p()
1
N
----=
α q()
1
N
----=
α p()
2
N
----=
α q()
2
N
----=