前缀码的高效紧致表示
Efficient and Compact Representations of Prefix Codes
摘要:
统计压缩中的大部分注意力都集中在压缩序列所使用的空间上,这个问题完全可以用最佳前缀码来解决。然而,在许多应用中,用于表示前缀代码本身的存储空间可能是一个问题。本文介绍并比较了几种存储前缀码的技术。令$N$为序列长度,$n$为字母表大小。然后,最优前缀码的朴素存储使用$O(n\log n)$位。我们的第一种技术展示了如何使用$O(n\log\log(N/n))$位来存储最佳前缀码。然后,我们介绍了一种近似的技术,对于任何$0<ε<1/2$,需要$O(n \log \log (1 / ε))$位存储的前缀码的平均码字长度内的最小值的添加剂$ε$。最后,对于任何恒定的$c > 1$,第二种近似采用$O(n^{1 / c} \log n)$比特来存储平均码字长度最多为$c$乘以最小值的前缀码。在所有情况下,我们的数据结构允许在$O(1)$时间内对任何符号进行编码和解码。我们通过实验将我们的新技术与现有技术进行了比较,结果表明,我们以较慢的编码(慢2.5- 8倍)和解码(慢12- 24倍)为代价,实现了6- 8倍的空间减少。近似进一步减少了这个空间,并显着提高了时间,恢复经典实现的速度,平均代码长度的适度惩罚。作为一个副产品,我们比较各种启发式,近似和最佳算法来生成长度限制代码,显示出最佳的是明显的优越性和实用性,足以实施。
英文摘要:
Most of the attention in statistical compression is given to the space used by the compressed sequence, a problem completely solved with optimal prefix codes. However, in many applications, the storage space used to represent the prefix code itself can be an issue. In this paper we introduce and compare several techniques to store prefix codes. Let $N$ be the sequence length and $n$ be the alphabet size. Then a naive storage of an optimal prefix code uses $O(n\log n)$ bits. Our first technique shows how to use $O(n\log\log(N/n))$ bits to store the optimal prefix code. Then we introduce an approximate technique that, for any $0<ε<1/2$, takes $O(n \log \log (1 / ε))$ bits to store a prefix code with average codeword length within an additive $ε$ of the minimum. Finally, a second approximation takes, for any constant $c > 1$, $O(n^{1 / c} \log n)$ bits to store a prefix code with average codeword length at most $c$ times the minimum. In all cases, our data structures allow encoding and decoding of any symbol in $O(1)$ time. We experimentally compare our new techniques with the state of the art, showing that we achieve 6--8-fold space reductions, at the price of a slower encoding (2.5--8 times slower) and decoding (12--24 times slower). The approximations further reduce this space and improve the time significantly, up to recovering the speed of classical implementations, for a moderate penalty in the average code length. As a byproduct, we compare various heuristic, approximate, and optimal algorithms to generate length-restricted codes, showing that the optimal ones are clearly superior and practical enough to be implemented.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。