Cherry-pick lane-intra14 (e04736b): pin the 10-bit film witness for intra 1:4 strips in an inter frame
Browse files at this commitc7de6d48ea113c3da94d22de7879fbb7b8e809e8Parent: c206f612 changed files +62 -0
crates/ec-av1/fixtures/reelb_intra14_witness.obuadded+0 -0
Binary file changed
crates/ec-av1/src/stream.rsmodified+62 -0
| @@ -28752,4 +28752,66 @@ mod tests { | ||
| 28752 | 28752 | refusals.join("\n") |
| 28753 | 28753 | ); |
| 28754 | 28754 | } |
| 28755 | + | |
| 28756 | + /// lane-intra14 r4: the FILM witness for an intra block on a 1:4 partition | |
| 28757 | + /// inside an INTER frame -- `crates/ec-av1/fixtures/reelb_intra14_witness.obu`, | |
| 28758 | + /// 163057 bytes, sha256 | |
| 28759 | + /// `0eff603bf1608e47faf5e6729670c4c77cf5c674dbad3a1533ac6660151fd90e`, | |
| 28760 | + /// two decode-order frames (key + first inter) cut from two INDEPENDENT | |
| 28761 | + /// `ffmpeg -ss 90 -t 2 -i <3840x1608 10-bit AV1 HDR10 mkv> -c:v copy -f obu` | |
| 28762 | + /// runs that hashed identically. | |
| 28763 | + /// | |
| 28764 | + /// MEASURED (r4, 27 two-second segments of that film at ss 0..6000, probe | |
| 28765 | + /// logs in the report): no aomenc recipe reaches this shape and only ONE | |
| 28766 | + /// class of stream does -- the film's own inter frames. Decode-order frame | |
| 28767 | + /// 1 of this fixture codes 3 intra 16x64 strips (`intra_rect4_in_inter` | |
| 28768 | + /// 16x64=3, zero when the fixture is truncated to the key frame alone), so | |
| 28769 | + /// the counter attribution is pinned to that frame. | |
| 28770 | + /// | |
| 28771 | + /// It is `#[ignore]`d for exactly ONE reason, and not this lane's shape: | |
| 28772 | + /// that same frame stops at a SIBLING refusal, "a split intra strip whose | |
| 28773 | + /// transform unit is 64x32 (no luma coefficient tables for that shape | |
| 28774 | + /// here)". The moment TX_64X32/TX_32X64 luma coefficient tables land, drop | |
| 28775 | + /// the `#[ignore]` -- everything else this gate needs (the reader, the | |
| 28776 | + /// counter, the two-frame pixel compare) is in place and runs. | |
| 28777 | + #[test] | |
| 28778 | + #[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"] | |
| 28779 | + fn a_10bit_film_inter_frame_with_intra_1to4_strips_decodes_pixel_exact() { | |
| 28780 | + const NAME: &str = "a_10bit_film_inter_frame_with_intra_1to4_strips_decodes_pixel_exact"; | |
| 28781 | + if !have_ffmpeg() { | |
| 28782 | + eprintln!("SKIP {NAME}: no ffmpeg"); | |
| 28783 | + return; | |
| 28784 | + } | |
| 28785 | + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) | |
| 28786 | + .join("fixtures/reelb_intra14_witness.obu"); | |
| 28787 | + let stream = std::fs::read(&path) | |
| 28788 | + .unwrap_or_else(|e| panic!("{NAME}: reading {}: {e}", path.display())); | |
| 28789 | + let (width, height) = (3840usize, 1608usize); | |
| 28790 | + let before = intra_rect4_in_inter_counters(); | |
| 28791 | + let frames = match decode_stream(&stream) { | |
| 28792 | + Ok(frames) => frames, | |
| 28793 | + Err(e) => panic!("{NAME}: decode_stream refused: {e}"), | |
| 28794 | + }; | |
| 28795 | + let now = intra_rect4_in_inter_counters(); | |
| 28796 | + let fired = (now.0 - before.0) + (now.1 - before.1) + (now.2 - before.2) + (now.3 - before.3); | |
| 28797 | + assert!( | |
| 28798 | + fired > 0, | |
| 28799 | + "{NAME}: zero intra 1:4 strips in an inter frame (64x16/16x64/32x8/8x32 = \ | |
| 28800 | + {}/{}/{}/{}) -- the fixture stopped carrying the shape this gate exists for", | |
| 28801 | + now.0 - before.0, | |
| 28802 | + now.1 - before.1, | |
| 28803 | + now.2 - before.2, | |
| 28804 | + now.3 - before.3 | |
| 28805 | + ); | |
| 28806 | + assert_eq!(frames.len(), 2, "{NAME}: key frame + one inter frame"); | |
| 28807 | + assert_eq!((frames[0].width, frames[0].height), (width, height)); | |
| 28808 | + let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()); | |
| 28809 | + for (i, (ours, theirs)) in frames.iter().zip(&ffmpeg_frames).enumerate() { | |
| 28810 | + assert_eq!(ours.y, theirs.y, "{NAME}: frame {i} luma vs ffmpeg"); | |
| 28811 | + assert_eq!(ours.u, theirs.u, "{NAME}: frame {i} U vs ffmpeg"); | |
| 28812 | + assert_eq!(ours.v, theirs.v, "{NAME}: frame {i} V vs ffmpeg"); | |
| 28813 | + } | |
| 28814 | + eprintln!("{NAME}: {fired} intra 1:4 strips in an inter frame, both frames pixel-exact"); | |
| 28815 | + } | |
| 28816 | + | |
| 28755 | 28817 | } |