English
Language : 

W99681CF Datasheet, PDF (25/78 Pages) Winbond – JPEG USB Dual Mode Camera Chip
W99681CF
7.3 JPEG Compression
The W99681CF 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.
∑ ∑ Svu =
1
CuCv
7
7
(2x + 1)uπ (2 y + 1)vπ
syx cos
cos
4
x=0 y=0
16
16
where
Cu, Cv = 1 for u, v = 0
2
Cu, Cv = 1 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:
Sqvu
=

round
Svu 
Qvu 
The quantizer step size for each coefficient Svu is the value of the corresponding element Qvu from the
quantization table. The W99681CF 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.
- 25 -
Publication Release Date: March 2000
Revision A1