CA2249259C

Data compression using adaptive bit allocation and hybrid lossless entropy encoding

Abstract

A method and apparatus for adaptive bit allocation and hybrid lossless entropy encoding. The system includes three components: (1) a transform stage, (2) a quantization stage, and (3) a lossless entropy coder stage. The transform stage (1) uses a wavelet transform algorithm. The quantization stage (2) adaptively estimates values for parameters defining an approximation between quantization size and the logarithm of quantization error, and recursively calculates the optimal quantization size for each band to achieve a desired bit rate. The baseband and subbands are transformed into quantization matrices using the corresponding quantization sizes. The lossless entropy coder stage (3) uses the observation that the entropy property of run lengths of zero index values in the subband quantization matrices is different from the entropy property of non-zero indices. Each quantization matrix is parsed so that each non-zero index is extracted into a separate stream, and the remaining position information is parsed into an odd stream of run length values for "0" and an even stream of run length values for "1". These three streams are Huffman coded separately in conventional fashion.

CA2249259C, drawing sheet 1
Sheet 1 of 9

Term

Term ended

Expired 19 March 2017, 9.5 years ago.

  1. Priority
  2. Filed
  3. Granted
  4. Expired
  5. Today

5 claims: 5 independent, 0 dependent

  1. 1
    CA 02249259 2000-08-29 -22CLAIMS What is claimed is:1. A hybrid lossless entropy coding method for compressing data comprising a matrix including a plurality of zero indices and non-zero indices, the method including the steps of: (a) replacing each non-zero index in the matrix by a unique token, thereby generating a parsed matrix including a plurality of zero indices and token indices, the run length codes including even run length codes and odd run length codes;(b) placing each non-zero index from the matrix into a first data stream;(c) run length coding the parsed matrix into alternating run length codes for the zero indices and unique token indices, the run length codes including even run length codes and odd run length codes;(d) placing the even run length codes into a second data stream;(e) placing the odd run length codes into a third data stream;and (f) coding each of the first, second, and third data streams with a lossless entropy coding algorithm. 2. A hybrid lossless entropy coding method for compressing data, the method being implemented in a programmed computer comprising a processor, a data storage system, and at least one output device, the method including the steps of: (a) storing data in the data storage system of the programmed computer, the data comprising a matrix including a plurality of zero indices and non-zero indices;(b) replacing each non-zero index in the matrix by a unique token, thereby generating a parsed matrix including a plurality of zero indices and token indices;(c) placing each non-zero index from the matrix into a first data stream;CA 02249259 2000-08-29 -23(d) run length coding the parsed matrix into alternating run length codes for the zero indices and unique token indices, the run length codes including even run length codes and odd run length codes;(e) placing the even run length codes into a second data stream;(f) placing the odd run length codes into a third data stream;(g) coding each of the first, second, and third data streams with a lossless entropy coding algorithm to thereby generate output information;and (h) applying the output information to at least one of the output devices. 3. The method of claims 1 or 2, wherein the unique token is 1. 4. The method of claims 1 or 2, wherein the lossless entropy coding algorithm is Huffman coding. 5. The method of claims 1 or 2, wherein the lossless entropy coding algorithm is arithmetic coding. 6. The method of claims 1 or 2, wherein the matrix comprises quantization indices derived from an image by a lossy data compression and quantization system. 7. A computer-readable storage medium storing a computer program for compressing data using a hybrid lossless entropy coding algorithm, the data comprising a matrix including a plurality of zero indices and non-zero indices, where the computer program stored on the storage medium causes a computer to operate in a specific and predefined manner to perform the functions of: (a) replacing each non-zero index in the matrix by a unique token, thereby generating a parsed matrix including a plurality of zero indices and token indices;(b) placing each non-zero index from the matrix into a first data stream;(c) run length coding the parsed matrix into alternating run length codes for the zero indices and unique token indices, the run length codes including even run length codes and odd run length codes;CA 02249259 2000-08-29 -24(d) placing the even run length codes into a second data stream;(e) placing the odd run length codes into a third data stream;and (f) coding each of the first, second, and third data streams with a lossless entropy coding algorithm. 8. The invention of claim 7, wherein the unique token is “1”. 9. The invention of claim 7, wherein the lossless entropy coding algorithm is Huffman coding. 10. The invention of claim 7, wherein the lossless entropy coding algorithm is arithmetic coding. 11. The invention of claim 7, wherein the matrix comprises quantization indices derived from an image by a lossy data compression and quantization system. 12. A method for compressing image data, comprising the steps of: (a) storing an image in a computer as image data;(b) applying a transform algorithm to decorrelate the image data into a baseband and multiple subbands;(c) generating quantization coefficients by the steps of: (1) estimating values for parameters defining an approximation between quantization size and the logarithm of quantization error for each subband;
  2. 2
    (2) estimating values for parameters defining an approximation between quantization size and the logarithm of quantization error for the baseband;
  3. 3
    (3) calculating an optimal bit rate for each of the baseband and subbands;
  4. 4
    (4) marking each subband k and excluding it from the subbands if Rk < 0 for such subband k, and then looping to step (3); CA 02249259 2000-08-29 -25(5) calculating a quantization size Qk for each of the baseband and subbands as:Alnγ », - Afin». where Max* and Min* are the maximum and minimum coefficients of subband k, and c* and d* are constants depending on statistical properties of subbband k;(d) applying each quantization size Q* to corresponding ones of the baseband and multiple subbands to generate corresponding quantization matrices each comprising a plurality of zero indices and non-zero indices;(e) applying a hybrid lossless entropy coding algorithm to losslessly compress each quantization matrix by the steps of: (1) replacing each non-zero index in the quantization matrix by a unique token, thereby generating a parsed matrix including a plurality of zero indices and token indices;(2) placing each non-zero index from the quantization matrix into a first data stream;(3) run length coding the parsed matrix into alternating run length codes for the zero indices and unique token indices, the run length codes including even run length codes and odd run length codes;(4) placing the even run length codes into a second data stream;
  5. 5
    (5) placing the odd run length codes into a third data stream;and (6) coding each of the first, second, and third data streams with a lossless entropy coding algorithm.