Differentiable bit-rate estimation for neural-based video codec enhancement

Amir Said, Manish Kumar Singh, Reza Pourreza · DOI

Abstract

Neural networks (NN) can improve standard video compression by pre- and post-processing the encoded video. For optimal NN training, the standard codec needs to be replaced with a codec proxy that can provide derivatives of estimated bit-rate and distortion, which are used for gradient back-propagation. Since entropy coding of standard codecs is designed to take into account non-linear dependencies between transform coefficients, bit-rates cannot be well approximated with simple per-coefficient estimators. This paper presents a new approach for bit-rate estimation that is similar to the type employed in training end-to-end neural codecs, and able to efficiently take into account those statistical dependencies. It is defined from a mathematical model that provides closed-form formulas for the estimates and their gradients, reducing the computational complexity. Experimental results demonstrate the method's accuracy in estimating HEVC/H.265 codec bit-rates.

Introduction: The "Black Box" Problem in Video Compression

Standard video codecs like H.265/HEVC and H.264/AVC are highly efficient but present a significant challenge for modern machine learning. When training a neural network to enhance video—either by pre-processing before encoding or post-processing after decoding—the objective is to balance distortion (visual quality) against bit-rate (file size).

However, standard codecs use complex, non-linear entropy coding that is non-differentiable. This means researchers cannot calculate a gradient to inform the neural network how to adjust its weights to minimize bit-rate. While "codec proxies" have been developed to estimate distortion, existing bit-rate estimators are often too simplistic, failing to account for the statistical dependencies between coefficients in a video block.

Standard codec with neural pre- and post-processing and the training loop using a differentiable proxy.

Proposed Method: A Differentiable Codec Proxy

Researchers from Qualcomm AI Research have developed a model-based estimation approach that mimics the behavior of end-to-end neural codecs but is specifically tailored for standard transform-based codecs. The core innovation is a differentiable proxy that provides the necessary gradients for back-propagation during training.

Statistical Modeling and Bit-Rate Estimation

The approach moves away from looking at pixels in isolation. Instead, it assumes transform coefficients follow a Laplace distribution, where the variance decays exponentially with frequency. This reflects the empirical reality that most energy in a video block is concentrated in low-frequency components.

Comparison of bit-rate estimation in end-to-end neural codecs versus the proposed method for standard codecs.

To implement this, the system uses a Maximum Likelihood (ML) estimation process. For every video block, Newton’s method is used to find the parameters that best fit the data to the statistical model. To make this viable for training, the authors derived closed-form formulas for the bit-rate estimates and their gradients. A key mathematical shortcut allows the gradient to be computed directly without backpropagating through the iterative Newton steps, reducing computational complexity from $O(M^2N^2)$ to $O(MN)$.

Experimental Evaluation

The method was evaluated using the HEVC Test Model (HM 16.20) reference software on 14,000 frames from the VVC standardization classes. The frames were tested across four Quantization Parameter (QP) values (22, 27, 32, and 37) to ensure accuracy across various bit-rates.

Key Results

  • Accuracy: The proposed method outperformed the standard $\rho$-domain rate control model and achieved accuracy levels close to high-performing but non-differentiable estimators like the AGP method.
  • Stability: Unlike simpler differentiable estimators that often see high error rates (>400%), this method remained stable and tightly clustered around the actual bit-rate used by the HM encoder.
  • Efficiency: High precision was achieved in just three Newton iterations for the majority of cases, making it fast enough for practical neural network training loops.

Conclusion and Future Work

This work effectively bridges the gap between traditional ASIC-based video compression and neural video compression. By providing a differentiable path for bit-rate estimation, it allows standard codecs to benefit from the optimization tools of deep learning. While currently focused on $8 \times 8$ luma blocks, future work will involve adapting the model for variable transform sizes and integrating it into full end-to-end pipelines for tasks like super-resolution and deblocking.

Summary updated

BibTeX
@inproceedings{said2022differentiable,
  author = {Amir Said and Manish Kumar Singh and Reza Pourreza},
  title = {{Differentiable bit-rate estimation for neural-based video codec enhancement}},
  booktitle = {PCS},
  year = {2022},
  doi = {10.1109/pcs56426.2022.10018001},
}
Figure