Method and Device for Compression and Decompression of Binary Data
20170223354 · 2017-08-03
Inventors
- Gael Rouvroy (Woluwe-Saint-Pierre, BE)
- Thomas Denison (Gembloux, BE)
- Tanguy Gilmont (Court-Saint-Etienne, BE)
Cpc classification
H04N19/91
ELECTRICITY
H04N19/126
ELECTRICITY
H04N19/184
ELECTRICITY
H03M7/3059
ELECTRICITY
International classification
H04N19/91
ELECTRICITY
Abstract
The invention relates to a method for compressing a set of input binary data values x, all coded in a same number B of bits, into a corresponding set of output data values x′, all coded in a smaller number b of bits, obtainable by (i) computing a quantization step size dq
The invention also relates to a method for decompressing data and to applications of said method for compressing/decompressing video data, and to devices for performing these operations.
Claims
1. Method for compressing a set of input binary data values x, all coded in a same number B of bits, without counting the sign bit when the input binary data values comprise negative values, into a corresponding set of output data values x′, all coded in a smaller number b of bits, without counting a sign bit, obtainable by the steps of: a) If the set of input binary data values comprises negative values, for each input binary data value x, determining y, being the absolute value of x, and x.sub.s, being the sign of x, coded in one bit; b) If the set of input binary data values comprises no negative values, for each input binary data value x, determining y, being the value of x; c) computing the quantization step size dq
2. Method according to claim 1, wherein the steps c), d) and e) are performed by executing on fixed-point binary values the steps of right-shifting y by B-b bits giving first result; right-shifting y by B+1 bits giving second result; subtracting second result from first result giving third result; adding 0,5 giving fourth result; select the positive- and zero-weight bits of fourth result, giving y′.
3. Method according to claim 1, comprising the steps of obtaining a lookup table containing, for each of the 2.sup.B values of y, the corresponding value of y′; determining for each value of y in said set, the corresponding value of y′, at index y in said table.
4. Method for compressing input binary data comprising input binary data values into an output binary data, said output binary data having a volume smaller than a limit, the method comprising the steps of grouping said input binary data values in sets of N.sub.GCLI input binary data values; for each of said sets of N.sub.GCLI input binary data values: Determine the GCLI, being the index of the highest non-zero bit in said set, without counting a sign bit selecting a value of GTLI such that counting GCLI−GTLI bits for all said input binary data values produces output binary data having a volume smaller than said limit; for each of said sets of N.sub.GCLI input binary data values: applying the method of any of claim 1, with B=GCLI and b=MAX(GCLI−GTLI,0) producing output binary data comprising the GTLI and for each of said sets of N.sub.GCLI input binary data value, the value of the GCLI and the N.sub.GCLI quantized values x′.
5. Method according to claim 4 where said input binary data is resulting from a decorrelative transform of video data.
6. Method according to claim 4 where N.sub.GCLI is comprised between 4 and 16, and preferably equal to 4.
7. Method for decompressing a set of input binary data values x′, all coded in a same number b of bits, without counting a possible sign bit, into a corresponding set of output data values x″, all coded in a larger number B of bits, without counting a possible sign bit, comprising the steps of: a) computing
y″=└y′.Math.dq┘ e) If the set of input binary data values comprises negative values, for each input binary data value y′, determining x″, being the value of y″ together with x's; f) If the set of input binary data values comprises no negative values, for each input binary data value x′, determining x″, being the value of y″.
8. Method according to claim 7, wherein said step d) comprises the steps of i. left-shifting y′ by B-b bits giving first result; ii. right-shifting first result by b+1 bits giving second result; iii. adding second result to first result giving sum result; iv. copying second result to first result; v. repeating steps ii.-iv. until second result is lower than zero; vi. computing y″ as the integer part of sum result.
9. Method according to claim 7, wherein b≦B/2 and said step d) comprises the steps of i. left-shifting y′ by B-b bits giving first result; ii. right-shifting first result by b+1 bits giving second result; iii. adding second result to first result giving sum result; iv. computing y″ as the integer part of sum result.
10. Method according to claim 7, comprising the steps of obtaining a lookup table containing, for each of the 2.sup.b values of y′, the corresponding value of y″; determining for each value of y′ in said set, the corresponding value of y″, at index y′ in said table.
11. Method for decompressing input binary data comprising sets of N.sub.GCLI input binary data value, each set comprising the value of B, B being the number of bit of decompressed binary data values, the value of b, b being the number of bits of said input binary data values, without counting a possible sign bit, the method comprising the steps of applying the method of claim 7, for obtaining decompressed binary data values; producing output binary data comprising said decompressed binary data values.
12. Method for decompressing according to claim 11 where said decompressed binary data values are completed with a number of ‘0’ bits for obtaining words having a given length.
13. Use of a decompression method according to claim 7 for decompressing a set of input binary data values x′ obtainable by the compression method of any of claims 1 to 6.
14. Device for compressing a set of input binary data values x, all coded in a same number of bits, into a corresponding set of output data values x′, all coded in a smaller number of bits, comprising program code for executing the method of claim 1.
15. Device for compressing a set of input binary data values x, all coded in a same number of bits, into a corresponding set of output data values x′, all coded in a smaller number of bits, comprising hardware for executing the method of claim 2.
16. Device for decompressing a set of input binary data values x′, all coded in a same number of bits, into a corresponding set of output data values x″, all coded in a larger number of bits, comprising program code for executing the method of claim 7.
17. Device for decompressing a set of input binary data values x′, all coded in a same number of bits, into a corresponding set of output data values x″, all coded in a larger number of bits, comprising hardware for executing the method of claim 7.
Description
SHORT DESCRIPTION OF THE DRAWINGS
[0084] These and further aspects of the invention will be explained in greater detail by way of example and with reference to the accompanying drawings in which:
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095] The drawings of the figures are neither drawn to scale nor proportioned. Generally, identical components are denoted by the same reference numerals in the figures.
DETAILED DESCRIPTION OF EMBODIMENTS OF THE INVENTION
[0096] A first component of the invention is a quantization algorithm which offers an advantage in the scope of image compression, requires no extra bit and provides a solution to the problems mentioned in relation to method 1 and method 2 above. The quantization algorithm will be referred to as “GRQ”.
[0097]
[0098] According to the invention, the range of values is divided in 2.sup.b+1−1 subranges (in the example of
The quantization step size is slightly larger than in the prior art (the examples of
The table below shows the resulting subranges, for positive values of x (i.e. the upper right quarter of
TABLE-US-00001 Subrange i first value of x Last value of x nb of values 1 0 8 9 2 9 25 17 3 26 42 17 4 43 59 17 5 60 76 17 6 77 93 17 7 94 110 17 8 111 127 17 128
Quantized values are obtained from the subrange i by subtracting 1. The quantization algorithm always produces the exact number b of bits in the quantized values, and thus is appropriate in compression schemes featuring a rate allocation since it guarantees a predictable rate in function of the quantization level, with a better quality. This makes it the ideal quantization algorithm to be used in conjunction with the second component of this invention, the GCLI values (Greatest Coded Line Index), which allow an efficient rate allocation method, as explained in paragraph [0040].
[0099] As an alternative to the “bin method”, the same quantized values may also be obtained by the following formula:
As can be seen from the right-hand part of this equation, the operation may be achieved with two additions and two binary shifts, the latter being free in logic gates.
A hardware configuration for performing these operations is show on
[0100] The inverse quantization values are obtained by equation
We know from the geometrical series that
Interestingly, y′ is coded on b bits, which allows to simplify expression (2) to
where the “V” operator stands for “binary or”. Actually, since the binary or is applied between b-bit values shifted of i.b positions, this operation can be simplified to concatenating the bits of the successive values. In practical cases, the value of B will not be many times higher than b. If B>b and B<2b+1, it is only necessary to concatenate the bits of y′<<(B−b) and y′>>(2b−B+1), as shown in
[0101] In summary, the operation has the same complexity level than what is done in the state of the art: [0102] the quantization is subtracting two shifted values of Ix′ then adding a bit after the LSB [0103] the inverse quantization is a concatenation of shifted values of y′
The quality of the reconstructed values is higher given the same level of quantization, which means the invention provides an increased quality at the same bitrate in the transmission for a compression algorithm.
[0104] A set of typical test images have been compressed according to the method 2 (having a dead zone, “DZ”) and the invention. The signal to noise ratio PSNR between the compressed image and original image is compared for sixteen test images. The table below shows that the method of the invention has an improvement for all images of the test set.
TABLE-US-00002 PSNR filename PSNR DZ invention improv Image_001.png 32.95 34.45 1.50 Image_002.png 42.60 44.03 1.43 Image_003.png 42.57 43.95 1.38 Image_004.png 37.31 38.49 1.18 Image_005.png 38.23 39.41 1.18 Image_006.png 35.01 36.18 1.17 Image_007.png 41.37 42.49 1.12 Image_008.png 40.46 41.57 1.11 Image_009.png 41.08 42.15 1.07 Image_010.png 33.11 34.00 0.89 Image_011.png 39.27 40.16 0.89 Image_012.png 29.90 30.76 0.86 Image_013.png 36.68 37.54 0.86 Image_014.png 36.16 36.99 0.83 Image_015.png 31.38 32.20 0.82 Image_016.png 34.11 34.92 0.81
[0105] A second component of the invention is related to the compression of input binary data such as video streams. Methods of data compression on values that are correlated, typically image compression, include the two following characteristics: [0106] data are quantized to reduce the amount of bits to store or transmit to the decoder; [0107] information on how the data have been quantized (B-b) is inserted in front of the quantized data, since it will be required by the decoder to apply the inverse quantization. The resulting information is called a codestream.
Since the data offer some level of correlation, for example coefficients produced by a DWT (Discrete Wavelet Transform), there is an advantage in regrouping them and applying common quantization level on vectors or blocks, thus reducing the amount of information the decoder will require to reconstruct the data. Most of the time, the bandwidth of the transmitted codestream is restricted by the communication channel bitrate, or similarly, the size of the compressed file is restricted by the capacity of the storage media. Since higher compression rates yield lower quality of the reconstructed data, it is important for the compression algorithm to be able to produce a codestream which is as close as possible of the optimal bitrate and use all the available bandwidth to maximize the quality. This is the purpose of the rate allocation, which has to determine the quantization level applied to the data such that the quality is maximum for the given bitrate.
The choice of the data structure processed by the rate allocation is of paramount importance, it has to fulfil these requirements: [0108] be concise: usually the compression must be achieved as quickly as possible, and the higher the amount of data processed by the rate allocation, the slower it will take; [0109] be representative of the quality: the rate allocation optimizes the quality for a given bitrate, it must be able to estimate the quality loss in function of the quantization level; [0110] be efficiently transcodable into the codestream: the decoder needs enough information to reconstruct the data (e.g. apply the correct inverse quantization on each block).
[0111] The GCLI value of a vector or block of N.sub.GCLI data is the maximum number of bits necessary to code the magnitude of its values in binary representation. So −6 is coded b110 (plus one sign bit), and requires 3 bits to encode its absolute value. A block with the values (4,9,2,5) has a GCLI=4, since the maximum is 9 and is coded b1001. Zero requires zero bit to encode, and does not need a sign. Further examples are shown in
[0116] The GCLI's are concise, one value represents the maximum logarithm in a block containing multiple values, so it will not require many bits to encode: typically, 16 bits are enough to code coefficients in a DWT, which means that 4-bit GCLI values can be used. If N.sub.GCLI=4, one 4-bit GCLI represents 4 coefficients of 16 bits in the rate allocation, which is a ratio of 1 to 64. This is efficient since neighbor values are correlated and will have similar magnitudes, so using the same number of bits to code them all is near-optimal. This means the GCLI's provide the rate allocation with concise information to compute the output rate in function of the truncation level. Furthermore, the GCLI values actually provide local quantization step sizes dq, as illustrated in
[0117] Using the GCLI method requires a predictable rate in function of the quantization, as explained in paragraph [0004]. The GRQ quantization preserves the zero values and ensures that the number of bits to encode the quantized values remains b, thus allowing an easy control of the output rate in function of the quantization through the parameter GTLI (for each subband) in the rate allocation process. As shown before, it does not suffer from a larger dead zone like other quantization schemes that preserve the number of bits and the zero values, and thus has a lower average error in the decoding.
[0118] The method of the invention achieves compression of a set of coefficients in a few steps, in an extremely simple and effective way for hardware implementation. As this compression scheme encodes several pixels at the same time, parallel encoding of multiple pixels is intrinsic to the proposed codec. It allows reaching high pixel rate with a low complexity codec, while keeping good compression efficiency.
[0119] The present invention has been described in terms of specific embodiments, which are illustrative of the invention and not to be construed as limiting. More generally, it will be appreciated by persons skilled in the art that the present invention is not limited by what has been particularly shown and/or described hereinabove.
[0120] Reference numerals in the claims do not limit their protective scope. Use of the verbs “to comprise”, “to include”, “to be composed of”, or any other variant, as well as their respective conjugations, does not exclude the presence of elements other than those stated. Use of the article “a”, “an” or “the” preceding an element does not exclude the presence of a plurality of such elements.
[0121] The invention may also be described as follows: the invention provides a method and device for compressing a set of input binary data values x, all coded in a same number B of bits, without counting the sign bit when the input binary data values comprise negative values, into a corresponding set of output data values x′, all coded in a smaller number b of bits, without counting a sign bit, obtainable by the steps of: [0122] a) If the set of input binary data values comprises negative values, [0123] for each input binary data value x, determining y, being the absolute value of x, and xs, being the sign of x, coded in one bit; [0124] b) If the set of input binary data values comprises no negative values, [0125] for each input binary data value x, determining y, being the value of x; [0126] c) computing the quantization step size dq