验证熵守恒二值化在H.264编码中的压缩效率与延迟权衡
An Empirical Study of Entropy-Conserving Binarization in H.264/AVC CABAC
- 将熵守恒二值化(ECB)集成到从零实现的CABAC中,对比多种二值化方案
- 在Kodak数据集上ECB优于单上下文哈夫曼,每符号差距达0.113比特,且随量化值增加而扩大
- 性能瓶颈源于解码器延迟,其根源为O(N*m)复杂度,提出单遍交错变体可解决
CABAC是H.264/AVC的核心熵编码器,也是HEVC和VVC的基础,通过二值化将多符号值分解为二进制块(bins),再由二元算术编码器处理。H.264采用截断无符号整数加k阶指数戈洛姆(UEG)方案;替代方法包括标准哈夫曼及熵守恒二值化(ECB),后者理论上能精确保持熵映射,但尚未在实际二元算术编码器中评估。本文将ECB集成至全新实现的CABAC系统中,与UEG、单上下文哈夫曼及基于每二进制位上下文的哈夫曼变体(HuffmanPos)并列,共用一个M-coder后端。在合成源、基于DCT的程序图像以及完整的24张Kodak图像套件(2,480次往返测试,比特精确验证)上进行基准测试。在程序图像中,当Q=8时出现稀疏性拐点,使ECB超越单上下文哈夫曼,在Q=32时达到31%的压缩率优势。在Kodak数据集上,拐点低于测试范围,ECB在所有量化级均优于单上下文哈夫曼,速率差距从0.031增至0.113比特/符号。尽管与单上下文哈夫曼具有相同每符号二进制位数,但HuffmanPos在15个源单元中有12个表现更优,仅在其余三个中落后最多0.56个百分点。这表明:在低源熵情况下,速率差距主要由二进制流上的上下文分配机制主导,而非二值化方案的每符号二进制位数。此外,ECB解码延迟在大字符集下增加7至10倍,归因于解码器的O(N×m)复杂度;本文提出一种交错单遍变体,可望消除该延迟差距。代码、基准与原始数据已开源。
原文摘要 · Abstract (English)
CABAC, the entropy coder of H.264/AVC and the basis for HEVC and VVC, decomposes multi-symbol values into bins via a binarization scheme before a binary arithmetic coder. H.264 uses Truncated Unary plus k-th order Exp-Golomb (UEG); alternatives include canonical Huffman and the entropy-conserving binarization (ECB), which provably preserves entropy mapping m-ary data to m-1 binary strings but has not been evaluated inside a production binary arithmetic coder. We integrate ECB into a from-scratch CABAC implementation alongside UEG, single-context Huffman, and a Huffman variant with per-bin-position contexts (HuffmanPos), all sharing one M-coder backend. We benchmark all four on synthetic sources, DCT residuals from a procedural image, and the full 24-image Kodak suite (2,480 round-trip trials, bit-exact verified). On the procedural image, a sparsity-driven crossover at Q=8 lets ECB overtake single-context Huffman, reaching 27 percentage points below at Q=32. On Kodak the crossover shifts below the tested range and ECB beats single-context Huffman at every Q, the gap growing from 0.031 to 0.113 bits per symbol. HuffmanPos, sharing Huffman's codewords but allocating one context per bin position, beats ECB on 12 of 15 source cells and loses by at most 0.56 percentage points on the other three, despite the same per-symbol bin count as single-context Huffman. This isolates the dominant mechanism: at low source entropy the rate gap is driven primarily by context allocation over the bin stream, not the binarization's per-symbol bin count. ECB's rate efficiency costs 7 to 10x in decoder latency on large alphabets, traced to an O(N*m) decoder; we sketch an interleaved single-pass variant that would close this gap. Code, benchmarks, and raw data are open source.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。