From 90aeec8f41c23ff7861e62d1e57e0f87795b80c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 30 Aug 2026 08:27:34 +0300 Subject: [PATCH] fix(av1): bound the 8x8-OBMC gate's ffmpeg source with -t; correct a false refusal claim The gate's EC_AV1_OBMC8_SOURCE override lets a caller supply a lavfi source that carries no `duration=` of its own; `testsrc2` is endless, so the y4m pipe never closed and the gate hung to its 300 s timeout. `-t` is the bound that holds for every source. Third instance of the class (mandelbrot `end_pts` twice before): bound the trim inside ffmpeg on decode, bound the duration with `-t` on generate. With the bound in place the gate runs 80 attempts in 7 s and shows why it has never fired one 8x8 OBMC block: decode.rs refuses every inter partition below 16x16. Its message claimed "this encoder never writes one", which the run disproves -- reworded to name the real gap. --- crates/ec-av1/src/decode.rs | 2 +- crates/ec-av1/src/stream.rs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 4d9c3d4f..6b310899 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -8169,7 +8169,7 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( let part16 = dec.symbol(&mut cdfs.partition_w16[ctx16]); if part16 != PARTITION_NONE { return Err(unsupported( - "a partition below 16x16 (this encoder never writes one)", + "an inter partition below 16x16 (8x8 and smaller inter blocks are not coded yet)", )); } decode_inter_block( diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 5841fa16..b469fb92 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -3203,6 +3203,11 @@ mod tests { let source = std::env::var("EC_AV1_OBMC8_SOURCE").unwrap_or_else(|_| { format!("gradients=size={width}x{height}:seed={seed}:duration={duration}:rate=25") }); + // A source supplied through EC_AV1_OBMC8_SOURCE need not carry its + // own `duration=`; `-t` is the bound that always holds. Without it + // an endless source (`testsrc2`) fills the pipe forever and the + // gate hangs to its 300 s timeout. + let duration_arg = format!("{duration}"); let y4m = Command::new("ffmpeg") .args([ "-v", @@ -3211,6 +3216,8 @@ mod tests { "lavfi", "-i", &source, + "-t", + &duration_arg, "-pix_fmt", "yuv420p", "-f",