Fast Fibonacci Encoding Algorithm ? Jiˇ ı Walder, Michal Kr´ atk´ y, and Jan Platoˇ s Department of Computer Science V ˇ SB–Technical University of Ostrava 17. listopadu 15, Ostrava–Poruba, Czech Republic {jiri.walder,michal.kratky,jan.platos}@vsb.cz Abstract. Data compression has been widely applied in many data pro- cessing areas. Compression methods use variable-length codes with the shorter codes assigned to symbols or groups of symbols that appear in the data frequently. Fibonacci code, as a representative of these codes, is often utilized for the compression of small numbers. Time consump- tion of encoding as well as decoding algorithms is important for some applications in the data processing area. In this case, efficiency of these algorithms is extremely important. There are some works related to the fast decoding of variable-length codes. In this paper, we introduce the Fast Fibonacci encoding algorithm; our approach is up-to 4.6× more efficient than the conventional bit-oriented algorithm. 1 Introduction Data compression has been widely applied in many data processing areas. Vari- ous compression algorithms have been developed for processing text documents, images, video, etc. In particular, data compression is of the foremost importance and has been well researched as it is presented in excellent surveys [13,18]. Various codes have been applied for data compression [14]. In contrast with fixed-length codes, statistical methods use variable-length codes, with the shorter codes assigned to symbols or groups of symbols that have a higher probability of occurrence. People who design and implement variable-length 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. In some applications, a prefix code is required to code a set of integers whose length is not known in advance. The prefix code is a variable-length code that satisfies the prefix property. As we know, the binary representation of integers does not satisfy this condition. In other words, the size n of the set of integers has to be known in advance for the binary representation since it determines the code size as 1 + log 2 n. Fibonacci coding is distinguished as a suitable coding for a compression of small numbers [13]. Work is partially supported by Grants of GACR No. P202/10/0573 and SGS, V ˇ SB– Technical University of Ostrava, No. SP/2010138. J. Pokorn´ y, V. Sn´ sel, K. Richta (Eds.): Dateso 2010, pp. 72–83, ISBN 978-80-7378-116-3.