Range coders and ANS replace empirical probabilities with integer frequencies summing to a fixed $M$; the resulting per-symbol code-length redundancy is exactly the KL divergence of the empirical distribution from the quantized one. Existing normalizers (Giesen, Bloom, Collet) are heuristic or only partially marginal-optimal. We give three provably KL-optimal algorithms: a bottom-up archetype, a bidirectional exchange repair of Bloom's heap correction, and a top-down window method that runs in $\mathcal{O}(r)$, asymptotically optimal in $r$, where $r$ is the number of positive-count symbols.
翻译:区间编码器和ANS使用和为固定值\(M\)的整数频率替换经验概率;每个符号的码长冗余恰好是经验分布与量化分布之间的KL散度。现有归一化方法(Giesen、Bloom、Collet)或基于启发式,或仅部分边际最优。我们提出三种可证明KL最优的算法:自底向上原型、双向交换修复Bloom堆校正法,以及运行时间为\(\mathcal{O}(r)\)的自顶向下窗口法(在\(r\)上渐近最优,其中\(r\)为具有正计数的符号数)。