From a2f865b2c603ae819734909d727697c14dc6586c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 30 Sep 2026 01:20:48 +0300 Subject: [PATCH] stream: pin the band and chroma-rect sweep family to one frame each Four gates, eight sites: the 4:1/sub8 rect-chroma gate, the excluded-seed-46 chroma-rect gate, the seed-46 band stream gate, and the frame-edge-partition-bit gate. The first three encode through rectchroma_stream or its byte-identical inline twin -- 'duration=0.04:rate=25' rendered with '-t 0.04', one frame, no '--limit' -- and the fourth renders with '-t 1' AND '-vframes 1'. One assert per gate sits above the depth branch, so it covers both the 8-bit and the 10-bit site. count-vacuity sweep: 13 unpinned -> 5. --- crates/ec-av1/src/stream.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 469e489c..49077032 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -42085,6 +42085,15 @@ pub(crate) mod tests { } let rect4_now = (crate::decode::sb_rect4_horz_hits() - rect4_before.0) + (crate::decode::sb_rect4_vert_hits() - rect4_before.1); + // The ENCODE's frame count: `rectchroma_stream` (42059) renders + // `duration=0.04:rate=25` (42082) with `-t 0.04` (42094) -- one + // frame -- and its aomenc runs with no `--limit`, so every + // attempt's stream codes exactly 1 frame at both depths. + assert_eq!( + frames.len(), + 1, + "{NAME}: {bit_depth}-bit cq {cq} seed {seed} key frame" + ); let reference = if bit_depth == 10 { ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) } else { @@ -42322,6 +42331,11 @@ pub(crate) mod tests { let stream = rectchroma_stream(bit_depth, 32, 4, width, height); let frames = decode_stream(&stream) .unwrap_or_else(|e| panic!("{NAME}: {bit_depth}-bit seed 46 refused: {e}")); + // The ENCODE's frame count: `rectchroma_stream` (42059) renders + // `duration=0.04:rate=25` (42082) with `-t 0.04` (42094) -- one frame + // -- and its aomenc runs with no `--limit`, so the stream codes + // exactly 1 frame at both depths. Asserted ABOVE the oracle call. + assert_eq!(frames.len(), 1, "{NAME}: {bit_depth}-bit seed 46 key frame"); let reference = if bit_depth == 10 { ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) } else { @@ -42491,6 +42505,15 @@ pub(crate) mod tests { } Ok(frames) => frames, }; + // The ENCODE's frame count: `duration=0.04:rate=25` (42263) is + // one frame and `-t 0.04` (42277) caps the y4m there, and aomenc + // runs with no `--limit` -- so every arm (both depths, all 10 + // seeds) codes exactly 1 frame. Asserted ABOVE the oracle call. + assert_eq!( + frames.len(), + 1, + "{NAME}: {bit_depth}-bit seed {seed} key frame" + ); let reference = if bit_depth == 10 { ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) } else { @@ -42700,6 +42723,16 @@ pub(crate) mod tests { }; let hits = crate::decode::edge_part_hits(); let skip_split_tx = crate::decode::skip_split_tx_hits(); + // The ENCODE's frame count: `-t 1` AND `-vframes 1` (42490) + // cap the y4m at one frame and aomenc is given that one frame + // with no `--limit`, so every arm's stream holds exactly 1 + // coded frame. Asserted ABOVE the oracle call so a decode that + // dropped it reds naming the encode. + assert_eq!( + frames.len(), + 1, + "{NAME}: {width}x{height} depth={depth} key frame" + ); let ffmpeg_frames = if depth == 10 { ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) } else {