08.01.2013 Views

DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf

DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf

DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 38.8 Zigzag scanning<br />

is used to rearrange quantized<br />

coefficients according to<br />

the likely distribution of<br />

image power in the block.<br />

In JPEG and MPEG terminology,<br />

the magnitude (absolute value) of<br />

a coefficient is called its level.<br />

Most of the high-frequency information in this block –<br />

the DCT entries at the right and the bottom of the<br />

matrix – are quantized to zero. Apart from the DC term,<br />

the nonzero coefficients have small magnitudes.<br />

Following quantization, the quantized coefficients are<br />

rearranged according to the likely distribution of image<br />

power in the block. This is accomplished by zigzag scanning,<br />

sketched in Figure 38.8:<br />

F* =<br />

79 0 -1 0 0 0 0 0<br />

-2 -1 0 0 0 0 0 0<br />

-1 -1 0 0 0 0 0 0<br />

0 0 0 0 0 0 0 0<br />

0 0 0 0 0 0 0 0<br />

0 0 0 0 0 0 0 0<br />

0 0 0 0 0 0 0 0<br />

0 0 0 0 0 0 0 0<br />

Once rearranged, the quantized coefficients are represented<br />

in a one-dimensional string; an end of block<br />

(EOB) code marks the location in the string where all<br />

succeeding coefficients are zero, as sketched in<br />

Figure 38.9:<br />

79 0 -2 -1 -1 -1 0 0 -1 EOB<br />

Figure 38.9 Zigzag-scanned coefficient string<br />

In the usual case that just a few high-order quantized<br />

coefficients are nonzero, zigzag reordering tends to<br />

produce strings of repeating zeros. Additional compression<br />

can be accomplished by using variable-length<br />

encoding (VLE, also known as Huffman coding).<br />

Variable-length encoding is a lossless process that takes<br />

advantage of the statistics of the “run length” (the<br />

count of zero codes) and the “level” (absolute value, or<br />

magnitude) of the following transform coefficient.<br />

The DC term is treated specially: It is differentially<br />

coded. The first DC term is coded directly (using a DC<br />

VLE table), but successive DC terms are coded as<br />

CHAPTER 38 JPEG AND MOTION-JPEG (M-JPEG) COMPRESSION 455

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!