Abstract
Most video platforms provide video streaming services with different qualities, and the quality of the services is usually adjusted by the resolution of the videos. So high-resolution videos need to be downsampled for compression. In order to solve the problem of video coding at different resolutions, we propose a rate-guided arbitrary rescaling network (RARN) for video resizing before encoding. To help the RARN be compatible with standard codecs and generate compression-friendly results, an iteratively optimized transformer-based virtual codec (TVC) is introduced to simulate the key components of video encoding and perform bitrate estimation. By iteratively training the TVC and the RARN, we achieved 5%-29% BD-Rate reduction anchored by linear interpolation under different encoding configurations and resolutions, exceeding the previous methods on most test videos. Furthermore, the lightweight RARN structure can process FHD (1080p) content at real-time speed (91 FPS) and obtain a considerable rate reduction.
Introduction
In the modern streaming landscape, platforms like TikTok and Netflix must deliver content across a diverse array of devices and network conditions. This is typically achieved through Dynamic Adaptive Streaming over HTTP (DASH), where a single high-resolution source is downsampled into multiple lower-resolution versions to accommodate varying user bandwidths.
Traditionally, this downsampling relies on mathematical interpolation methods like bicubic scaling. However, these methods are "codec-blind"; they do not account for how video encoders (such as H.265/HEVC) actually process data. This often results in the loss of critical details or the preservation of noise that wastes valuable bitrate. While neural-network-based downsamplers exist, they frequently suffer from fixed scaling ratios, high computational costs, and a lack of integration with the actual compression pipeline.
The Rate-guided Arbitrary Rescaling Network (RARN)
To address these challenges, we propose the Rate-guided Arbitrary Rescaling Network (RARN). RARN is a lightweight neural pre-processor designed to downsample video to any arbitrary resolution while specifically optimizing for subsequent compression efficiency.
Key features of the RARN include:
- Arbitrary Scaling: By utilizing coordinate normalization and deformable offsets, the network can handle any scaling ratio, rather than being limited to fixed factors like 2x or 4x.
- Rate-Guidance: The network incorporates a Rate Estimate Module based on a Variational Autoencoder (VAE). This module predicts the bitrate cost of different spatial regions, allowing the network to adaptively preserve textures that are most important for the encoder while discarding "expensive" or redundant information.
Bridging the Gap with a Virtual Codec (TVC)
Because standard video codecs are non-differentiable, they cannot be used directly to train a neural network via backpropagation. To solve this, we introduced the Transformer-based Virtual Codec (TVC) to act as a differentiable proxy during training.
The TVC simulates the two primary modes of video encoding:
- Intra-coding: Uses a Swin-Transformer-based Invertible Neural Network (INN) to model spatial prediction within a single frame.
- Inter-coding: Employs the RAFT model for motion estimation to simulate temporal dependencies between frames.
By training the RARN and TVC iteratively, the RARN learns to produce "compression-friendly" downsampled videos that the real HEVC or VVC codecs can handle more efficiently.
Experimental Results
The framework was trained on the Vimeo90K dataset and evaluated using standard benchmarks, including the XIPH FHD (1080p) dataset and HEVC Standard Test Sequences (Classes A-E).
Compression Efficiency
RARN achieved a 5% to 29% BD-Rate reduction compared to standard linear interpolation. This indicates that for the same level of visual quality, the RARN-processed video requires significantly less data. The model outperformed existing state-of-the-art neural downsampling methods across nearly all test categories, showing particular strength in complex, high-motion sequences.
Real-time Performance
Efficiency is critical for industrial deployment. By optimizing the sampling compensation module, we reduced the model size from 9.3M to 3.4M parameters. This allows the RARN to process 1080p video at 91 FPS on an NVIDIA V100 GPU, meeting the requirements for real-time high-throughput applications.
Conclusion and Future Work
The RARN framework demonstrates that "codec-aware" downsampling can significantly improve streaming efficiency without sacrificing speed. While the current model assumes a specific upsampling method at the decoder, future work will focus on making the RARN adaptive to various user-side upscalers, ensuring optimal performance across all end-user devices.
Summary updated