2 The DCT maps each block into its frequency version containing the Fourier coefficients. The coefficients are then subjected to a quantizer, which uses variable step or "quantum" sizes (smaller for low frequencies, and the reverse). Each coefficient is scanned through a zigzag pattern, then divided by 30 See for instance: http://en.wikipedia.org/wiki/YUV_4:2:2 31 The figure does not have the purpose of explaining how the halving in both horizontal and vertical directions is actually performed. See: www.imaging.org/resources/jpegtutorial/jpgdct1.cfm http://en.wikipedia.org/wiki/Discrete_cosine_ transform; ;http://rnvs.informatik.tu-chemnitz.de/~jan/MPEG/HTML/mpeg_tech.html Appendix G its quantum size and the result rounded off to an integer. It is not unusual that more than half of the resulting coefficients end up being zero. Then it is possible to further compress the blocks through run-length encoding (RLE), as described earlier with sound compression. The RLE algorithm outputs the number of previous zeros and the nonzero coefficient amplitude, forming a sequence of pairs. Each pair is then encoded through a lossless, variable-length codeword such as generated by Huffman coding (see Chapter 9). The more powerful arithmetic coding (see Chapter 10) is also possible, but is covered by patents. On completion, JPEG writes an end-of-block codeword, and after processing the three blocks, an end-of-sequence codeword. Decoding the JPEG image is basically the same succession of operation in the inverse-function order. The JPEG standard later evolved to JPEG-2000 (filename extensions .jp2 and .j2c). 33 The key difference from the former JPEG is the use of the discrete wavelet transform (DWT) algorithm³4 instead of DCT. The interest of DWT is not only the possibility of achieving greater compression rates (typically 20% higher) while making imperceptible the characteristic "blocky and blurry" artifacts of the JPEG described earlier. As a major optional feature, JPEG2000 also provides lossless compression, owing to the rev