Source-linked AI summary

Can LLMs Design Video Coding Tools? A Case Study on Planar Mode

Yingwen Zhang, Meng Wang, Liqiang He, Shiqi Wang

arXiv:2609.01535v1cs.MMcs.AI

TL;DR

The paper investigates whether LLMs can design video coding tools despite their coupling with codec pipelines. It uses an iterative generation-and-evaluation case study on Planar prediction, finding coding gains in VVenC and constrained low-resolution ECM settings while exposing substantial evaluation and transfer limitations.

  • Problem

    The paper asks whether LLMs can design codec-integrated coding tools whose modifications interact intricately with surrounding modules.

  • Method

    An LLM iteratively generates codec-compliant Planar predictor code, encoder trials evaluate candidates, and coding feedback guides subsequent refinement.

  • Results

    Both direct replacement and additional-mode insertion produce coding gains in the evaluated VVenC and constrained low-resolution ECM settings.

  • Takeaways & Limitations

    The results provide preliminary evidence that lightweight, codec-compatible LLM-designed predictors can be competitive under selected coding configurations.

  • Takeaways & Limitations

    Evaluation is computationally expensive, and predictors found at low resolution or in simpler presets do not necessarily transfer to higher resolutions or more saturated configurations.

Abstract

from arXiv · show

This paper explores whether large language models (LLMs) can design video coding tools, a highly challenging task due to the intricate algorithmic coupling of tool modifications. In particular, we present an empirical case study on the Planar mode, a long-standing intra prediction tool in video coding standards. Our experiments operate within a generation-and-evaluation loop, with the LLM generating new Planar predictors, encoder trials evaluating their coding performance, and the LLM re-generating refined implementations based on the evaluation feedback. We first examine directly replacing the default Planar mode in the Fraunhofer Versatile Video Encoder (VVenC) under its faster preset. Experimental results demonstrate that the LLM-generated mode can outperform the conventional Planar mode on this lightweight toolset, achieving 0.18% bitrate savings with 0.4% complexity overhead on the standard benchmark. We further extend our evaluation to the Enhanced Compression Model (ECM). Leveraging newly introduced directional Planar modes, we investigate two integration strategies: directly replacing them, and introducing the LLM-generated predictor as an additional prediction mode with new syntax elements. The empirical results suggest that both strategies can yield coding gains under a constrained low-resolution setting. Overall, this study offers preliminary evidence and practical insights, highlighting both the potential and open challenges of LLM-based coding tool design.

I. INTRODUCTION

The paper asks whether LLMs can design codec-integrated video coding tools despite their coupling with surrounding modules, using Planar mode as a focused case study across VVenC and ECM.

  • LLM-based algorithm design has shown promise for encoder optimization when generation is guided by actual coding feedback.
  • Coding-tool development remains expert-driven, while tool modifications can propagate through transform, quantization, and rate-distortion optimization.
  • Planar mode is selected as a simple, interpretable intra-prediction case for testing whether an LLM can outperform a hand-crafted baseline under codec constraints.
  • The study evaluates direct Planar replacement in VVenC and both replacement and new-mode insertion in ECM.

A. Preliminaries: Planar Prediction

Planar prediction interpolates reconstructed boundary samples to model smoothly varying two-dimensional surfaces, while ECM extends the family with directional variants and corresponding syntax and transform adaptations.

  • Planar prediction forms a two-dimensional block prediction by linearly combining horizontal and vertical interpolations of reconstructed boundaries.Virtual bottom-right references are extrapolated from the bottom-left and top-right corners.
  • The horizontal interpolation combines the left boundary with the top-right corner, while the vertical interpolation combines the top boundary with the bottom-left corner.
  • Planar prediction is efficient for homogeneous regions and is commonly prioritized when constructing the most-probable-mode list.
  • ECM introduces horizontal and vertical directional Planar variants that retain only one interpolation direction.
  • Directional variants are pre-selected by Hadamard cost, inserted into full RDO when competitive, and signaled through Planar-branch MPM syntax with distinct indices.
  • Directional Planar modes derive transform kernels from their corresponding horizontal or vertical intra modes.

B. LLM-Based Planar Mode Design

