The Fast Fibonacci Decompression Algorithm

Reading time: 6 minute
...

📝 Original Info

  • Title: The Fast Fibonacci Decompression Algorithm
  • ArXiv ID: 0712.0811
  • Date: 2007-12-05
  • Authors: R. Baca, V. Snasel, J. Platos, M. Kratky, E. El-Qawasmeh

📝 Abstract

Data compression has been widely applied in many data processing areas. Compression methods use variable-size codes with the shorter codes assigned to symbols or groups of symbols that appear in the data frequently. Fibonacci coding, as a representative of these codes, is used for compressing small numbers. Time consumption of a decompression algorithm is not usually as important as the time of a compression algorithm. However, efficiency of the decompression may be a critical issue in some cases. For example, a real-time compression of tree data structures follows this issue. Tree's pages are decompressed during every reading from a secondary storage into the main memory. In this case, the efficiency of a decompression algorithm is extremely important. We have developed a Fast Fibonacci decompression for this purpose. Our approach is up to $3.5\times$ faster than the original implementation.

💡 Deep Analysis

Deep Dive into The Fast Fibonacci Decompression Algorithm.

Data compression has been widely applied in many data processing areas. Compression methods use variable-size codes with the shorter codes assigned to symbols or groups of symbols that appear in the data frequently. Fibonacci coding, as a representative of these codes, is used for compressing small numbers. Time consumption of a decompression algorithm is not usually as important as the time of a compression algorithm. However, efficiency of the decompression may be a critical issue in some cases. For example, a real-time compression of tree data structures follows this issue. Tree’s pages are decompressed during every reading from a secondary storage into the main memory. In this case, the efficiency of a decompression algorithm is extremely important. We have developed a Fast Fibonacci decompression for this purpose. Our approach is up to $3.5\times$ faster than the original implementation.

📄 Full Content

Data compression has been widely applied in many data processing areas. Various compression algorithms were developed for processing text documents, images, video, etc. In particular, data compression is of foremost importance and has been quite well researched as it is presented in excellent surveys [8,12].

Various codes have been applied for data compression. In contrast to fixedsize codes, statistical methods use variable-size codes, with the shorter codes assigned to symbols or groups of symbols that have a higher probability of occurrence. Designers and implementors of variable-size codes have to deal with these two problems: (1) assigning codes that can be decoded unambiguously and (2) assigning codes with the minimum average size.

A prefix code is a variable-size code that satisfies the prefix attribute. The binary representation of the integers does not satisfy the prefix attribute. One disadvantage of this representation is that the size n of the set of integers has to be known in advance since it determines the code size as 1 + ⌊log 2 n⌋. In some applications, a prefix code is required to code a set of integers whose size is not known in advance. Several codes such as Elias codes [4], Fibonacci codes [1], Golomb codes [6,11] and Huffman codes [7] have been developed. Fibonacci coding is distinguished as a suitable coding for a compression of small numbers [8].

There are applications where asymmetric algorithms are applied. Let us consider a real-time compression of data structures [10,5,2]. In this case, time consumption of a decompression algorithm is more important than the time of a compression algorithm. When a user query is evaluated, tree’s pages are retrieved from a secondary storage and they are decompressed in the main memory. Consequently, a tree operation, like point or range query [3], works with the decompressed pages. Multidimensional data structures cluster similar tuples on a page [9]. When difference coding [8] is applied to tuple coordinates, small values are necessary to compress. Obviously, Fibonacci coding is suitable for the compression of such data. Since the page decompression is processed in real-time, the decompression algorithm must be as fast as possible.

The original implementation of Fibonacci coding is not suitable for the real-time decompression. Therefore, we developed a fast implementation of Fibonacci coding to be described in this article. In Section 2, theoretical issues of the fast implementation are depicted. In Section 3, the Fast Fibonacci decompression is described. Since the decompression is more important than the compression in our case, we emphasize the decompression algorithm. Moreover, the original compression algorithm for Fibonacci coding is more efficient than the original decompression algorithm. In Section 4, experimental results are presented. Our implementation has 3.5 speedup factor. In the last Section, we conclude this paper and outline future works.

Fibonacci coding is based on Fibonacci numbers, and was defined by Apostolico and Fraenkel [1]. While the Fibonacci code is not asymptotically optimal, they perform well compared to the Elias codes as long as the number of source messages is not too large. The Fibonacci code has the additional attribute of robustness, which manifests itself by the local containment of errors. Every positive integer n has exactly one binary representation of the form n = p i=1 a i F i where a i is either 0 or 1, and F i are the Fibonacci numbers 1, 2, 3, 5, 8, 13, . . . . Let us define F 0 = 1 and F i = 0 for i < 0. This representation has an interesting property; the string a 1 a 2 . . . does not contain any adjacent 1-bits. Fibonacci numbers can be used to construct a prefix code. We use the property that the Fibonacci representation of an integer does not have any adjacent 1-bits. If n is a positive integer, we construct its Fibonacci representation and append a 1-bit to the result. The Fibonacci representation of the integer 5 is 0001, consequently the Fibonacci-prefix code of 5 is 00011. It is obvious that each of these codes ends with two adjacent 1-bits, so they can be decoded uniquely. However, the property of not having adjacent 1-bits restricts the number of binary patterns available for such codes, so they are longer than the other codes. Formally, the Fibonacci code for n is defined as

The Fibonacci code is reversed and an 1-bit is appended. The Fibonacci code values for a small subset of the integers are displayed in Table 1

When the Fibonacci decompression is performed, the compressed memory is read bit by bit. Every bit stands for one number in the Fibonacci sequence. This number is added to the decompressed number if the bit is not 0. The addition stops when two 1-bits are in the sequence. This operation includes time consuming operations like retrieving the bit from the compressed memory. In Section 3, we introduce Fast Fibonacci decompression algorithm, which can be processed without ret

…(Full text truncated)…

📸 Image Gallery

cover.png

Reference

This content is AI-processed based on ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut