Skip to content

perf: guard: Rust replacements for swresample and swscale must ship with SIMD #3008

Open

Description

@zackees

What

Audio resampling (libobs/media-io/audio-resampler-ffmpeg.c.h, swresample) and software scaling and colorspace conversion (libobs/media-io/video-scaler-ffmpeg.c.h, swscale) are still C wrappers around FFmpeg, which is already hand-tuned SIMD. A Rust replacement without SIMD would be a large regression on every resampled stream and every CPU-scaled frame.

  • Running today: C/FFmpeg (SIMD).
  • Parity: FFmpeg is SIMD, so a ULP or pixel tolerance against it is allowed and must be stated.

Acceptance criteria (guard)

Failing-test sketch

For a replacement PR: a benchmark-bound check comparing the Rust resampler or scaler with the FFmpeg wrapper that fails above 1.10×.

Rules for this work (#756): portable stable Rust only (no std::simd/nightly), a scalar fallback with runtime CPU detection, ISA-specific code only in the crate's src/platform/ (Dylint ban_platform_cfg_outside_boundary). Tier 3 parity is bit-exact unless the C reference itself uses SIMD (docs/rust-port/testing-policy.md:296). RED then GREEN. Every kernel needs a benchmark in rust/tools/benchmarks/record.py first (sub-issue 1 of the meta issue).

Activity

  1. added
    enhancement
    infra
    P3
    size:S
    on Oct 30, 2026
  2. zackees commented on Oct 30, 2026

    @zackees
    MemberAuthor

    Triage: this is a standing guard, not a task to claim now. It applies to any future PR that replaces the swresample or swscale wrappers with Rust: that PR must meet the guard's 1.10x bound. No replacement is planned yet, so it stays open under #3009 as the rule reviewers check against.

  3. added
    tracker
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3enhancementinfrasize:Stracker

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions