Warp pin test covers all three pinned regression streams
Browse files at this commite19a868be3727d6e402ae5f127b6fb8002092bf2Parent: 569067b- test
- warp pin test covers all three pinned regression streams
1 changed file +26 -10
- crates/ec-av1/src/stream.rs +26 -10
crates/ec-av1/src/stream.rsmodified+26 -10
| @@ -3468,22 +3468,38 @@ mod tests { | |||
| 3468 | ); | 3468 | ); |
| 3469 | } | 3469 | } |
| 3470 | 3470 | ||
| 3471 | - /// lane-warp round 3: reproduces the pinned mismatch bytes captured by | 3471 | + /// Pinned streams captured by `EC_AV1_GATE_DUMP` off |
| 3472 | - /// `EC_AV1_GATE_DUMP=$SP/warp-mismatch.obu` off | 3472 | + /// `a_real_aomenc_stream_with_warped_motion_refuses_or_matches` -- each |
| 3473 | - /// `a_real_aomenc_stream_with_warped_motion_refuses_or_matches` (seed 49, | 3473 | + /// one is a former mismatch, kept as a regression pin (warp-mismatch: |
| 3474 | - /// frame 1). Deterministic and static -- `#[ignore]`d, run manually. | 3474 | + /// the WARPED_CAUSAL interp-read suppression; warp-flake-7: the same |
| 3475 | + /// suppression for skip_mode blocks; warp-flake-5: mvstack entry | ||
| 3476 | + /// clamping). `EC_AV1_GATE_DUMP_PIN` overrides to a single stream. | ||
| 3477 | + /// Deterministic and static -- `#[ignore]`d because the gitignored | ||
| 3478 | + /// fixtures dir may be absent; run manually. | ||
| 3475 | #[test] | 3479 | #[test] |
| 3476 | - #[ignore = "reads a pinned fixture path outside the repo; run manually"] | 3480 | + #[ignore = "reads pinned fixture paths under the gitignored fixtures dir; run manually"] |
| 3477 | fn pinned_warp_stream_decodes_pixel_exact() { | 3481 | fn pinned_warp_stream_decodes_pixel_exact() { |
| 3478 | - use crate::decode::warp_selected_hits; | ||
| 3479 | - let path = std::env::var("EC_AV1_GATE_DUMP_PIN").unwrap_or_else(|_| { | ||
| 3480 | - concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures/warp-mismatch.obu").to_string() | ||
| 3481 | - }); | ||
| 3482 | - let stream = std::fs::read(&path).expect("reading pinned stream"); | ||
| 3483 | if !have_ffmpeg() { | 3482 | if !have_ffmpeg() { |
| 3484 | eprintln!("SKIP pinned_warp_stream_decodes_pixel_exact: no ffmpeg"); | 3483 | eprintln!("SKIP pinned_warp_stream_decodes_pixel_exact: no ffmpeg"); |
| 3485 | return; | 3484 | return; |
| 3486 | } | 3485 | } |
| 3486 | + let fixtures = concat!(env!("CARGO_MANIFEST_DIR"), "/../../fixtures"); | ||
| 3487 | + let paths: Vec<String> = match std::env::var("EC_AV1_GATE_DUMP_PIN") { | ||
| 3488 | + Ok(p) => vec![p], | ||
| 3489 | + Err(_) => ["warp-mismatch", "warp-flake-5", "warp-flake-7"] | ||
| 3490 | + .iter() | ||
| 3491 | + .map(|n| format!("{fixtures}/{n}.obu")) | ||
| 3492 | + .collect(), | ||
| 3493 | + }; | ||
| 3494 | + for path in paths { | ||
| 3495 | + eprintln!("pin: {path}"); | ||
| 3496 | + check_pinned_warp_stream(&path); | ||
| 3497 | + } | ||
| 3498 | + } | ||
| 3499 | + | ||
| 3500 | + fn check_pinned_warp_stream(path: &str) { | ||
| 3501 | + use crate::decode::warp_selected_hits; | ||
| 3502 | + let stream = std::fs::read(path).expect("reading pinned stream"); | ||
| 3487 | let before = warp_selected_hits(); | 3503 | let before = warp_selected_hits(); |
| 3488 | let frames = decode_stream(&stream).expect("pinned stream must decode"); | 3504 | let frames = decode_stream(&stream).expect("pinned stream must decode"); |
| 3489 | eprintln!( | 3505 | eprintln!( |