wip(av1): b128 lane snapshot at the turn cap (orchestrator)
Browse files at this commit1e4efceaad31fde2f407b7ea68f3bde86b5f0603Parent: c26b4441 changed file +23 -0
- crates/ec-av1/src/encode.rs +23 -0
crates/ec-av1/src/encode.rsmodified+23 -0
| @@ -12254,6 +12254,24 @@ pub(crate) fn encode_inter_frame( | |||
| 12254 | blocks[at] = quadrant; | 12254 | blocks[at] = quadrant; |
| 12255 | } | 12255 | } |
| 12256 | 12256 | ||
| 12257 | + // lane-b128, `EC_AV1_B128_CENSUS=1`: how many of this INTER frame's 128 | ||
| 12258 | + // superblock roots the search left whole, so a flat BD result is | ||
| 12259 | + // attributable (class `gate-blind-to-feature`). A key frame codes none: | ||
| 12260 | + // only the inter writer has a 128x128 block. | ||
| 12261 | + if crate::envflags::env_flag!("EC_AV1_B128_CENSUS") { | ||
| 12262 | + let whole = blocks | ||
| 12263 | + .iter() | ||
| 12264 | + .filter(|q| matches!(q, Quadrant::Whole128(_))) | ||
| 12265 | + .count(); | ||
| 12266 | + let roots = blocks | ||
| 12267 | + .iter() | ||
| 12268 | + .filter(|q| !matches!(q, Quadrant::Covered)) | ||
| 12269 | + .count(); | ||
| 12270 | + eprintln!( | ||
| 12271 | + "B128 census: inter frame, {whole} whole 128x128 roots, {roots} coded blocks ({:.1}% of the frame's area at 128)", | ||
| 12272 | + 100.0 * (whole * 16) as f64 / blocks.len().max(1) as f64, | ||
| 12273 | + ); | ||
| 12274 | + } | ||
| 12257 | let modes = blocks | 12275 | let modes = blocks |
| 12258 | .iter() | 12276 | .iter() |
| 12259 | .flat_map(Quadrant::blocks) | 12277 | .flat_map(Quadrant::blocks) |
| @@ -18181,6 +18199,11 @@ mod tests { | |||
| 18181 | {i64_edge} on a superblock the frame edge cuts", | 18199 | {i64_edge} on a superblock the frame edge cuts", |
| 18182 | 100.0 * i64_whole as f64 / i64_offered.max(1) as f64, | 18200 | 100.0 * i64_whole as f64 / i64_offered.max(1) as f64, |
| 18183 | ); | 18201 | ); |
| 18202 | + eprintln!( | ||
| 18203 | + "{name}: 128x128 roots {} (search) / {} (writer)", | ||
| 18204 | + take_b128_none_hits(), | ||
| 18205 | + crate::tile::take_sb128_none_hits(), | ||
| 18206 | + ); | ||
| 18184 | eprintln!( | 18207 | eprintln!( |
| 18185 | "{name}: 64x64 roots {} (with a residual {}, split luma {}, compound {})", | 18208 | "{name}: 64x64 roots {} (with a residual {}, split luma {}, compound {})", |
| 18186 | take_b64_root_hits(), | 18209 | take_b64_root_hits(), |