diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index a5ced6ff..08a74022 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -2624,7 +2624,14 @@ fn decode_block_rect64( cdfs, neighbours.above_mode[c], neighbours.left_mode[r], - true, + // `is_cfl_allowed` (spec 5.11.5) caps CFL at <=32x32; these + // superblock-level HORZ/VERT strips are 64x32/32x64, so unlike + // `decode_block_rect`'s own 32x16/16x32 strips (where `true` is + // correct), CFL must never be offered here -- passing `true` + // read `uv_mode` off the 14-symbol `uv_mode_cfl` CDF instead of + // the real 13-symbol `uv_mode_no_cfl` one and desynced the tile + // from this block's very first symbol (lane-sbpart r3 bisect). + false, bw, bh, enable_filter_intra, diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index ab1c8a5d..4e8c7a87 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -6490,6 +6490,16 @@ mod tests { }; let ffmpeg_frames = ffmpeg_decode_sequence(&stream, width, height, frame_count); assert_eq!(frames.len(), frame_count); + let mismatched = frames + .iter() + .zip(&ffmpeg_frames) + .any(|(got, want)| got.y != want.y || got.u != want.u || got.v != want.v); + if mismatched { + if let Ok(path) = std::env::var("EC_AV1_GATE_DUMP") { + std::fs::write(&path, &stream).expect("writing pinned stream"); + eprintln!("EC_AV1_GATE_DUMP: wrote mismatching stream (seed {seed}) to {path}"); + } + } for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() { assert_eq!(got.y, want.y, "{NAME} frame {i} luma vs ffmpeg (seed {seed})"); assert_eq!(got.u, want.u, "{NAME} frame {i} U vs ffmpeg (seed {seed})");