The proposed workflow uses an LLM to iteratively generate lightweight Planar predictor code, evaluates candidates in the codec, and feeds coding results back into subsequent search iterations.

  • The LLM searches only the core predictor body, while reference preparation and surrounding codec code remain unchanged.
  • Each candidate is syntactically validated, compiled into the codec, evaluated through actual encoding runs, and returned as empirical feedback for later prompting.
  • Prompts combine the optimization task, historical parent candidates, design ideas, C++ implementations, and sequence-level BD-rate feedback.
  • Candidates are ranked with an objective combining average BD-rate and a worst-case-aware regularization term before top-ranked parents are sampled.The objective is J(f) = B̄(f) + λR(f), where R(f) averages the worst-M sequences.
  • The experiment retains K = 16 parents, uses M = 2 and N = 8, and generates 64 candidates per iteration with DeepSeek-V4-Flash in high-thinking mode.

A. VVenC Mode Replacement

The VVenC experiment replaces only the core Planar predictor while retaining the existing syntax, RDO process, and reference samples. Two evolved predictors improve bitrate relative to the VVenC anchor, using distinct mechanisms.

  • Experimental setup: The experiment reuses VVenC’s existing Planar syntax, RDO process, and prepared reference samples, replacing only the core predictor under the faster preset.The evaluation uses VVenC-1.14.0 with a modified random-access configuration and four-thread WPP.
  • Evaluation results: 0.18% average BD-rate reduction is achieved by the λ = 2 predictor relative to the VVenC anchor, with a 0.4% time increase.The λ = 5 predictor achieves a 0.16% average BD-rate reduction.
  • λ = 2 predictor: The λ = 2 predictor adaptively filters the top and left reference lines before interpolation.It applies a three-tap smoothing filter with coefficients [2], repeating the filtering on the less smooth side when the gradient imbalance is large.
  • λ = 2 predictor: The λ = 2 predictor tunes the final averaged surface with a gradient-dependent offset after obtaining interpolation components from filtered references.The offset is clipped, and the predictor preserves the planar structure while suppressing local reference fluctuations.

B. ECM Mode Replacement and Insertion

The ECM study evaluates both replacing directional Planar predictors and inserting an LLM-generated predictor as an additional mode. Both strategies produce coding gains under the restricted low-resolution evaluation setting, with different complexity costs and predictor behaviors.

  • Mode replacement: 0.0271% BD-rate reduction with a 0.42% encoding-time increase results from replacing the two directional Planar predictors.This comparison is against the default ECM-19.1 anchor.
  • Mode insertion: 0.0316% BD-rate reduction with a 0.90% encoding-time increase results from inserting a new Planar-like mode.The inserted mode is evaluated against the default ECM-19.1 anchor under the same restricted setting.
  • Evaluation setting: The ECM evaluation is restricted to eight 416×240 sequences, with one training frame per sequence and ten testing frames.The sequences include four Class D and four downsampled Class C sequences, and all experiments run 30 iterations.
  • Mode replacement: The replacement predictor preserves one-direction interpolation while filtering each directional mode’s one-sided boundary before prediction.Flat regions use more filtered reference, whereas sharp transitions are mostly preserved.
  • Mode insertion: The inserted mode uses more conditioning and clipping operations to create a more aggressive gradient-conditioned Planar-like surface.Its design blends global and smooth gradients using cosine-similarity confidence when sign consistency fails.

IV. CONCLUSION AND DISCUSSION

The study reports preliminary evidence that an LLM generation-and-evaluation loop can discover competitive, lightweight Planar predictors in VVenC and restricted ECM settings. It also identifies computational cost and transfer across resolutions or codec configurations as unresolved challenges.

  • Conclusion: LLMs discover meaningful and competitive Planar predictors under nontrivial coding settings when prompt constraints keep them lightweight and codec-compatible.The VVenC faster-preset predictors use distinct mechanisms, and the study reports reasonable generalization to screen content.
  • Conclusion: Both ECM mode replacement and mode insertion retain bitrate savings under a restricted low-resolution setting.The conclusion frames these findings as part of preliminary experiments on LLM-based coding-tool design.
  • Discussion: Evaluation is computationally too expensive because effective predictor discovery requires exploring a large function space.Nearly 2000 ECM candidates were evaluated before a useful predictor appeared, and one iteration took about one hour on 256 logic cores.
  • Discussion: Predictors found at low resolution do not necessarily transfer well to higher resolutions or from the VVenC faster preset to slower, more saturated configurations.The paper identifies low-complexity in-domain exploration as critical for addressing this transfer limitation.
Loading 2609.01535v1…