Image compression techniques reduce the memory required for storage of large or complex images, permitting storage of images in devices with limited memory. For example, image compression techniques used in digital copiers and scanners aid in storage of complex images for subsequent printing. Similarly, image compression benefits communications where bandwidth limitations would otherwise render transmission of image data impractical. Image compression also offers substantial benefits for archiving large image libraries.
The JPEG (Joint Photographic Experts Group) standard is a set of image compression techniques that have gained widespread acceptance. The most popular of the three general compression methods defined by the JPEG standard is the baseline sequential discrete cosine transform (DCT) technique. This technique reduces the file size of grayscale and color images with a near minimum possible loss of image quality. The basic image unit for JPEG compression is the image block which includes an eight pixel by eight pixel subset of the image. Each image block is analyzed and quantized, yielding DCT coefficients representative of the image block content. The coefficients are then Huffman coded to reduce the amount of data used to characterize them.
Huffman symbols used in JPEG image compression generally combine zero run length and magnitude length information to represent the coefficients in the smallest possible number of bits. The zero run length specifies the number of consecutive zero-valued coefficients preceding a non-zero coefficient. The magnitude length specifies the bit length of that part of the JPEG symbol which represents the value of the non-zero coefficient. Huffman codes are based on a set of variable word length symbols. The number of bits used to represent a particular Huffman code should be inversely related to the probability of encountering the run-length/magnitude length represented by that code (i.e., entropy encoding).
A common way to decode bit patterns is to compare each bit pattern to a set of stored bit patterns in a content-addressable memory (CAM). Each stored bit pattern contains the bits to be matched and information about which bits are to be ignored (i.e., masked) in the comparison. If one of the stored bit patterns matches the symbol bit pattern, information necessary for the decoding of the symbol bit pattern is read out of a separate memory. The information includes the length of the Huffman part, the length of the magnitude part, and the overall JPEG symbol length. The length of the Huffman part is required for determining the start of the magnitude bits, the length of the magnitude part specifies the number of magnitude bits, and the overall symbol length is used to determine the start of the next symbol. Because the bit lengths are interrelated, separate storage of all of these lengths requires more logic circuitry and storage capacity than is desirable. In addition, retrieval and processing of the multiple bit lengths from memory requires crucial decoding time.