stream: pin the band and chroma-rect sweep family to one frame each
Browse files at this commita2f865b2c603ae819734909d727697c14dc6586cParent: ae844021 changed file +33 -0
- crates/ec-av1/src/stream.rs +33 -0
crates/ec-av1/src/stream.rsmodified+33 -0
| @@ -42085,6 +42085,15 @@ pub(crate) mod tests { | |||
| 42085 | } | 42085 | } |
| 42086 | let rect4_now = (crate::decode::sb_rect4_horz_hits() - rect4_before.0) | 42086 | let rect4_now = (crate::decode::sb_rect4_horz_hits() - rect4_before.0) |
| 42087 | + (crate::decode::sb_rect4_vert_hits() - rect4_before.1); | 42087 | + (crate::decode::sb_rect4_vert_hits() - rect4_before.1); |
| 42088 | + // The ENCODE's frame count: `rectchroma_stream` (42059) renders | ||
| 42089 | + // `duration=0.04:rate=25` (42082) with `-t 0.04` (42094) -- one | ||
| 42090 | + // frame -- and its aomenc runs with no `--limit`, so every | ||
| 42091 | + // attempt's stream codes exactly 1 frame at both depths. | ||
| 42092 | + assert_eq!( | ||
| 42093 | + frames.len(), | ||
| 42094 | + 1, | ||
| 42095 | + "{NAME}: {bit_depth}-bit cq {cq} seed {seed} key frame" | ||
| 42096 | + ); | ||
| 42088 | let reference = if bit_depth == 10 { | 42097 | let reference = if bit_depth == 10 { |
| 42089 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) | 42098 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) |
| 42090 | } else { | 42099 | } else { |
| @@ -42322,6 +42331,11 @@ pub(crate) mod tests { | |||
| 42322 | let stream = rectchroma_stream(bit_depth, 32, 4, width, height); | 42331 | let stream = rectchroma_stream(bit_depth, 32, 4, width, height); |
| 42323 | let frames = decode_stream(&stream) | 42332 | let frames = decode_stream(&stream) |
| 42324 | .unwrap_or_else(|e| panic!("{NAME}: {bit_depth}-bit seed 46 refused: {e}")); | 42333 | .unwrap_or_else(|e| panic!("{NAME}: {bit_depth}-bit seed 46 refused: {e}")); |
| 42334 | + // The ENCODE's frame count: `rectchroma_stream` (42059) renders | ||
| 42335 | + // `duration=0.04:rate=25` (42082) with `-t 0.04` (42094) -- one frame | ||
| 42336 | + // -- and its aomenc runs with no `--limit`, so the stream codes | ||
| 42337 | + // exactly 1 frame at both depths. Asserted ABOVE the oracle call. | ||
| 42338 | + assert_eq!(frames.len(), 1, "{NAME}: {bit_depth}-bit seed 46 key frame"); | ||
| 42325 | let reference = if bit_depth == 10 { | 42339 | let reference = if bit_depth == 10 { |
| 42326 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) | 42340 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) |
| 42327 | } else { | 42341 | } else { |
| @@ -42491,6 +42505,15 @@ pub(crate) mod tests { | |||
| 42491 | } | 42505 | } |
| 42492 | Ok(frames) => frames, | 42506 | Ok(frames) => frames, |
| 42493 | }; | 42507 | }; |
| 42508 | + // The ENCODE's frame count: `duration=0.04:rate=25` (42263) is | ||
| 42509 | + // one frame and `-t 0.04` (42277) caps the y4m there, and aomenc | ||
| 42510 | + // runs with no `--limit` -- so every arm (both depths, all 10 | ||
| 42511 | + // seeds) codes exactly 1 frame. Asserted ABOVE the oracle call. | ||
| 42512 | + assert_eq!( | ||
| 42513 | + frames.len(), | ||
| 42514 | + 1, | ||
| 42515 | + "{NAME}: {bit_depth}-bit seed {seed} key frame" | ||
| 42516 | + ); | ||
| 42494 | let reference = if bit_depth == 10 { | 42517 | let reference = if bit_depth == 10 { |
| 42495 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) | 42518 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) |
| 42496 | } else { | 42519 | } else { |
| @@ -42700,6 +42723,16 @@ pub(crate) mod tests { | |||
| 42700 | }; | 42723 | }; |
| 42701 | let hits = crate::decode::edge_part_hits(); | 42724 | let hits = crate::decode::edge_part_hits(); |
| 42702 | let skip_split_tx = crate::decode::skip_split_tx_hits(); | 42725 | let skip_split_tx = crate::decode::skip_split_tx_hits(); |
| 42726 | + // The ENCODE's frame count: `-t 1` AND `-vframes 1` (42490) | ||
| 42727 | + // cap the y4m at one frame and aomenc is given that one frame | ||
| 42728 | + // with no `--limit`, so every arm's stream holds exactly 1 | ||
| 42729 | + // coded frame. Asserted ABOVE the oracle call so a decode that | ||
| 42730 | + // dropped it reds naming the encode. | ||
| 42731 | + assert_eq!( | ||
| 42732 | + frames.len(), | ||
| 42733 | + 1, | ||
| 42734 | + "{NAME}: {width}x{height} depth={depth} key frame" | ||
| 42735 | + ); | ||
| 42703 | let ffmpeg_frames = if depth == 10 { | 42736 | let ffmpeg_frames = if depth == 10 { |
| 42704 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) | 42737 | ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()) |
| 42705 | } else { | 42738 | } else { |