wip(av1): svt1 lane snapshot at the turn cap (orchestrator)
Browse files at this commita77a341ee251bd9f90f41f04a1fd131dc3732c09Parent: 778c3d32 changed files +40 -1
crates/ec-av1/examples/decode_probe.rsmodified+4 -0
| @@ -50,6 +50,10 @@ fn main() { | ||
| 50 | 50 | let (rtu, rsplit, robmc) = ec_av1::stream::rect_inter_tu_counters(); |
| 51 | 51 | println!("rect_inter: tu={rtu} txsplit={rsplit} obmc_leaf={robmc}"); |
| 52 | 52 | println!("sub8_inter_split: groups={}", ec_av1::decode::sub8_inter_split_hits()); |
| 53 | + println!( | |
| 54 | + "skip_split_tx_override: {}", | |
| 55 | + ec_av1::decode::skip_split_tx_override_hits() | |
| 56 | + ); | |
| 53 | 57 | println!("interintra_rect: {}", ec_av1::decode::interintra_rect_hits()); |
| 54 | 58 | println!("gm_nontrans_small_side: {}", ec_av1::decode::gm_nontrans_small_side_hits()); |
| 55 | 59 | println!("tr_reach_longer_side: {}", ec_av1::decode::tr_reach_longer_side_hits()); |
crates/ec-av1/src/decode.rsmodified+36 -1
| @@ -2119,6 +2119,24 @@ pub fn skip_split_tx_hits() -> usize { | ||
| 2119 | 2119 | SKIP_SPLIT_TX_HITS.with(|c| c.get()) |
| 2120 | 2120 | } |
| 2121 | 2121 | |
| 2122 | +// lane-svt1: SKIPPED square blocks carrying a palette/intrabc prediction whose | |
| 2123 | +// `tx_depth` split the luma transform -- the arm that predicted DC off the | |
| 2124 | +// block edges before the fix. Like [`SKIP_SPLIT_TX_HITS`] only the pixels | |
| 2125 | +// witness this path, so a gate that wants it needs the counter. | |
| 2126 | +thread_local! { | |
| 2127 | + static SKIP_SPLIT_TX_OVERRIDE_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | |
| 2128 | +} | |
| 2129 | + | |
| 2130 | +/// Current value of [`SKIP_SPLIT_TX_OVERRIDE_HITS`] (blocks). | |
| 2131 | +pub fn skip_split_tx_override_hits() -> usize { | |
| 2132 | + SKIP_SPLIT_TX_OVERRIDE_HITS.with(|c| c.get()) | |
| 2133 | +} | |
| 2134 | + | |
| 2135 | +/// Zeroes [`SKIP_SPLIT_TX_OVERRIDE_HITS`] before a gate's own decode attempt. | |
| 2136 | +pub fn reset_skip_split_tx_override_hits() { | |
| 2137 | + SKIP_SPLIT_TX_OVERRIDE_HITS.with(|c| c.set(0)); | |
| 2138 | +} | |
| 2139 | + | |
| 2122 | 2140 | /// Zeroes [`SKIP_SPLIT_TX_HITS`] before a gate's own decode attempt. |
| 2123 | 2141 | pub fn reset_skip_split_tx_hits() { |
| 2124 | 2142 | SKIP_SPLIT_TX_HITS.with(|c| c.set(0)); |
| @@ -14209,9 +14227,21 @@ fn decode_block( | ||
| 14209 | 14227 | // `logical_tx`-sized window of that same map, set fresh inside the TU loop |
| 14210 | 14228 | // below (lane-palette2 r7) -- setting the full-block buffer here would be |
| 14211 | 14229 | // taken by the FIRST unit and indexed at the wrong stride. |
| 14230 | + // lane-svt1: a SKIPPED block predicts the whole `side`x`side` in ONE call | |
| 14231 | + // (the `else` arm below -- a palette/intrabc block never takes the per-unit | |
| 14232 | + // `split_tx_skip` walk), so its map must be armed here even when the | |
| 14233 | + // transform is split. Gating the arm on `logical_tx == side` alone left a | |
| 14234 | + // 16x16 palette block with `tx_depth == 1` and `skip == 1` predicting DC | |
| 14235 | + // off its own edges: right symbols, wrong pixels (SVT-AV1 preset-8 screen | |
| 14236 | + // key frame; class override-slot-on-one-arm). Neither prediction is | |
| 14237 | + // edge-derived, so the whole-block buffer at the block's own stride is | |
| 14238 | + // exactly what that single call wants. | |
| 14212 | 14239 | if let Some(buf) = &palette_y_buf |
| 14213 | - && logical_tx == side | |
| 14240 | + && (logical_tx == side) | |
| 14214 | 14241 | { |
| 14242 | + if skip && logical_tx < side { | |
| 14243 | + hit!(SKIP_SPLIT_TX_OVERRIDE_HITS); | |
| 14244 | + } | |
| 14215 | 14245 | set_palette_pred(buf.clone(), fctx); |
| 14216 | 14246 | } |
| 14217 | 14247 | // A UV-palette block's own chroma prediction override (lane-palette2 r1), |
| @@ -21230,6 +21260,7 @@ fn pipe_filters_ok(fctx: &crate::decode::FrameCtx, tile_cols: u32, lf_present: b | ||
| 21230 | 21260 | || crate::envflags::is_set("EC_AV1_POSTCDEF_DUMP16") |
| 21231 | 21261 | || crate::envflags::is_set("EC_AV1_DEBUG_SKIP_DEBLOCK") |
| 21232 | 21262 | || crate::envflags::is_set("EC_AV1_DEBUG_SKIP_CDEF") |
| 21263 | + || crate::envflags::is_set("EC_AV1_DEBUG_SKIP_LR") | |
| 21233 | 21264 | || crate::envflags::is_set("EC_AV1_DEBUG_CDEF_BAND") |
| 21234 | 21265 | || crate::envflags::is_set("EC_AV1_DEBLOCK_TRACE") |
| 21235 | 21266 | || crate::envflags::is_set("EC_AV1_DEBLOCK_TRACE_V")) |
| @@ -21494,6 +21525,10 @@ fn apply_loop_restoration( | ||
| 21494 | 21525 | // (class av1-truesize-lane: true frame size vs mi-rounded). |
| 21495 | 21526 | (frame_w, frame_h): (usize, usize), fctx: &crate::decode::FrameCtx, |
| 21496 | 21527 | ) { |
| 21528 | + // lane-svt1 debug rung, env-gated: see `apply_cdef`/`apply_deblock`'s siblings. | |
| 21529 | + if crate::envflags::env_flag!("EC_AV1_DEBUG_SKIP_LR") { | |
| 21530 | + return; | |
| 21531 | + } | |
| 21497 | 21532 | let mut out = scratch_empty(); |
| 21498 | 21533 | crate::restoration::apply_loop_restoration_plane( |
| 21499 | 21534 | &y.data, |