Correcting the Sub-optimal Bit Allocation

Tongda Xu, Han Gao, Yuanyuan Wang, Hongwei Qin, Yan Wang, Jingjing Liu, Ya-Qin Zhang

Abstract: In this paper, we investigate the problem of bit allocation in Neural Video Compression (NVC). First, we reveal that a recent bit allocation approach claimed to be optimal is, in fact, sub-optimal due to its implementation. Specifically, we find that its sub-optimality lies in the improper application of semi-amortized variational inference (SAVI) on latent with non-factorized variational posterior. Then, we show that the corrected version of SAVI on non-factorized latent requires recursively applying back-propagating through gradient ascent, based on which we derive the corrected optimal bit allocation algorithm. Due to the computational in-feasibility of the corrected bit allocation, we design an efficient approximation to make it practical. Empirical results show that our proposed correction significantly improves the incorrect bit allocation in terms of R-D performance and bitrate error, and outperforms all other bit allocation methods by a large margin.

Introduction

Neural video compression (NVC) relies on intelligent bit allocation to balance visual quality and file size. Because video codecs utilize temporal references—where one frame predicts the next—uniform quality settings across a sequence are inherently inefficient. Bit allocation is the critical process of deciding how many bits to allocate to each frame or region to minimize the overall Rate-Distortion (R-D) cost.

Recently, a method known as Bit Allocation using Optimization (BAO) attempted to solve this using Semi-Amortized Variational Inference (SAVI). While BAO claimed optimality, this research identifies a fundamental flaw: BAO treats latent variables (such as motion and residual data) as independent. In reality, these variables exhibit complex, autoregressive dependencies. By ignoring these dependencies during optimization, BAO produces incorrect gradient signals, leading to sub-optimal compression and high bitrate errors.

Methodology

Correcting SAVI for Non-Factorized Latents

The core contribution of this work is the mathematical overhaul of how bit allocation is optimized in NVC. The authors extend the SAVI framework to handle "non-factorized" latents—variables that depend on one another.

Comparison of dependency graphs for different bit allocation strategies: (a) joint model, (b) SAVI on factorized latents, and (c) the proposed SAVI on non-factorized latents.

As illustrated in Figure 1 above, traditional SAVI (b) assumes independence. However, the correct gradient calculation for non-factorized latents (c) requires recursively back-propagating through the gradient ascent steps themselves. The authors model these dependencies as a Directed Acyclic Graph (DAG), where motion latents serve as parents to residual latents, and previous frames serve as parents to subsequent ones.

Feasible Approximation

While the mathematically perfect correction is computationally explosive (exponential complexity), the authors designed an "Approximate SAVI on DAG latent" to make the approach practical.

Comparison between the sub-optimal BAO (Algorithm 3) and the proposed Approximate SAVI (Algorithm 4).

As shown in Algorithm 4, the method traverses the dependency graph in topological order. This ensures that "parent" variables (like motion) are fully optimized before "child" variables (like residuals) are processed. This maintains correct gradient flow while keeping computational cost linear—comparable to the original BAO method.

Experimental Results

The researchers evaluated their approach using standard benchmarks (HEVC CTC Classes B-E and the UVG dataset) on top of two prominent neural video codecs: DVC and DCVC.

Key Performance Metrics

  • BD-BR (Bitrate Savings): On the DCVC baseline, the proposed method achieved over 10% better bitrate savings than BAO across multiple datasets.
  • Bitrate Accuracy: A striking result was the reduction in bitrate error. While BAO often missed its target bitrate by 20-25%, the proposed method reduced this error to approximately 3-4%.
  • Efficiency: Despite its mathematical rigor, the approximate algorithm is more efficient, achieving superior R-D performance using only 920 gradient steps per frame on average, compared to the 2,000 steps required by BAO.

Discussion and Conclusion

The primary insight of this work is that simultaneous updates of dependent latents break the relationship between the encoder and decoder during optimization. Topological ordering is mandatory for gradient integrity. Interestingly, the method's advantage stems primarily from bitrate savings—learning exactly where to "pinch pennies" without sacrificing final output quality.

Currently, the method is best suited for Video-on-Demand scenarios (e.g., Netflix or YouTube) where encoding time is less critical than storage and streaming efficiency. Future work will focus on improving scalability for larger Group of Pictures (GoP) sizes and automating hyperparameter tuning for the gradient ascent steps.

Summary updated

BibTeX
@misc{xu2022correcting,
  author = {Tongda Xu and Han Gao and Yuanyuan Wang and Hongwei Qin and Yan Wang and Jingjing Liu and Ya-Qin Zhang},
  title = {{Correcting the Sub-optimal Bit Allocation}},
  year = {2022},
  eprint = {2209.14575},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.14575},
}
Figure