Neural B-Frame Coding: Tackling Domain Shift Issues with Lightweight Online Motion Resolution Adaptation

Sang NguyenQuang, Xiem HoangVan, Wen-Hsiao PengarXiv 2025 · DOI

Abstract

Neural B-frame video codecs often suffer from performance degradation due to "domain shift" when the temporal distance between frames increases during inference. This paper proposes Fast-OMRA, a suite of lightweight neural classifiers designed to adaptively predict optimal downsampling factors for motion estimation. By reducing large motion to a scale manageable by the codec, Fast-OMRA achieves significant bitrate reductions (up to 12.7%) with substantially lower computational overhead compared to exhaustive search methods. The proposed method is a plug-and-play solution that enhances existing codecs without requiring retraining.

Introduction

In modern video coding, B-frames (bi-directionally predicted frames) are essential for high compression efficiency. However, most neural B-frame codecs are trained on short video segments (e.g., a Group-of-Pictures or GOP of 5 frames). When deployed in real-world scenarios with larger GOP sizes (e.g., 32 frames), the temporal distance between a frame and its reference increases significantly. This results in motion that is often too large for the model to estimate accurately, leading to a performance drop known as the domain-shift issue.

A previous solution, Online Motion Resolution Adaptation (OMRA), addressed this by downsampling frames before motion estimation. While effective, OMRA relies on an exhaustive search for the optimal downsampling factor (1x, 2x, 4x, or 8x), which is computationally expensive and impractical for real-time applications.

Proposed Method: Fast-OMRA

The authors introduce Fast-OMRA, which replaces the exhaustive search with lightweight neural classifiers to predict the best downsampling factor ($S$). The system architecture and the classifier structure are shown in Figure 1.

Fast-OMRA architecture and classifier design.

Three variants of the classifier were developed:

  1. Bi-Class (Binary Classifier): Decides if a frame should be processed at full resolution ($S=1$) or requires downsampling. If the latter, a limited search is performed.
  2. Mu-Class (Multi-Class Classifier): Directly predicts one of the four factors ($1, 2, 4, 8$). It is trained using soft labels based on actual Rate-Distortion (RD) costs to handle cases where multiple factors yield similar performance.
  3. Co-Class (Collaborative Classifier): Uses the Mu-Class prediction as a base and performs a selective search on immediate neighbors to refine the choice.

The classifier is remarkably lean, consisting of only three convolutional layers, a pooling layer, and a linear layer, ensuring minimal impact on total encoding time.

Key Insights

  • Motion as a Resolution Problem: Motion estimation failure is often a mismatch in scale. Downsampling effectively brings large motion back into the spatial frequency range the model was originally trained to handle.
  • Soft Labels and Entropy Weighting: Using soft labels during training allows the model to remain robust when multiple downsampling factors are viable. Additionally, entropy weighting helps the model ignore "ambiguous" training samples where the choice of factor has negligible impact on RD performance.

Experimental Results

The models were evaluated on standard benchmarks including HEVC Class B, UVG, and MCL-JCV. Fast-OMRA (specifically the Co-Class variant) achieved an average 10.2% to 12.7% BD-rate reduction compared to the baseline MaskCRT-B codec.

Rate-distortion performance and complexity comparison across different datasets.

As shown in Figure 2, Fast-OMRA maintains nearly all the compression gains of the original exhaustive OMRA while significantly reducing computational complexity. While the original OMRA required ~5863 kMAC/pixel, Fast-OMRA variants operate at approximately 1800-1900 kMAC/pixel, offering a massive speedup for practical deployment.

Conclusion

Fast-OMRA provides a highly efficient solution to the domain-shift problem in neural video coding. By using lightweight classifiers to adapt motion resolution, it achieves state-of-the-art compression gains with a fraction of the complexity of previous methods. Future work includes making the adaptation "layer-aware" to better handle different temporal layers and integrating these classifiers directly into end-to-end codec training.

Summary updated

Abstract

Learned B-frame codecs with hierarchical temporal prediction often encounter the domain-shift issue due to mismatches between the Group-of-Pictures (GOP) sizes for training and testing, leading to inaccurate motion estimates, particularly for large motion. A common solution is to turn large motion into small motion by downsampling video frames during motion estimation. However, determining the optimal downsampling factor typically requires costly rate-distortion optimization. This work introduces lightweight classifiers to predict downsampling factors. These classifiers leverage simple state signals from current and reference frames to balance rate-distortion performance with computational cost. Three variants are proposed: (1) a binary classifier (Bi-Class) trained with Focal Loss to choose between high and low resolutions, (2) a multi-class classifier (Mu-Class) trained with novel soft labels based on rate-distortion costs, and (3) a co-class approach (Co-Class) that combines the predictive capability of the multi-class classifier with the selective search of the binary classifier. All classifier methods can work seamlessly with existing B-frame codecs without requiring codec retraining. Experimental results show that they achieve coding performance comparable to exhaustive search methods while significantly reducing computational complexity. The code is available at: https://github.com/NYCU-MAPL/Fast-OMRA.git.
BibTeX
@misc{nguyenquang2025neural,
  author = {Sang NguyenQuang and Xiem HoangVan and Wen-Hsiao Peng},
  title = {{Neural B-Frame Coding: Tackling Domain Shift Issues with Lightweight Online Motion Resolution Adaptation}},
  year = {2025},
  eprint = {2511.18724},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.18724},
}
Figure