wip(av1): sbpart r3's in-flight rect64 bisect edits, committed verbatim at the turn cap
Browse files at this commitdac1692efcb3d5996f7fade99307c169b1c77f6cParent: 8aa26262 changed files +18 -1
crates/ec-av1/src/decode.rsmodified+8 -1
| @@ -2624,7 +2624,14 @@ fn decode_block_rect64( | ||
| 2624 | 2624 | cdfs, |
| 2625 | 2625 | neighbours.above_mode[c], |
| 2626 | 2626 | neighbours.left_mode[r], |
| 2627 | - true, | |
| 2627 | + // `is_cfl_allowed` (spec 5.11.5) caps CFL at <=32x32; these | |
| 2628 | + // superblock-level HORZ/VERT strips are 64x32/32x64, so unlike | |
| 2629 | + // `decode_block_rect`'s own 32x16/16x32 strips (where `true` is | |
| 2630 | + // correct), CFL must never be offered here -- passing `true` | |
| 2631 | + // read `uv_mode` off the 14-symbol `uv_mode_cfl` CDF instead of | |
| 2632 | + // the real 13-symbol `uv_mode_no_cfl` one and desynced the tile | |
| 2633 | + // from this block's very first symbol (lane-sbpart r3 bisect). | |
| 2634 | + false, | |
| 2628 | 2635 | bw, |
| 2629 | 2636 | bh, |
| 2630 | 2637 | enable_filter_intra, |
crates/ec-av1/src/stream.rsmodified+10 -0
| @@ -6490,6 +6490,16 @@ mod tests { | ||
| 6490 | 6490 | }; |
| 6491 | 6491 | let ffmpeg_frames = ffmpeg_decode_sequence(&stream, width, height, frame_count); |
| 6492 | 6492 | assert_eq!(frames.len(), frame_count); |
| 6493 | + let mismatched = frames | |
| 6494 | + .iter() | |
| 6495 | + .zip(&ffmpeg_frames) | |
| 6496 | + .any(|(got, want)| got.y != want.y || got.u != want.u || got.v != want.v); | |
| 6497 | + if mismatched { | |
| 6498 | + if let Ok(path) = std::env::var("EC_AV1_GATE_DUMP") { | |
| 6499 | + std::fs::write(&path, &stream).expect("writing pinned stream"); | |
| 6500 | + eprintln!("EC_AV1_GATE_DUMP: wrote mismatching stream (seed {seed}) to {path}"); | |
| 6501 | + } | |
| 6502 | + } | |
| 6493 | 6503 | for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() { |
| 6494 | 6504 | assert_eq!(got.y, want.y, "{NAME} frame {i} luma vs ffmpeg (seed {seed})"); |
| 6495 | 6505 | assert_eq!(got.u, want.u, "{NAME} frame {i} U vs ffmpeg (seed {seed})"); |