From 397bfd75464fdd04b10e0a3e22d348bfc4820bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 30 Aug 2026 16:58:51 +0300 Subject: [PATCH] diag(av1): superres gate stream dump + deblock horz-edge trace at mi_col 11 lane-superres r6: localized the 2-pixel gate residue to horizontal-edge deblock filtering at the rightmost mi column (x0=44..47) of the coded (pre-superres) frame. EC_SUPERRES_STREAM_DUMP (stream.rs) and EC_AV1_DEBLOCK_TRACE (decode.rs, HEDGE line at x0==44) are new env-gated diagnostics, off by default, left in place for the next round. --- crates/ec-av1/src/decode.rs | 9 +++++++++ crates/ec-av1/src/stream.rs | 3 +++ 2 files changed, 12 insertions(+) diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index c3c75a61..40577bbb 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -4292,6 +4292,15 @@ fn deblock_plane(plane: &mut PlaneBuf, plane_idx: usize, lf: &LoopFilterParams, let mut y0 = 4usize; while y0 < th { if let Some((len, level)) = edge_params(lf, n, plane_idx, 1, chroma, x0, y0) { + if std::env::var_os("EC_AV1_DEBLOCK_TRACE").is_some() + && plane_idx == 0 + && x0 == 44 + { + eprintln!( + "HEDGE x0={x0} y0={y0} len={len} level={level} sharpness={}", + lf.sharpness + ); + } filter_edge( &mut plane.data, y0 * stride + x0, diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index db4b1e22..2d43f398 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -3918,6 +3918,9 @@ mod tests { String::from_utf8_lossy(&out.stderr) ); let stream = out.stdout; + if let Ok(path) = std::env::var("EC_SUPERRES_STREAM_DUMP") { + std::fs::write(path, &stream).expect("dump stream"); + } let frames = decode_stream(&stream).unwrap_or_else(|e| panic!("{NAME} refused: {e}")); assert_eq!(frames.len(), frame_count);