
W9968CF
Publication Release Date: May 1999
- 25 - Revision A2
7.3 JPEG Compression
The W9968CF supports JPEG baseline sequential process for video data compression. For the
sequential DCT-based mode, 8
×
8 sample blocks are typically input block by block from left to right, and
block-row by block-row from top to bottom. Each block is transformed by the forward DCT (FDCT) into
a set of 64 values referred to as DCT coefficients. Each of the 64 coefficients is then quantized using
one of 64 corresponding values from a quantization table. After quantization, the DC coefficients and
the 63 AC coefficients are converted into a one-dimensional zig-zag sequence, then are passed to a
Huffman encoder for entropy encoding procedure which compresses the data further.
7.3.1 Level Shift and Forward DCT
Prior to computing the FDCT the input data are level shifted to a signed two
′
s complement
representation. For 8-bit precision the level shift is achieved by subtracting 128. The following equation
specifies the mathematical definition of the FDCT.
(
)
(
)
S
C C
u
s
x
u
y
v
vu
v
yx
=
+
16
+
16
∑
0
∑
1
4
2
1
2
1
0
7
7
cos
cos
p
p
where
C,
C C
u
u
v
v
,
=
=
1
2
1
for u, v = 0
otherwise
7.3.2 Quantization
After the FDCT is computed for a block, each of the 64 resulting DCT coefficients is quantized by a
uniform quantizer. The uniform quantizer is defined by the following equation. Rounding is to the
nearest integer:
Sq
round
S
Q
vu
vu
vu
=
The quantizer step size for each coefficient S
vu
is the value of the corresponding element Q
vu
from the
quantization table. The W9968CF supports two programmable quantization tables, luminance
quantization table and chrominance quantization table, which are made by two internal 64
×
8 SRAMs,
and which should be loaded by the host via the USB bus before start of the JPEG compression.
The quantized DCT coefficient values are signed, two
′
s complement integers with 11-bit precision for
8-bit input precision.