US 20020001412 A1 Abstract An image compression system for compound images containing both text and pictures. The system is capable of receiving the images on a non-overlapping 8 by 8 pixel blank basis and includes a discrete cosine transformer connected to a quantizer drawing lossy quantization factors from quantization tables. The lossy quantization factors are modified by a variable quantization subsystem based on the frequency of changes in the block to provide low lossy quantization factors for high frequency of changes and high lossy quantization factors for low frequency of changes. The high frequency of changes being indicative of text and the low frequency of changes being indicative of pictures. The quantizer is connected to an entropy coder using lossless entropy encoding factors from Huffman tables to provide JPEG compliant files.
Claims(20) 1. Variable quantization apparatus for an image encoder system having an interconnected transformer, quantizer, and entropy encoder, comprising:
variable quantization means operatively connected to the transformer and the quantizer responsive to plurality of blocks of data from the transformer to determine the characteristics of a plurality of blocks of digital pixel data inputted to the transformer by computing an image related metric for each of the plurality of blocks of data; quantization factoring means connected to said variable quantization means for providing a predetermined lossy quantization factor for each metric; and said variable quantization means including means for causing the quantizer to apply a lossy quantization factor to each of the plurality of blocks of data based on said metric for the block of data to provide a plurality of blocks of quantized data to the entropy encoder. 2. The variable quantization apparatus as claimed in said variable quantization means includes scaling means for scaling said metric for each of the plurality of blocks of data to provide a lower lossy quantization factor for metrics for predetermined types of images and a higher lossy quantization factor for metrics for other predetermined types of images. 3. The variable quantization apparatus as claimed in said variable quantization means includes:
quantization tables for providing a predetermined lossy quantization factor for predetermined of blocks of data;
a quantizer connected to the transformer and said quantization tables for applying a lossy quantization factor to said each of said plurality of blocks of data to compute said metric for each of said plurality of blocks of data.
4. The variable quantization apparatus as claimed in multiplier means connected to said quantization tables, said variable quantization means, and said quantizer for applying a lossy quantization factor which is a function of said metric and data to said each of said plurality of blocks of data. 5. The variable quantization apparatus as claimed in said variable quantization means computes the metric as an image activity metric according to the equation: 6. The variable quantization apparatus as claimed in said variable quantization means includes scaling means for scaling said metric as an activity matrix for each of the plurality of blocks of data provided by the transformer as frequency data to provide a lower lossy quantization factor for higher activity metrics proportionally than a higher lossy quantization factor for lower activity metrics whereby one type of image is compressed at a higher quality while another type of image is compressed at a lower quality according to the equations: where: a and b are predetermined functions of said activity metric. 7. The variable quantization apparatus as claimed in 8. An image compression system capable of compressing text and pictures, comprising:
a discrete cosine transformer capable of receiving an image in the form of a plurality of blocks of digital pixel data of the text and pictures, said discrete cosine transformer for applying a discrete cosine transform to said plurality of blocks of digital pixel data to provide a plurality of blocks of discrete cosine transform coefficients representative of the frequency of changes in said digital pixel data whereby a high frequency of changes indicates text and a low frequency of changes indicates pictures; a variable quantization subsystem operatively connected to said discrete cosine transformer responsive to each of said plurality of blocks of discrete cosine transform coefficients to determine the activity of said digital pixel data by computing an activity metric for each of said plurality of blocks of discrete cosine transform coefficients whereby a high frequency of changes has a high activity metric and a low frequency of changes has a low activity metric; quantization tables for providing a predetermined lossy quantization factor for each activity metric whereby a high activity metric has a low lossy quantization factor and a low activity metric has a high lossy quantization factor; a quantizer connected to said discrete cosine transformer, said variable quantization subsystem, and said quantization tables for applying said predetermined lossy quantization factor to each of said plurality of blocks of discrete cosine transform coefficients based on said activity metric for each of said plurality of blocks of discrete cosine transform coefficients to provide a plurality of blocks of quantized data; Huffman tables for providing a predetermined lossless entropy encoding factor for each of said predetermined of blocks of discrete cosine transform coefficients; an entropy coder connected to said Huffman tables and said quantizer to apply a lossless entropy encoding factor to each of said plurality of blocks of quantized data to output a plurality of blocks of compressed entropy coded data in a digital file with the lossy quantization factor and the lossless entropy encoding factor applied to each of said plurality of blocks of compressed entropy coded data. 9. The image compression system as claimed in said variable quantization subsystem includes a scaling computer for scaling said activity metric for each of said plurality of blocks of discrete cosine transform coefficients to provide a lower lossy quantization factor for higher activity metrics proportionally than the lossy quantization factor for lower activity metrics whereby the text is compressed at a higher quality while the pictures are compressed at a lower quality. 10. The image compression system as claimed in said variable quantization subsystem includes:
quantization tables for providing a predetermined lossy quantization factor for predetermined of blocks of discrete cosine transform coefficients;
a quantizer connected to said discrete cosine transformer and said quantization tables for applying a lossy quantization factor to said each of said plurality of blocks of discrete cosine transform coefficients to compute said activity metric for each of said plurality of blocks of discrete cosine transform coefficients.
11. The image compression system as claimed in a multiplying junction connected to said quantization tables, said variable quantization subsystem, and said quantizer for applying a lossy quantization factor which is a function of said activity metric and discrete cosine transform coefficients to said each of said plurality of blocks of discrete cosine transform coefficients. 12. The image compression system as claimed in said variable quantization subsystem computes the activity metric according to the equation: 13. The image compression system as claimed in said variable quantization means includes scaling means for scaling said activity metric for each of said plurality of blocks of discrete cosine transform coefficients to provide a lower lossy quantization factor for higher activity metrics proportionally than a higher lossy quantization factor for lower activity metrics whereby the text is compressed at a higher quality while the pictures are compressed at a lower quality according to the equations: 14. The image compression system as claimed in said variable quantization means includes scaling means for scaling said activity metric for each of said plurality of blocks of discrete cosine transform coefficients in macroblocks of 16 by 16 blocks to provide a lower lossy quantization factor for higher activity metrics proportionally than a higher lossy quantization factor for lower activity metrics whereby the text is compressed at a higher quality while the pictures are compressed at a lower quality according to the equations: 15. The image compression system as claimed in 16. An image compression system capable of compressing text and pictures, comprising:
a discrete cosine transformer capable of receiving an image in the form of a plurality of blocks of digital pixel data of the text and pictures, said discrete cosine transformer for applying a discrete cosine transform to said plurality of blocks of digital pixel data to provide a plurality of blocks of discrete cosine transform coefficients representative of the frequency of changes in said digital pixel data whereby a high frequency of changes indicates text and a low frequency of changes indicates pictures; a variable quantization subsystem operatively connected to said discrete cosine transformer responsive to each of said plurality of blocks of discrete cosine transform coefficients including:
subsystem quantization tables for providing a predetermined lossy quantization factor for predetermined of blocks of discrete cosine transform coefficients;
a quantizer connected to said discrete cosine transformer and said subsystem quantization tables for applying a lossy quantization factor from said quantization tables to said each of said plurality of blocks of discrete cosine transform coefficients to provide a plurality of quantized data blocks;
an activity computer connected to said quantizer for calculating an activity metric for each of said quantized data blocks with high frequency data having a high activity metric and low frequency data having a low activity metric;
a scaling computer for determining predetermined relationships between said activity metric and quantization scale for said quantization table;
quantization tables for providing a predetermined lossy quantization factor for each of said plurality of discrete cosine transform coefficients; a multiplying junction connected to said scale computer and said quantization tables for scaling said predetermined lossy quantization factor by calculated amounts and providing predetermined, scaled, lossy quantization factors; a quantizer connected to said discrete cosine transformer and said multiplying junction for applying said predetermined, scaled, lossy quantization factor to each of said plurality of blocks of discrete cosine transform coefficients to provide a plurality of blocks of quantized data; Huffman tables for providing a predetermined lossless entropy encoding factor for each of said predetermined of blocks of discrete cosine transform coefficients; an entropy coder connected to said Huffman tables and said quantizer to apply a lossless entropy encoding factor to each of said plurality of blocks of quantized data to output a plurality of blocks of compressed entropy coded data in a digital file with the lossy quantization factor and the lossless entropy encoding factor applied to each of said plurality of blocks of compressed entropy coded data. 17. The image compression system as claimed in said variable quantization subsystem computes the activity metric according to the equation: 18. The image compression system as claimed in said variable quantization means includes scaling means for scaling said activity metric for each of said plurality of blocks of discrete cosine transform coefficients to provide a lower lossy quantization factor for higher activity metrics proportionally than a higher lossy quantization factor for lower activity metrics whereby the text is compressed at a higher quality while the pictures are compressed at a lower quality according to the equations: 19. The image compression system as claimed in said variable quantization means includes scaling means for scaling said activity metric for each of said plurality of blocks of discrete cosine transform coefficients in macroblocks of 16 by 16 blocks to provide a lower lossy quantization factor for higher activity metrics proportionally than a higher lossy quantization factor for lower activity metrics whereby the text is compressed at a higher quality while the pictures are compressed at a lower quality according to the equations: 20. The image compression system as claimed in Description [0001] The present invention relates generally to JPEG data compression and more specifically to JPEG data compression for compound images having pictures and text. [0002] JPEG is the name of both a committee and a standard. JPEG stands for Joint Photographic Experts Group, the original name of the committee that wrote the JPEG standard. The JPEG standard is an international standard which applies to the lossy and lossless compression of either full-color or gray-scale images of natural, real-world scenes. [0003] Lossy image compression compresses by striving to discard as much of the image data as possible without significantly affecting the appearance of the image to the human eye. Lossless compression is compression achieved without discarding any of the image data. [0004] The JPEG standard works well on still photographs, naturalistic artwork, and similar material (which are generally referred to herein as “pictures”), but not so well on lettering, simple cartoons, or line drawings (which are generally referred to herein as “text”). Compound images are those which contain both pictures and text (which are collectively referred to herein as “images”). In some cases, compound images contain pictures which also contain text within the picture itself. [0005] This standard is being used in the computer industry. Popular graphics-capable browsers on the World Wide Web can read and write this particular type of image data format, so if a compressed image is sent across the Web to such a browser, it knows how to decompress the image and display it. [0006] Compression is important for two main reasons. The first is storage space. If there will be a large number of images on a hard drive, the hard drive will fill up very quickly unless the data can be greatly compressed. Computers have fixed size buffers and limited memory, and an image has to fit in them otherwise, the image cannot be stored in them. [0007] The second is bandwidth. If data is being sent through a browser or through electronic mail, the more bits that need to be transmitted, the more time is required. For example, with a 28.8K modem it may take half an hour of waiting for a picture to be completely transmitted. If a 50 to 1 compression can be achieved, the same picture can be transmitted completely in about thirty seconds, and if compressed properly, the recipient will not notice the difference between the original and the compressed version. [0008] For full-color images, the uncompressed data is normally 24 bits per pixel. JPEG can typically achieve 10:1 to 20:1 compression on pictures without visible loss, bringing the effective storage requirement down to 1 to 2 bits per pixel. This is due to the fact that small color changes are perceived less accurately than small changes in brightness. Even 30:1 to 50:1 compression is possible with small to moderate defects, while for very low quality purposes such as previews or archive indexes, 100:1 compression is quite feasible. [0009] For gray-scale, and black and white images such large factors of compression are difficult to obtain because the brightness variations in these images are more apparent than the hue variations. A gray-scale JPEG file is generally only about 10%-25% smaller than a full-color JPEG file of similar visual quality with the uncompressed gray-scale data at only 8 bits/pixel, or one-third the size of the color data. The threshold of visible loss is often around 5:1 compression for gray-scale images. [0010] Although there are a number of settings that can be predefined to achieve different compression ratios, there is only one parameter, called the quality factor, that is adjusted regularly in JPEG on an image-by-image basis with one setting for an active image. The quality factor is a single number in an arbitrary, relative scale. A high quality factor will provide a relatively high quality decompressed image, but will require a relatively large file. And, of course the lower the quality, the rougher the approximation of the image and the more compression with a correspondingly smaller file size, but also, the more visible defects, or artifacts, will be in the decompressed final image. Text generally shows significant compression artifacts at higher quality factors than pictures. Further, the quality factor will only give an approximate end file size. [0011] Therefore, a long sought goal in image compression has been to maintain maximum perceptible image quality while achieving maximum compression. [0012] This goal is becoming more difficult to attain because compound documents are just starting to become more and more important. It has only been recently that it has become possible to drop pictures into text documents as much as can be done now. Before, electronic transmissions were either a text document or a picture document. Now, it is more and more common to see a compound image where someone is making a newsletter or setting up a website. People want to drop in some pictures but also want to have text as well. So compound documents are becoming a more important, whether it is just photocopying or just sending to a printer or transmitting across the internet, these have become a more important class of images. [0013] Also, most of the techniques that have been developed in the past for compound documents are based on proprietary (non-standard) compression techniques, so the images could only be decompressed using a specific company's product. [0014] It has long been known that the inability to minimize file size while maintaining high perceptual quality would lead to detrimental compromises in performance so process improvements have been long sought but have eluded those skilled in the art. Similarly, it has long been known that the problems would become more severe with compound documents and thus a generally applicable solution has been long sought. [0015] The present invention provides a simple metric for picture/text segmentation of compound documents in the discrete cosine transform domain. This allows areas of high frequency content such as text to be compressed at a better quality than pictures, thus improving the overall perceptual quality while minimizing the file size. The metric is computed using the quantized output of the discrete cosine transform. No other information is needed from any other part of the JPEG coder. [0016] The present invention provides an image compression system which can be used to apply different, appropriate quantization factors to small blocks of pictures and text to provide significant image compression. [0017] The present invention further provides an image compression system capable of distinguishing between text and pictures in compound images. [0018] The present invention still further provides for preserving the text quality without sacrificing bandwidth while at the same time being JPEG compliant. [0019] The present invention also provides an image compression system which is fully compliant with the latest extensions of the current JPEG standard. [0020] The above and additional advantages of the present invention will become apparent to those skilled in the art from a reading of the following detailed description when taken in conjunction with the accompanying drawings. [0021]FIG. 1 PRIOR ART is a schematic of a prior art baseline JPEG encoder; [0022]FIG. 2 is a schematic of a JPEG Part 3 encoder that supports variable quantization; and [0023]FIG. 3 is a schematic of a variable quantization subsystem of the present invention. [0024] Referring now to FIG. 1 PRIOR ART, therein is shown a baseline JPEG encoder system [0025] The system [0026] Quantization tables [0027] It should be understood that the tables represent tabulations of various equations. The look-up tables could be replaced by subroutines which could perform the calculations to provide the factors. [0028] A quantizer [0029] An entropy coder [0030] The bitstream out of the entropy coder [0031] Referring now to FIG. 2, therein is shown a JPEG encoder system [0032] The quantization tables [0033] The entropy coder [0034] Referring now to FIG. 3, therein is shown the variable quantization subsystem [0035] The quantizer [0036] In operation in the FIG. 1 PRIOR ART baseline JPEG encoder system [0037] Mathematically JPEG uses the discrete cosine transform in its processing. A discrete cosine transform in the frequency domain is based on the assumption that an image mirrors itself on both boundaries. This assures a smooth transition without high frequency spikes, because those are very hard to compress. And the higher frequencies are very close to zero if there is a smoothly varying function. [0038] The output of the above step will be a new 8×8 matrix Y [0039] In the baseline JPEG encoder system [0040] After quantization, the quantized discrete cosine transformer 14 output is rearranged in raster, or zigzag, order and is compressed using run-length encoding which is a lossless, entropy coding using the Huffman tables [0041] In operation, the variable quantization JPEG encoder system [0042] Even though the latest JPEG extensions provide the syntax for the support of variable quantization, the actual way to specify the scaling factors is application dependent and not part of the JPEG adjunct standard. [0043] The present invention allows for the variable quantization of compound images. The JPEG encoder system [0044] In the JPEG standard, the quantization is being done in a transformed domain, not on the pixels directly. The pixels are transformed through a linear matrix transform (the discrete cosine transform) into a frequency domain representation, and the quantization is performed in the frequency domain. It is also in the frequency domain that the frequency components can be determined to find how active a particular block is. The mathematical equation used is what provides an “activity metric”. The larger this activity metric turns out to be, the more things are changing within the 8 by 8 block. [0045] Also, the discrete cosine transform has the advantage that it takes real numbers and transforms them into real numbers which can be quantized. In this domain, it is possible to predict, roughly, how many bits it takes to represent the data that is actually in the block. [0046] To represent a given number, such as every number between 0 and 15, the largest number is taken, and the log base [0047] Thus by taking the absolute value of the real numbers, taking the log base [0048] Based on the discrete cosine transform activity of a block or a macroblock (a 16×16 block), quantization scaling factors are derived that automatically adjust the quantization so that text blocks are compressed at higher quality than image blocks. Those skilled in the art would be aware that text is more sensitive to JPEG compression because of its sharp edges which, if compressed too greatly, would blur or have ringing artifacts (ripples around the edges). At the same time, images can be compressed greatly without drastically affecting human-eye perceived differences in quality of the image. [0049] There are many ways to measure activity in a block. One method to determine the discrete cosine transform activity is to let Y [0050] where the summation is performed over all elements of the Y [0051] The motivation behind this metric is based on the fact that: (a) JPEG uses differential coding for the encoding of the discrete cosine coefficients, and (b) the number of bits needed to code a DC transform coefficient are proportional to the base-two logarithm of its magnitude. The equation does not (and does not need to) account for additional coding bits needed for the Huffman coding of either size or run/size information of the discrete cosine transform coefficients. The number of these bits ranges from 2 to 16 per non-zero coefficient. Assuming that on the average c bits per non-zero coefficient are required for this purpose, then the following method can be used to compute M [0052] In experiments, c=4. [0053] After defining an activity metric, the next step is to define the relationship between the activity measure and the quantization scale. [0054] The cmpnd [0055] The values of the activity metric, M [0056] Basically quantization varies inversely with the metric. If a higher metric means a higher activity, thus scale by less to quantize more finely or compress less. And then with a very small metric, scale the quantization very coarsely or compress more because the image is such a smooth block, that it does not matter how much quantization since it will not be perceptible. [0057] The output of the scale computer [0058] where a and b are constants to be defined based on desired output quality and compression ratios. One way a and b can be defined is the follows. Let m [0059] For example, if m [0060] The choices for m [0061] In the variable quantization subsystem of FIG. 3 showing the variable quantization method, the Q [0062] Using the above metric, the upper text areas in the ISO test image were identified as areas of high frequency activity, but also the text inside the color picture at the bottom half. [0063] The qscale is provided to the multiplying junction [0064] It should be understood that the same method as described above may be used to adjust the chroma quantization tables independently from the luminance tables using the same scaling factors. [0065] JPEG, itself, as a standard doesn't specify what to do about color. But, what is commonly done, is to convert a color image into a luminance and chrominance representation so that it shows the brightness of the image with two other components that show the colorfulness. And it turns out that the human eye is much more sensitive to the luminance. A slow transition from a red to an orange versus a sharp one will not even be noticeable, but a slow transition in luminosity versus a sharp one will be noticeable as a blur. In the present invention, the activity metric is computed only for the luminance component to save on computation and then the chrominance is scaled the same way. That turns out to work reasonably well on the chrominance as well, because compound documents usually have black text on a white background and errors in the color are particularly noticeable. A little red fringe around each letter will be seen immediately but it is less likely to be seen in an image. [0066] As would be understood by those skilled in the art, the present invention has been described in terms of discrete components but it may be carried out in software or in dedicated integrated circuits. [0067] While the invention has been described in conjunction with a specific best mode, it is to be understood that many alternatives, modifications, and variations will be apparent to those skilled in the art in light of the aforegoing description. Accordingly, it is intended to embrace all such alternatives, modifications, and variations which fall within the spirit and scope of the included claims. All matters set forth herein or shown in the accompanying drawings are to be interpreted in an illustrative and non-limiting sense. Referenced by
Classifications
Legal Events
Rotate |