Pin the film witness for intra 1:4 strips in an inter frame, gated on the sibling 64x32 transform refusal
Browse files at this commit45548750a7313ed277d5de3f581cb7a0745bf533Parent: 2955fbb- test
- pin the film witness for intra 1:4 strips in an inter frame, gated on the sibling 64x32 transform refusal
2 changed files +61 -0
crates/ec-av1/fixtures/reelb_intra14_witness.obuadded+0 -0
Binary file changed
crates/ec-av1/src/stream.rsmodified+61 -0
| @@ -5393,6 +5393,67 @@ mod tests { | |||
| 5393 | intra_rect4_in_inter_gate(10); | 5393 | intra_rect4_in_inter_gate(10); |
| 5394 | } | 5394 | } |
| 5395 | 5395 | ||
| 5396 | + /// lane-intra14 r4: the FILM witness for an intra block on a 1:4 partition | ||
| 5397 | + /// inside an INTER frame -- `crates/ec-av1/fixtures/reelb_intra14_witness.obu`, | ||
| 5398 | + /// 163057 bytes, sha256 | ||
| 5399 | + /// `0eff603bf1608e47faf5e6729670c4c77cf5c674dbad3a1533ac6660151fd90e`, | ||
| 5400 | + /// two decode-order frames (key + first inter) cut from two INDEPENDENT | ||
| 5401 | + /// `ffmpeg -ss 90 -t 2 -i <3840x1608 10-bit AV1 HDR10 mkv> -c:v copy -f obu` | ||
| 5402 | + /// runs that hashed identically. | ||
| 5403 | + /// | ||
| 5404 | + /// MEASURED (r4, 27 two-second segments of that film at ss 0..6000, probe | ||
| 5405 | + /// logs in the report): no aomenc recipe reaches this shape and only ONE | ||
| 5406 | + /// class of stream does -- the film's own inter frames. Decode-order frame | ||
| 5407 | + /// 1 of this fixture codes 3 intra 16x64 strips (`intra_rect4_in_inter` | ||
| 5408 | + /// 16x64=3, zero when the fixture is truncated to the key frame alone), so | ||
| 5409 | + /// the counter attribution is pinned to that frame. | ||
| 5410 | + /// | ||
| 5411 | + /// It is `#[ignore]`d for exactly ONE reason, and not this lane's shape: | ||
| 5412 | + /// that same frame stops at a SIBLING refusal, "a split intra strip whose | ||
| 5413 | + /// transform unit is 64x32 (no luma coefficient tables for that shape | ||
| 5414 | + /// here)". The moment TX_64X32/TX_32X64 luma coefficient tables land, drop | ||
| 5415 | + /// the `#[ignore]` -- everything else this gate needs (the reader, the | ||
| 5416 | + /// counter, the two-frame pixel compare) is in place and runs. | ||
| 5417 | + #[test] | ||
| 5418 | + #[ignore = "blocked on a SIBLING refusal, not on this lane: the film frame that carries the intra 1:4 strips (16x64=3) stops at \"a split intra strip whose transform unit is 64x32 (no luma coefficient tables for that shape here)\" -- un-ignore when the 64x32/32x64 luma coefficient tables land"] | ||
| 5419 | + fn a_10bit_film_inter_frame_with_intra_1to4_strips_decodes_pixel_exact() { | ||
| 5420 | + const NAME: &str = "a_10bit_film_inter_frame_with_intra_1to4_strips_decodes_pixel_exact"; | ||
| 5421 | + if !have_ffmpeg() { | ||
| 5422 | + eprintln!("SKIP {NAME}: no ffmpeg"); | ||
| 5423 | + return; | ||
| 5424 | + } | ||
| 5425 | + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) | ||
| 5426 | + .join("fixtures/reelb_intra14_witness.obu"); | ||
| 5427 | + let stream = std::fs::read(&path) | ||
| 5428 | + .unwrap_or_else(|e| panic!("{NAME}: reading {}: {e}", path.display())); | ||
| 5429 | + let (width, height) = (3840usize, 1608usize); | ||
| 5430 | + let before = intra_rect4_in_inter_counters(); | ||
| 5431 | + let frames = match decode_stream(&stream) { | ||
| 5432 | + Ok(frames) => frames, | ||
| 5433 | + Err(e) => panic!("{NAME}: decode_stream refused: {e}"), | ||
| 5434 | + }; | ||
| 5435 | + let now = intra_rect4_in_inter_counters(); | ||
| 5436 | + let fired = (now.0 - before.0) + (now.1 - before.1) + (now.2 - before.2) + (now.3 - before.3); | ||
| 5437 | + assert!( | ||
| 5438 | + fired > 0, | ||
| 5439 | + "{NAME}: zero intra 1:4 strips in an inter frame (64x16/16x64/32x8/8x32 = \ | ||
| 5440 | + {}/{}/{}/{}) -- the fixture stopped carrying the shape this gate exists for", | ||
| 5441 | + now.0 - before.0, | ||
| 5442 | + now.1 - before.1, | ||
| 5443 | + now.2 - before.2, | ||
| 5444 | + now.3 - before.3 | ||
| 5445 | + ); | ||
| 5446 | + assert_eq!(frames.len(), 2, "{NAME}: key frame + one inter frame"); | ||
| 5447 | + assert_eq!((frames[0].width, frames[0].height), (width, height)); | ||
| 5448 | + let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()); | ||
| 5449 | + for (i, (ours, theirs)) in frames.iter().zip(&ffmpeg_frames).enumerate() { | ||
| 5450 | + assert_eq!(ours.y, theirs.y, "{NAME}: frame {i} luma vs ffmpeg"); | ||
| 5451 | + assert_eq!(ours.u, theirs.u, "{NAME}: frame {i} U vs ffmpeg"); | ||
| 5452 | + assert_eq!(ours.v, theirs.v, "{NAME}: frame {i} V vs ffmpeg"); | ||
| 5453 | + } | ||
| 5454 | + eprintln!("{NAME}: {fired} intra 1:4 strips in an inter frame, both frames pixel-exact"); | ||
| 5455 | + } | ||
| 5456 | + | ||
| 5396 | fn intra_rect4_in_inter_gate(bit_depth: u32) { | 5457 | fn intra_rect4_in_inter_gate(bit_depth: u32) { |
| 5397 | const NAME: &str = | 5458 | const NAME: &str = |
| 5398 | "a_real_aomenc_inter_sequence_with_an_intra_1to4_strip_decodes_pixel_exact"; | 5459 | "a_real_aomenc_inter_sequence_with_an_intra_1to4_strip_decodes_pixel_exact"; |