English
Language : 

W99681CF Datasheet, PDF (26/78 Pages) Winbond – JPEG USB Dual Mode Camera Chip
W99681CF
7.3.3 Huffman Encoding
After quantization, the quantized coefficients are converted to the zig-zag sequence for Huffman
encoding. The DC coefficients are coded differently from the AC coefficients. The value that should be
encoded is the difference (DIFF) between the quantized DC coefficient of the current block (DCi which
is also designated as Sq00) and that of the previous block of the same component (PRED):
DIFF = DCi − PRED
At the beginning of the scan and at the beginning of each restart interval, the prediction for the DC
coefficient prediction is initialized to 0.
For the AC coefficient encoding, since many AC coefficients are zero, runs of zeros are identified and
coded efficiently. In addition, if the remaining coefficients in the zig-zag sequence order are all zero, this
is coded explicitly as an end-of-block (EOB).
The W99681CF Huffman encoder employs two DC and two AC Huffman tables within one scan for
luminance and chrominance components.
7.3.4 JPEG Encoding Order
The W99681CF JPEG encoder supports two non-interleaved encoding orders shown in Figure 7.2:
• YUV4:2:2 non-interleaved encoding order
• YUV4:2:0 non-interleaved encoding order
Y1 Y2 Y3 Y4
Yn
Y1 Y2
Y3 Y4
Yn
U1 U2 U3
Un/2
V1 V2 V3
Y1, Y2, ...Yn U1, U2, ...Un/2 V1, V2, ...Vn/2
Scan 1
Scan 2
Scan 3
YUV4:2:2 Non-interleaved Encoding Order
Vn/2
U1 U2
Un/4
V1 V2
Y1, Y2, ...Yn U1, U2, ...Un/4 V1, V2, ...Vn/4
Scan 1
Scan 2
Scan 3
YUV4:2:0 Non-interleaved Encoding Order
Vn/4
Figure 7.2 JPEG Encoding Order
- 26 -