You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the 2x deinterlace frame pacing in obs-source-deinterlace.c to obs-source #1950
This ports the 2x deinterlace frame pacing decisions in libobs/obs-source-deinterlace.c.h to rust/obs-source, as a new module deinterlace_pacing next to audio_timing (#1936). These decisions move, all from deinterlace_get_closest_frames:
the unbuffered hold check: keep the current frame while its end is ahead, unless time jumped by TS_JUMP_THRESHOLD;
the half-duration step;
the buffered offset;
the unbuffered re-anchor rule (keep the offset unless the frame comes early, or comes late by a field or a tick).
The unbuffered "don't skip ahead" guard in ready_deinterlace_frames moves too.
These stay C:
the async_frames queue and the buffered walk;
first_frame;
deinterlace_process_last_frame;
textures and rendering.
C passes in obs->video.video_time and video_frame_interval_ns, and stores the results.
Plan (one PR, separate commits)
A behaviour-neutral move into libobs/obs-source-deinterlace-pacing.c.h, as hidden pure functions.
Characterization, test_deinterlace_pacing_steps. It pins:
each branch of the re-anchor;
the hold check at TS_JUMP_THRESHOLD ± 1;
a half-duration over 2^32 ns, which truncates in the uint32_t cast;
a timestamp going backwards (u64 wrap);
the first frame's half-duration, which today is computed against deinterlace_frame_ts == 0.
The last three are pinned as characterized, not endorsed.
RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-source-deinterlace-pacing group. Exported symbols are unchanged.
Tier 3 parity against the original C: a proptest over full-range u64 inputs, and sequences that model 25/29.97/50/59.94 field rates into 30/60 fps canvases. Plus a deliberate-break check and port_comparison numbers.
test_deinterlace_2x_field_order (real libobs, both field orders, 50i into 60) must stay green on every lane.
Activity
rdoupe commentedon Oct 23, 2026
Claiming: #1950.
libobs: Move the 2x deinterlace frame pacing into obs-source-deinterl…
test: Characterize the 2x deinterlace frame pacing
obs-source: Add Tier 1 tests for the 2x deinterlace frame pacing port
obs-source: Port the 2x deinterlace frame pacing
obs-source: Check the 2x deinterlace frame pacing port against the C
docs: Record the 2x deinterlace frame pacing port
obs-source: Port the 2x deinterlace frame pacing (obs-rust#1954)
obs-source: Port the async video frame pacing (obs-rust#2046)