12.07.2015 Views

Data Compression: The Complete Reference

Data Compression: The Complete Reference

Data Compression: The Complete Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

290 4. Image <strong>Compression</strong>4.6.1 Introduction<strong>The</strong> DCT in one dimension is given bywhere√n−12G f =n C ∑[ ](2t +1)fπf p t cos, (4.13)2nC f =t=0{√2 1, f =0,1, f > 0,for f =0, 1,...,n− 1.<strong>The</strong> input is a set of n data values p t (pixels, audio samples, or other data) and theoutput is a set of n DCT transform coefficients (or weights) G f . <strong>The</strong> first coefficientG 0 is called the DC coefficient and the rest are referred to as the AC coefficients (theseterms have been inherited from electrical engineering, where they stand for “direct current”and “alternating current”). Notice that the coefficients are real numbers even ifthe input data consists of integers. Similarly, the coefficients may be positive or negativeeven if the input data consists of nonnegative numbers only. This computation isstraightforward but slow (Section 4.6.5 discusses faster versions). <strong>The</strong> decoder inputsthe DCT coefficients in sets of n and uses the inverse DCT (IDCT) to reconstruct theoriginal data values (also in groups of n). <strong>The</strong> IDCT in one dimension is given by√n−12 ∑[ ](2t +1)jπp t = C j G j cos, for t =0, 1,...,n− 1. (4.14)n2nj=0<strong>The</strong> important feature of the DCT, the feature that makes it so useful in datacompression, is that it takes correlated input data and concentrates its energy in justthe first few transform coefficients. If the input data consists of correlated quantities,then most of the n transform coefficients produced by the DCT are zeros or smallnumbers, and only a few are large (normally the first ones). We will see that theearly coefficients contain the important (low-frequency) image information and the latercoefficients contain the less-important (high-frequency) image information. Compressingdata with the DCT is therefore done by quantizing the coefficients. <strong>The</strong> small ones arequantized coarsely (possibly all the way to zero) and the large ones can be quantizedfinely to the nearest integer. After quantization, the coefficients (or variable-size codesassigned to the coefficients) are written on the compressed stream. Decompression isdone by performing the inverse DCT on the quantized coefficients. This results in dataitems that are not identical to the original ones but are not much different.In practical applications, the data to be compressed is partitioned into sets of nitems each and each set is DCT-transformed and quantized individually. <strong>The</strong> value ofn is critical. Small values of n such as 3, 4, or 6 result in many small sets of data items.Such a small set is transformed to a small set of coefficients where the energy of theoriginal data is concentrated in a few coefficients, but there are only few coefficients insuch a set! Thus, there are not enough small coefficients to quantize. Large values of nresult in a few large sets of data. <strong>The</strong> problem in such a case is that the individual dataitems of a large set are normally not correlated and therefore result in a set of transform

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

Saved successfully!

Ooh no, something went wrong!