![](http://images-20200215.ebookreading.net/23/1/1/9781482247336/9781482247336__a-computational-introduction__9781482247336__bg1b9.png)
Image Coding and Compression 423
MATLAB/Octave
>> imshow(imresize(c(68-31:68+32,56-31:56+32),4))
which is shown in Figure 14.10. The same areas, with the scales of 1 and 2, are shown in
FIGURE 14.10: An image closeup
Figure 14.11. And the closeups , with the scales of 5 and 10, are shown in Figure 14.12.
FIGURE 14.11: Closeups after the scale factors of 1 and 2
Notice that “blockiness” becomes more apparent as the scale factor increases. This is due
to the working of the algorithm; that each 8 × 8 block is processed independently of the
others. This tends to pro duce discontinuities in the output, and is one of the disadvantages
of the JPEG algorithm for high levels of compression.
In Chapter 15, we shall see that some of these disadvantages can be overcome by using
wavelets for compression.
We have seen how changing the compression rate may affect the output. But the JPEG
algorithm is particularly designed for storage. For example, suppose we take the original
block from the caribou image, but divide it by double the quantization matrix. After
reordering, the output vector will be
7 -1 -10 0 2 1 0 0 2 4 0 1 0 -1 EOB
This vector is further encoded using Huffman coding. To do this, each element of the
vector (except for the first), that is, each AC value, is defined to be in a particular category
depending on its absolute value. In general, the valu e 0 is given category 0, and category k