From 1e4efceaad31fde2f407b7ea68f3bde86b5f0603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 8 Sep 2026 11:57:07 +0300 Subject: [PATCH] wip(av1): b128 lane snapshot at the turn cap (orchestrator) --- crates/ec-av1/src/encode.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/crates/ec-av1/src/encode.rs b/crates/ec-av1/src/encode.rs index 96e04e69..b2bd29f9 100644 --- a/crates/ec-av1/src/encode.rs +++ b/crates/ec-av1/src/encode.rs @@ -12254,6 +12254,24 @@ pub(crate) fn encode_inter_frame( blocks[at] = quadrant; } + // lane-b128, `EC_AV1_B128_CENSUS=1`: how many of this INTER frame's 128 + // superblock roots the search left whole, so a flat BD result is + // attributable (class `gate-blind-to-feature`). A key frame codes none: + // only the inter writer has a 128x128 block. + if crate::envflags::env_flag!("EC_AV1_B128_CENSUS") { + let whole = blocks + .iter() + .filter(|q| matches!(q, Quadrant::Whole128(_))) + .count(); + let roots = blocks + .iter() + .filter(|q| !matches!(q, Quadrant::Covered)) + .count(); + eprintln!( + "B128 census: inter frame, {whole} whole 128x128 roots, {roots} coded blocks ({:.1}% of the frame's area at 128)", + 100.0 * (whole * 16) as f64 / blocks.len().max(1) as f64, + ); + } let modes = blocks .iter() .flat_map(Quadrant::blocks) @@ -18181,6 +18199,11 @@ mod tests { {i64_edge} on a superblock the frame edge cuts", 100.0 * i64_whole as f64 / i64_offered.max(1) as f64, ); + eprintln!( + "{name}: 128x128 roots {} (search) / {} (writer)", + take_b128_none_hits(), + crate::tile::take_sb128_none_hits(), + ); eprintln!( "{name}: 64x64 roots {} (with a residual {}, split luma {}, compound {})", take_b64_root_hits(),