This initiative created a dedicated video quality assessment dataset to drive the development of intelligent pre-processing and post-processing filters for next-generation video compression.
This dataset contains 24 4K YUV 4:2:0 video sequences.
For each category, we sample four bitrates, each corresponding to a distinct downsampling resolution, and apply them to both H.265 and AV1 encoders. This results in a total of eight pipelines per category.
Pipeline:
YUV
Commands:
- Lanczos downsampling
ffmpeg -s 3840x2160 -r 30 -pix_fmt yuv420p -f rawvideo -i Boat.yuv -vf scale={WIDTH_IN}:{HEIGHT_IN}:flags=lanczos -f rawvideo -pix_fmt yuv420p Boat_ds.yuv
- Encoding
# H.265
ffmpeg -s f'{WIDTH_DS}x{HEIGHT_DS}' -r 30 -pix_fmt yuv420p -f rawvideo -i Boat_ds.yuv -c:v libx265 -preset medium -b:v 30 -maxrate f'{BIT_RATE}' -bufsize f'{BUF_SIZE}' -x265-params profile=main -movflags +faststart Boat_ec.yuv
# AV1
ffmpeg -s f'{WIDTH_DS}x{HEIGHT_DS}' -r 30 -pix_fmt yuv420p -f rawvideo -i Boat_ds.yuv -c:v libsvtav1 -b:v f'{BIT_RATE}' -bufsize f'{BUF_SIZE}' -movflags +faststart Boat_ec.mp4
- Decoding
ffmpeg -i Boat_ec.mp4 -c:v rawvideo -pix_fmt yuv420p -f rawvideo Boat_dc.yuv
- Lanczos upsamling
ffmpeg -s f'{WIDTH_DS}x{HEIGHT_DS}' -r 30 -pix_fmt yuv420p -f rawvideo -i Boat_dc.yuv -vf scale=3840:2160:flags=lanczos -f rawvideo -pix_fmt yuv420p Boat_us.yuv
Here, the variable are valued as follow:
WIDTH_DS
HEIGHT_DS
BIT_RATE
BUF_SIZE
Deep Downsampler: CAR (TIP 2020)
Pipeline:
YUV
Commands:
Compared to the baseline, only the downsampling command is changed in this pipeline. The encoding, decoding and upsampling commands are the same as those in the baseline.
The deep downsampling procedure can be divided into three steps:
Step 1 (optional). 1.5x downsample the RGB images by the Lanczos filter
The published CAR parameters include 2x and 4x downsampling filters. Since our settings also require 3x and 6x downsampling, we first apply a 1.5x downsampling using the Lanczos filter.
Step 2. Convert a yuv420p video to RGB images;
def YUVvideo2IMGs(yuv_video_path, output_dir, height, width):
img_size = (height * width * 3 // 2)
frames = int(os.path.getsize(yuv_video_path) / img_size)
with open(yuv_video_path, 'rb') as f:
for frame_idx in range(frames):
yuv = np.zeros(shape=img_size, dtype='uint8', order='C')
for j in range(img_size):
yuv[j] = ord(f.read(1))
img = yuv.reshape((height * 3 // 2, width))
bgr_img = cv2.cvtColor(img, cv2.COLOR_YUV2BGR_I420)
if bgr_img is not None:
output_path = os.path.join(output_dir, f'frame_{frame_idx:05d}.bmp')
cv2.imwrite(output_path, bgr_img)
Step 3. Downsample the RGB images by CAR;
Download pre-trained models from link and add them into CAR/models.
python run_downsample.py --img_dir /path/to/high/resolution/images/ --scale 2 --output_dir /path/to/low/resolution/images/
Step 4. Convert RGB images to a yuv420p video.
def IMG2YUVvideo(img_dir, prefix, save_path):
image_files = [f for f in os.listdir(img_dir)
if f.startswith(prefix) and f.lower().endswith(('.bmp'))]
img_list = sorted(image_files)
img = cv2.imread(os.path.join(img_dir, img_list[0]))
(height, width, _) = img.shape
with open(save_path, 'wb') as f:
for img_name in img_list:
img_path = os.path.join(img_dir, img_name)
img = cv2.imread(img_path)
yuv = cv2.cvtColor(img, cv2.COLOR_BGR2YUV_I420)
yuv = yuv.reshape(height * width * 3 // 2)
f.write(np.array(yuv, dtype='uint8').tobytes())
Denoising filter: BM3D
Pipeline:
YUV
Denoising should be operated before downsampling, which is claimed in link.
Commands:
# Denoising
ffmpeg -s {WIDTH_IN}x{HEIGHT_IN} -r 30 -pix_fmt yuv420p -f rawvideo -i Boat.yuv -filter_complex bm3d=sigma=20:block=16:bstep=2:group=1:estim=basic -f rawvideo -pix_fmt yuv420p Boat_dn.yuv
Besides, the Lanczos downsampling command, encoding command, decoding command and Lanczos upsampling command are the same as those in the baseline.
Sharpening filter improves the end-to-end compression efficiency with respect to the original source video under a fixed heuristic filter parameter set, which is mentioned in [VMAF Based Rate-Distortion Optimization for Video Coding. MMSP 2020].
Sharpening filter: ffmpeg unsharp
Pipeline:
YUV
Commands:
# Unsharp
ffmpeg -s {WIDTH_DS}x{HEIGHT_DS} -r str(FPS) -pix_fmt yuv420p -f rawvideo -i Boat_ds.yuv -vf unsharp=luma_msize_x=5:luma_msize_y=5:luma_amount=1.0:chroma_msize_x=3:chroma_msize_y=3:chroma_amount=0.0 -f rawvideo -pix_fmt yuv420p Boat_sharp.yuv
Besides, the Lanczos downsampling command, encoding command, decoding command and Lanczos upsampling command are the same as those in the baseline.
General deep upsampler: Swin-IR (ICCV 2021)
Pipeline:
YUV
Commands:
Similar to the deep downsampler CAR, this method is also based on RGB images with 2x and 4x parameters published. Therefore, I apply 1.5x upsampling to the low-resolution YUV video when its resolution is 1280x720 and 640x360. Then, I transform the low-resolution YUV video to RGB images and upsample them by Swin-IR. Finally, I transform the high-resolution RGB images into a YUV video.
Step 1 (optional). Lanczos upsample the YUV video to 1.5x when the resolution of the input vidoes are 1280x720 or 640x360.
ffmpeg -s 1280x720 -r 30 -pix_fmt yuv420p -f rawvideo -i Boat_us.yuv -vf scale={1920}:{1080}:flags=lanczos -f rawvideo -pix_fmt yuv420p Boat_us2.yuv
Step 2. Transform a YUV video into RGB images.
The same as the YUVvideo2IMGs function in 2.1 Deep Downsampling.
Step 3. Deep upsampling 2x or 4x using Swin-IR.
Download 4x and 2x models and save them into SwinIR/model_zoo/.
python main_test_swinir.py --task real_sr --scale 2 --model_path model_zoo/003_realSR_BSRGAN_DFO_s64w8_SwinIR-M_x2_GAN.pth --folder_lq /path/to/low/quality/images
Step 4. Transform RGB images into a YUV video.
The same as the IMG2YUVvideo function in 2.1 Deep Downsampling.
Besides, the Lanczos downsampling command, encoding command and decoding command are the same as those in the baseline.
Compression-aware deep upsampler: PnP-VCVE (CVPR 2025)
Only 4x model parameters are published. Hence, I haven't run this pipeline.
Pipeline:
YUV
Despite the improved capabilities of video codecs, banding artifacts remain a dominant visual impairment of high-quality, high-definition compressed videos. This fact is mentioned in [Adaptive Debanding Filter. IEEE Signal Processing Letters 2020.]
Debanding filter: ffmpeg deband
Pipeline:
YUV
Commands:
# deband
ffmpeg -s 3840x2160 -r 30 -pix_fmt yuv420p -f rawvideo -i Boat_us.yuv -vf deband -f rawvideo -pix_fmt yuv420p Boat_db.yuv
Besides, the Lanczos downsampling, encoding, decoding and Lanczos upsampling commands are the same as those in the baseline.
Deblocking filter: ffmpeg deblock
Pipeline:
YUV
Commands:
# deblock
ffmpeg -s 3840x2160 -r 30 -pix_fmt yuv420p -f rawvideo -i Boat_us.yuv -vf deblock=filter=strong -f rawvideo -pix_fmt yuv420p Boat_deblock.yuv
Besides, the Lanczos downsampling, encoding, decoding and Lanczos upsampling commands are the same as those in the baseline.
Decompression filter: STDF (AAAI 2020)
Pipeline:
YUV
Commands:
# decompression
python test_one_video.py
I modified the inference code so that this model can be applied directly to YUV videos.
Besides, the Lanczos downsampling, encoding, decoding and Lanczos upsampling commands are the same as those in the baseline.
Deep Downsampler: CAR
Deep Upsampler: SwinIR
Pipeline:
YUV
All commands are defined before.
Pipeline:
YUV
All commands are defined before.
Pipeline:
YUV
All commands are defined before.
Deep Rescaler: CAR
Pipeline:
YUV
Commands:
# CAR upsampling
python run_upsample.py --img_dir /path/to/decoded/videos/ --scale 2 --output_dir /path/to/output/dir/
Other commands are defined before.