forge
Explore
Log in

Don't you dare go Hollow

wip(av1): svt1 lane snapshot at the turn cap (orchestrator)

Browse files at this commit

a77a341ee251bd9f90f41f04a1fd131dc3732c09Ahmet Kaan GümüşParent: 778c3d3
crates/ec-av1/examples/decode_probe.rsmodified+4 -0
@@ -50,6 +50,10 @@ fn main() {
5050 let (rtu, rsplit, robmc) = ec_av1::stream::rect_inter_tu_counters();
5151 println!("rect_inter: tu={rtu} txsplit={rsplit} obmc_leaf={robmc}");
5252 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+ );
5357 println!("interintra_rect: {}", ec_av1::decode::interintra_rect_hits());
5458 println!("gm_nontrans_small_side: {}", ec_av1::decode::gm_nontrans_small_side_hits());
5559 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 {
21192119 SKIP_SPLIT_TX_HITS.with(|c| c.get())
21202120 }
21212121
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+
21222140 /// Zeroes [`SKIP_SPLIT_TX_HITS`] before a gate's own decode attempt.
21232141 pub fn reset_skip_split_tx_hits() {
21242142 SKIP_SPLIT_TX_HITS.with(|c| c.set(0));
@@ -14209,9 +14227,21 @@ fn decode_block(
1420914227 // `logical_tx`-sized window of that same map, set fresh inside the TU loop
1421014228 // below (lane-palette2 r7) -- setting the full-block buffer here would be
1421114229 // 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.
1421214239 if let Some(buf) = &palette_y_buf
14213- && logical_tx == side
14240+ && (logical_tx == side)
1421414241 {
14242+ if skip && logical_tx < side {
14243+ hit!(SKIP_SPLIT_TX_OVERRIDE_HITS);
14244+ }
1421514245 set_palette_pred(buf.clone(), fctx);
1421614246 }
1421714247 // 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
2123021260 || crate::envflags::is_set("EC_AV1_POSTCDEF_DUMP16")
2123121261 || crate::envflags::is_set("EC_AV1_DEBUG_SKIP_DEBLOCK")
2123221262 || crate::envflags::is_set("EC_AV1_DEBUG_SKIP_CDEF")
21263+ || crate::envflags::is_set("EC_AV1_DEBUG_SKIP_LR")
2123321264 || crate::envflags::is_set("EC_AV1_DEBUG_CDEF_BAND")
2123421265 || crate::envflags::is_set("EC_AV1_DEBLOCK_TRACE")
2123521266 || crate::envflags::is_set("EC_AV1_DEBLOCK_TRACE_V"))
@@ -21494,6 +21525,10 @@ fn apply_loop_restoration(
2149421525 // (class av1-truesize-lane: true frame size vs mi-rounded).
2149521526 (frame_w, frame_h): (usize, usize), fctx: &crate::decode::FrameCtx,
2149621527 ) {
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+ }
2149721532 let mut out = scratch_empty();
2149821533 crate::restoration::apply_loop_restoration_plane(
2149921534 &y.data,