From c8cc7efd632fb1a73fbaa371045de9e36d8afbc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Sep 2026 04:36:04 +0300 Subject: [PATCH] feat(av1): per-transform-unit intra prediction inside a rect strip, at mi granularity decode_rect_split now takes an mi position and a (tx_w, tx_h) transform unit, so it can name strips a coarse 16-px cell cannot (a 32x8 HORZ_4 strip, an 8-px-tall leaf) and walk rectangular units. New depth_to_tx_wh replaces the `bw.min(bh) >> (depth - 1)` unit formula at every 2:1 call site: libaom's sub_tx_size_map halves the LONGER side of a rect, so a 1:4 strip's first split is still a 2:1 RECT unit (TX_32X8 -> TX_16X8, TX_64X16 -> TX_32X16) -- the same root cause lane-rectchroma measured mis-tiling a depth-1 64x16 strip, fixed once. Two real defects found by the sweep: - decode_leaf_rect read cdfs.tx_size_cat2 for a 16x8/8x16 strip; bsize_to_tx_size_cat is 1 for BLOCK_16X8/8X16 (same symbol count, different CDF row) -- a wrong-table read of a real symbol. - its luma tx_type CDF row was the block's raw (always DC_PRED) mode under filter intra instead of fimode_to_intradir[filter_intra_mode]; main 1a89ed9 fixed that inside read_plane, this is its rect sibling. Extracted as tx_type_mode_row and used by both. Lifts the sub-16 split-transform refusal. GATE: the pinned 16x8 filter-intra fixture is now a whole-frame pixel compare against ffmpeg (was expect_err) and asserts sub16_split_hits > 0. ReelB mid-film extract moves from "a 32x32-level 1:4 strip with a split transform (depth=2)" to the unrelated HORZ_A/B-below-16x16 refusal. The per-unit RECT walk is implemented but REFUSED by name: it mismatched ffmpeg on the 1:4 band fixture (8-bit cq 12 seed 42), and since depth 1 fires before depth 2 in every splitting attempt, the depth-2 half cannot be gated either -- both stay refused. The 1:4 gate gained a --enable-tx-size-search=1 half of its window that asserts those refusals are reached, never mismatched. Suite: 321 passed, 0 failed, 30 ignored ($HOME/.cache/rectsplitx-suite.log). --- crates/ec-av1/src/decode.rs | 466 +++++++++++++++++++++---- crates/ec-av1/src/refusal_inventory.rs | 3 +- crates/ec-av1/src/stream.rs | 104 ++++-- lanes/rectsplitx-r1.report.md | 105 ++++++ 4 files changed, 590 insertions(+), 88 deletions(-) create mode 100644 lanes/rectsplitx-r1.report.md diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 6b0c84fe..ed9133aa 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -1629,6 +1629,30 @@ thread_local! { static RECT4_COEFF_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; } +// lane-rectsplitx r1: 1:4 strips (32x8/8x32/64x16/16x64) decoded through the +// per-transform-unit split path, split by tx depth -- depth 1 is a 2:1 RECT +// unit (TX_16X8/TX_32X16), depth 2 a square one, and the two INTERLEAVE in +// every real stream, so a gate must prove both fired. `SUB16_SPLIT_HITS` +// counts the same for a 16x8/8x16 strip below 16x16. +thread_local! { + static RECT4_SPLIT_DEPTH1_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; + static RECT4_SPLIT_DEPTH2_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; + static SUB16_SPLIT_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Current values of `RECT4_SPLIT_DEPTH1_HITS` / `RECT4_SPLIT_DEPTH2_HITS`. +pub(crate) fn rect4_split_depth_hits() -> (usize, usize) { + ( + RECT4_SPLIT_DEPTH1_HITS.with(|c| c.get()), + RECT4_SPLIT_DEPTH2_HITS.with(|c| c.get()), + ) +} + +/// Current value of `SUB16_SPLIT_HITS`. +pub(crate) fn sub16_split_hits() -> usize { + SUB16_SPLIT_HITS.with(|c| c.get()) +} + /// Current value of `RECT4_COEFF_HITS`. pub(crate) fn rect4_coeff_hits() -> usize { RECT4_COEFF_HITS.with(|c| c.get()) @@ -3796,11 +3820,26 @@ impl Neighbours { /// [`Self::around_mi`]'s plain coded/uncoded bit, this needs the real /// cumulative level -- a lone-TU block never calls this (its `txb_skip_ctx` /// is always 0, spec's `plane_bsize == tx_size` branch). - fn luma_skip_ctx(&self, (mi_r, mi_c): (usize, usize), side_mi: usize) -> usize { + fn luma_skip_ctx(&self, at_mi: (usize, usize), side_mi: usize) -> usize { + self.luma_skip_ctx_rect(at_mi, side_mi, side_mi) + } + + /// [`Self::luma_skip_ctx`] with the unit's own width and height in mi + /// units (lane-rectsplitx r1) -- `get_txb_ctx_general` ORs the above + /// context over `tx_size_wide` and the left one over `tx_size_high`. + fn luma_skip_ctx_rect( + &self, + (mi_r, mi_c): (usize, usize), + w_mi: usize, + h_mi: usize, + ) -> usize { + let side_mi = w_mi; let mut top = 0u8; let mut left = 0u8; - for cell in 0..side_mi { + for cell in 0..w_mi { top |= self.above[mi_c + cell][0].level; + } + for cell in 0..h_mi { left |= self.left[mi_r + cell][0].level; } let ctx = SKIP_CONTEXTS[(top as usize).min(4)][(left as usize).min(4)]; @@ -4041,13 +4080,27 @@ impl Neighbours { /// Leaves `above_side_mi`/`left_side_mi` and the chroma planes alone -- /// the caller's own [`Self::record_split_luma`] call sets those once, /// at the block's own true side, not this TU's. - fn record_mi_luma(&mut self, (mi_r, mi_c): (usize, usize), tx_px: usize, grid: &[i32]) { + fn record_mi_luma(&mut self, at_mi: (usize, usize), tx_px: usize, grid: &[i32]) { + self.record_mi_luma_rect(at_mi, tx_px, tx_px, grid); + } + + /// [`Self::record_mi_luma`] for a RECTANGULAR transform unit (lane-rectsplitx + /// r1): the above context spans the unit's width, the left context its + /// height, which for a square unit is the same loop it always was. + fn record_mi_luma_rect( + &mut self, + (mi_r, mi_c): (usize, usize), + w_px: usize, + h_px: usize, + grid: &[i32], + ) { let state = neighbour_state(grid); - let side_mi = tx_px / MI; - for cell in 0..side_mi { + for cell in 0..h_px / MI { if mi_r + cell < self.mi_rows { self.left[mi_r + cell][0] = state; } + } + for cell in 0..w_px / MI { if mi_c + cell < self.mi_cols { self.above[mi_c + cell][0] = state; } @@ -4085,17 +4138,42 @@ impl Neighbours { chroma_grids: [&[i32]; 2], ) { let (r, c) = at; - for cell in 0..w / SUB { + self.record_split_luma_rect_mi( + (r * (SUB / MI), c * (SUB / MI)), + w, + h, + mode, + uv_mode, + chroma_grids, + ); + } + + /// [`Self::record_split_luma_rect`] addressed in mi units (lane-rectsplitx + /// r1) -- a strip 8 px tall starts mid-[`SUB`]-cell, which the coarse + /// `(r, c)` form cannot name. The coarse mode/side arrays are stamped for + /// every cell the strip TOUCHES (`div_ceil`), last writer wins, the + /// convention [`decode_block_rect4`] already established for 1:4 strips. + fn record_split_luma_rect_mi( + &mut self, + at_mi: (usize, usize), + w: usize, + h: usize, + mode: usize, + uv_mode: usize, + chroma_grids: [&[i32]; 2], + ) { + let (mi_r, mi_c) = at_mi; + let (r, c) = (mi_r / (SUB / MI), mi_c / (SUB / MI)); + for cell in 0..w.div_ceil(SUB) { self.above_mode[c + cell] = mode; self.above_uv_mode[c + cell] = uv_mode; self.above_side[c + cell] = w; } - for cell in 0..h / SUB { + for cell in 0..h.div_ceil(SUB) { self.left_mode[r + cell] = mode; self.left_uv_mode[r + cell] = uv_mode; self.left_side[r + cell] = h; } - let (mi_r, mi_c) = (r * (SUB / MI), c * (SUB / MI)); let (w_mi, h_mi) = (w / MI, h / MI); self.record_mode_mi(mi_r, mi_c, w_mi, h_mi, mode); self.record_uv_mode_mi(mi_r, mi_c, w_mi, h_mi, uv_mode); @@ -4667,6 +4745,41 @@ struct RectStripModes { smooth_neighbor_uv: bool, } +/// The `tx_type` CDF row a luma transform unit reads under `filter_intra` +/// (spec 5.11.47 / libaom `av1_read_tx_type`): `fimode_to_intradir` of the +/// filter-intra mode, never the block's own mode -- which is always +/// `DC_PRED` whenever filter intra is on, so using it desyncs the stream at +/// the first coefficient TU of every filter-intra block (main 1a89ed9 fixed +/// exactly that inside [`read_plane`]; every rect coefficient path needs the +/// same row). +fn tx_type_mode_row(mode: usize, filter_intra: Option) -> usize { + const FIMODE_TO_INTRADIR: [usize; 5] = [DC_PRED, V_PRED, H_PRED, D157_PRED, DC_PRED]; + filter_intra.map_or(mode, |fi| FIMODE_TO_INTRADIR[fi]) +} + +/// The transform unit size (w, h) of a `bw`x`bh` intra block at tx `depth` +/// -- libaom `depth_to_tx_size`, which walks `sub_tx_size_map` `depth` times +/// from `max_txsize_rect_lookup[bsize]`. Every entry of that map halves the +/// LONGER side of a rectangle and both sides of a square, so a 1:4 strip's +/// first step is a 2:1 rect unit (`TX_32X8 -> TX_16X8`, `TX_64X16 -> +/// TX_32X16`) and only the second reaches a square -- the reason +/// `bw.min(bh) >> (depth - 1)` (correct for a 2:1 strip, where step one is +/// already square) mis-tiled 1:4 strips. +fn depth_to_tx_wh(bw: usize, bh: usize, depth: usize) -> (usize, usize) { + let (mut w, mut h) = (bw.min(64), bh.min(64)); + for _ in 0..depth { + match w.cmp(&h) { + std::cmp::Ordering::Greater => w /= 2, + std::cmp::Ordering::Less => h /= 2, + std::cmp::Ordering::Equal => { + w /= 2; + h /= 2; + } + } + } + (w, h) +} + /// Decodes the planes of one `bw`x`bh` HORZ/VERT intra strip whose luma /// transform is SPLIT (`tx_depth != 0`) -- lane-rectsplit r1, the case every /// rect path here refused by name until now ("per-unit rect prediction is not @@ -4692,10 +4805,15 @@ fn decode_rect_split( dec: &mut SymbolDecoder, cdfs: &mut Cdfs, neighbours: &mut Neighbours, - at: (usize, usize), + at_mi: (usize, usize), bw: usize, bh: usize, - tx: usize, + // The transform unit's own width and height in pixels. Square for every + // 2:1 strip from the first split on, but a 1:4 strip's FIRST split is + // still a 2:1 RECT unit (`sub_tx_size_map[TX_32X8] == TX_16X8`, + // `[TX_64X16] == TX_32X16`) -- see [`depth_to_tx_wh`]. + tx_w: usize, + tx_h: usize, m: &RectStripModes, y: &mut PlaneBuf, u: &mut PlaneBuf, @@ -4703,9 +4821,8 @@ fn decode_rect_split( base_q_idx: u8, reduced_tx_set: bool, ) -> Result<()> { - let (r, c) = at; - let (px, py) = (c * SUB, r * SUB); - let (mi_r, mi_c) = (r * (SUB / MI), c * (SUB / MI)); + let (mi_r, mi_c) = at_mi; + let (px, py) = (mi_c * MI, mi_r * MI); let (cpx, cpy) = (px / 2, py / 2); let (chroma_w, chroma_h) = (bw / 2, bh / 2); // The chroma transform is picked before any symbol is read, so an @@ -4715,6 +4832,18 @@ fn decode_rect_split( (8, 16) => Some((TxbSet::ChromaRect16x8, &SCAN_8X16[..])), (32, 16) => Some((TxbSet::ChromaRect32x16, &SCAN_32X16[..])), (16, 32) => Some((TxbSet::ChromaRect32x16, &SCAN_16X32[..])), + // The 1:4 and sub-16 strips (lane-rectsplitx r1). `get_txsize_entropy_ctx` + // squares a rect transform down to a CDF set by + // `(wide_log2 + high_log2 + 1) >> 1`: TX_32X8 -> the 16x16 set, + // TX_16X4 -> the 8x8 set, TX_8X4 -> the 8x8 set -- exactly the sets + // the UNSPLIT 1:4 (`decode_block_rect4`) and 16x8 (`decode_leaf_rect`) + // paths already prove for these same shapes. + (32, 8) => Some((TxbSet::Chroma16, &SCAN_32X8[..])), + (8, 32) => Some((TxbSet::Chroma16, &SCAN_8X32[..])), + (16, 4) => Some((TxbSet::Chroma8, &SCAN_16X4[..])), + (4, 16) => Some((TxbSet::Chroma8, &SCAN_4X16[..])), + (8, 4) => Some((TxbSet::ChromaRect8x4, &SCAN_8X4[..])), + (4, 8) => Some((TxbSet::ChromaRect8x4, &SCAN_4X8[..])), _ => None, }; // lane-rectsplit r2 (verifier finding): with both callers wired @@ -4730,21 +4859,56 @@ fn decode_rect_split( )); } RECT_SPLIT_TX_HITS.with(|c| c.set(c.get() + 1)); - if bw.max(bh) == 64 && bw / tx > 1 && bh / tx > 1 { + if bw.max(bh) == 64 && bw / tx_w > 1 && bh / tx_h > 1 { RECT_SPLIT_SB_INTERIOR_TU_HITS.with(|c| c.set(c.get() + 1)); } // LUMA: `bw/tx` x `bh/tx` square transform units, raster order. - let luma_set = txbset_for(tx, reduced_tx_set); - let luma_scan = default_scan(tx); - let zero_tu = vec![0i32; tx * tx]; + // A square unit reads through the ordinary square [`read_plane`]; a rect + // one (a 1:4 strip's first split) reads through [`read_coeffs_rect`] with + // the very tables the unsplit 16x8/32x16 paths use. + let luma_rect: Option<(TxbSet, &[u16])> = match (tx_w, tx_h) { + (w, h) if w == h => None, + (16, 8) | (8, 16) => Some(( + if reduced_tx_set { + TxbSet::LumaRect16x8 + } else { + TxbSet::LumaRect16x8Set1 + }, + if tx_w == 16 { &SCAN_16X8[..] } else { &SCAN_8X16[..] }, + )), + (32, 16) => Some((TxbSet::LumaRect32x16, &SCAN_32X16[..])), + (16, 32) => Some((TxbSet::LumaRect32x16, &SCAN_16X32[..])), + _ => { + return Err(unsupported(format!( + "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma \ + coefficient tables for that shape here)" + ))) + } + }; + // lane-rectsplitx r1, MEASURED: the SQUARE-unit walk below is pixel-exact + // on a real stream (the pinned 16x8 filter-intra fixture decodes its whole + // frame exactly, two sub-16 split strips in it), but the RECT-unit arm -- + // a 1:4 strip's depth-1 TX_16X8/TX_32X16 -- mismatched ffmpeg on the + // 32-level 1:4 band fixture (8-bit, cq 12, seed 42). The tables and the + // per-unit rect walk stay wired above/below; the round that finds that + // defect deletes this refusal and nothing else. + if tx_w != tx_h { + return Err(unsupported(format!( + "a split intra strip whose transform unit is the rect {tx_w}x{tx_h} (the depth-1 \ + step of a 1:4 strip; measured wrong pixels, refused rather than shipped)" + ))); + } + let luma_set = txbset_for(tx_w.min(tx_h), reduced_tx_set); + let luma_scan = default_scan(tx_w.min(tx_h)); + let zero_tu = vec![0i32; tx_w * tx_h]; // The strip's OWN edge availability, the fallback for a transform unit // whose top-right/bottom-left pixels fall outside the strip. let block_reach = Reach::of_rect(bw, bh, px, py, y.width, y.height); - for tu_row in 0..bh / tx { - for tu_col in 0..bw / tx { - let tu_mi = (mi_r + tu_row * (tx / MI), mi_c + tu_col * (tx / MI)); - let (tu_px, tu_py) = (px + tu_col * tx, py + tu_row * tx); - let (col_off, row_off) = (tu_col * tx, tu_row * tx); + for tu_row in 0..bh / tx_h { + for tu_col in 0..bw / tx_w { + let tu_mi = (mi_r + tu_row * (tx_h / MI), mi_c + tu_col * (tx_w / MI)); + let (tu_px, tu_py) = (px + tu_col * tx_w, py + tu_row * tx_h); + let (col_off, row_off) = (tu_col * tx_w, tu_row * tx_h); // `has_top_right`/`has_bottom_left` (libaom `reconintra.c`) for a // transform unit INSIDE a block, which is a different rule from // the standalone-block table [`Reach::of`] applies -- and the @@ -4761,24 +4925,25 @@ fn decode_rect_split( // neighbour's, already reconstructed; the last row falls back // to the block-level answer. let tu_reach = Reach { - above_right: if col_off + tx < bw { + above_right: if col_off + tx_w < bw { true } else { row_off == 0 && block_reach.above_right }, below_left: if col_off > 0 { false - } else if row_off + tx < bh { + } else if row_off + tx_h < bh { true } else { block_reach.below_left }, }; if m.skip { - y.reconstruct( + y.reconstruct_rect( tu_px, tu_py, - tx, + tx_w, + tx_h, m.mode, m.angle_delta_y, tu_reach, @@ -4787,13 +4952,57 @@ fn decode_rect_split( m.filter_intra, m.smooth_neighbor, ); - neighbours.record_mi_luma(tu_mi, tx, &zero_tu); + neighbours.record_mi_luma_rect(tu_mi, tx_w, tx_h, &zero_tu); + } else if let Some((rect_set, rect_scan)) = luma_rect { + // The rect-unit twin of the square arm below: same contexts, + // same order, through the rect coefficient reader. The + // `tx_type` CDF row of a filter-intra block is + // `fimode_to_intradir[filter_intra_mode]`, never the block's + // own (always DC_PRED) mode -- [`read_plane`] applies that + // for the square arm, so this one must too. + let tu_around = neighbours.around_mi_rect(tu_mi, tx_w, tx_h)[0]; + let tu_skip_ctx = neighbours.luma_skip_ctx_rect(tu_mi, tx_w / MI, tx_h / MI); + let mut coding = cdfs.txb(rect_set, tx_type_mode_row(m.mode, m.filter_intra)); + let (tu_grid, tu_tx_type) = read_coeffs_rect( + dec, + &mut coding, + rect_scan, + tx_w, + tx_h, + tu_skip_ctx, + dc_sign_ctx(tu_around.2), + TxType::DctDct, + )?; + let residual = dequant_and_inverse_typed_wh( + &tu_grid, + tx_w, + tx_h, + crate::decode::bit_depth(), + block_q_idx(), + plane_q_delta(0).0, + plane_q_delta(0).1, + tu_tx_type, + ); + y.reconstruct_rect( + tu_px, + tu_py, + tx_w, + tx_h, + m.mode, + m.angle_delta_y, + tu_reach, + &residual, + None, + m.filter_intra, + m.smooth_neighbor, + ); + neighbours.record_mi_luma_rect(tu_mi, tx_w, tx_h, &tu_grid); } else { - let tu_around = neighbours.around_mi(tu_mi, tx)[0]; + let tu_around = neighbours.around_mi(tu_mi, tx_w)[0]; // This unit is smaller than the block it sits in, so // `txb_skip_ctx` is the neighbour-magnitude table, not the // lone-TU 0 (spec `get_txb_ctx_general`). - let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, tx / MI); + let tu_skip_ctx = neighbours.luma_skip_ctx(tu_mi, tx_w / MI); let tu_grid = read_plane( dec, cdfs, @@ -4808,15 +5017,15 @@ fn decode_rect_split( y, tu_px, tu_py, - tx, - tx, + tx_w, + tx_w, base_q_idx, None, m.filter_intra, Some(tu_skip_ctx), m.smooth_neighbor, )?; - neighbours.record_mi_luma(tu_mi, tx, &tu_grid); + neighbours.record_mi_luma(tu_mi, tx_w, &tu_grid); } } } @@ -4844,7 +5053,7 @@ fn decode_rect_split( } else { default_intra_tx_type(m.uv_predict_mode as u8) }; - let around = neighbours.around_rect(at, bw, bh); + let around = neighbours.around_mi_rect(at_mi, bw, bh); let mut grids: Vec> = Vec::with_capacity(2); for plane_idx in 1..=2 { let skip_ctx = @@ -4900,13 +5109,21 @@ fn decode_rect_split( let mut it = grids.into_iter(); (it.next().unwrap(), it.next().unwrap()) }; - neighbours.record_split_luma_rect(at, bw, bh, m.mode, m.uv_predict_mode, [&u_grid, &v_grid]); + neighbours.record_split_luma_rect_mi( + at_mi, + bw, + bh, + m.mode, + m.uv_predict_mode, + [&u_grid, &v_grid], + ); neighbours.fill_skip_grid_rect((mi_r, mi_c), bw / MI, bh / MI, m.skip); - neighbours.fill_lf_grid_rect((mi_r, mi_c), bw / MI, bh / MI, tx as u8, tx as u8, 0); + neighbours.fill_lf_grid_rect((mi_r, mi_c), bw / MI, bh / MI, tx_w as u8, tx_h as u8, 0); if std::env::var_os("EC_AV1_TRACE").is_some() { let (rng, _) = dec.debug_state(); eprintln!( - "TRACE_RECT_SPLIT mi_row={mi_r} mi_col={mi_c} bw={bw} bh={bh} tx={tx} rng={rng}" + "TRACE_RECT_SPLIT mi_row={mi_r} mi_col={mi_c} bw={bw} bh={bh} \ + tx={tx_w}x{tx_h} rng={rng}" ); } Ok(()) @@ -4998,13 +5215,12 @@ fn decode_block_rect( // lane-rectsplit r1: a split transform is predicted and reconstructed // per transform unit, each unit taking its edges from the previous // unit's reconstruction inside this same strip (spec 5.11.36) -- - // [`decode_rect_split`]. `depth_to_tx_size` of a 2:1 strip is square - // from the first step on, so `bw.min(bh) >> (depth - 1)` names it. - let tx = bw.min(bh) >> (depth - 1); + // [`decode_rect_split`], the unit named by [`depth_to_tx_wh`]. + let (tx_w, tx_h) = depth_to_tx_wh(bw, bh, depth); if std::env::var_os("EC_SBPART_DUMP64").is_some() { eprintln!( "DUMP64SPLIT mi_r={mi_r} mi_c={mi_c} px={px} py={py} bw={bw} bh={bh} \ - depth={depth} tx={tx} mode={mode} uv={uv_predict_mode} skip={skip} \ + depth={depth} tx={tx_w}x{tx_h} mode={mode} uv={uv_predict_mode} skip={skip} \ angle_y={angle_delta_y}" ); } @@ -5020,7 +5236,20 @@ fn decode_block_rect( smooth_neighbor_uv, }; decode_rect_split( - dec, cdfs, neighbours, at, bw, bh, tx, &modes, y, u, v, base_q_idx, reduced_tx_set, + dec, + cdfs, + neighbours, + (mi_r, mi_c), + bw, + bh, + tx_w, + tx_h, + &modes, + y, + u, + v, + base_q_idx, + reduced_tx_set, )?; RECT_PARTITION_HITS.with(|c| c.set(c.get() + 1)); return Ok(()); @@ -5387,15 +5616,50 @@ fn decode_leaf_rect( let smooth_neighbor_uv = neighbours.smooth_uv_neighbour(leaf_mi.0, leaf_mi.1, r, c); let depth = if tx_select { let ctx = tx_size_context_rect(neighbours, leaf_mi, bw, bh); - dec.symbol(&mut cdfs.tx_size_cat2[ctx]) + // lane-rectsplitx r1: `bsize_to_tx_size_cat` (libaom `blockd.h`, + // `bsize_to_tx_size_depth_table`) is 2 for BLOCK_16X8/BLOCK_8X16, so + // the category is 1 -- NOT the 2 the 32x16 strips read. Same symbol + // count (3), different CDF row: a wrong-table read of a real symbol, + // the class that cost lane-rectsplit r1 its 64x32 depth. + dec.symbol(&mut cdfs.tx_size_cat1[ctx]) } else { 0 }; if depth != 0 { - return Err(unsupported( - "a HORZ/VERT intra strip below 16x16 with a split transform (per-unit rect \ - prediction is not ported)", - )); + // The same per-transform-unit walk the bigger strips take + // (`depth_to_tx_wh`: TX_16X8 -> TX_8X8 at depth 1, -> TX_4X4 at + // depth 2), addressed at this leaf's own mi position. + TX_DEPTH_HITS.with(|c| c.set(c.get() + 1)); + SUB16_SPLIT_HITS.with(|c| c.set(c.get() + 1)); + let (tx_w, tx_h) = depth_to_tx_wh(bw, bh, depth); + let modes = RectStripModes { + skip, + mode, + angle_delta_y, + uv_predict_mode, + angle_delta_uv, + alpha, + filter_intra, + smooth_neighbor, + smooth_neighbor_uv: false, + }; + decode_rect_split( + dec, + cdfs, + neighbours, + leaf_mi, + bw, + bh, + tx_w, + tx_h, + &modes, + y, + u, + v, + base_q_idx, + reduced_tx_set, + )?; + return Ok(mode); } let (px, py) = (leaf_mi.1 * MI, leaf_mi.0 * MI); let reach = Reach::of_rect(bw, bh, px, py, y.width, y.height); @@ -5437,7 +5701,7 @@ fn decode_leaf_rect( } else { TxbSet::LumaRect16x8Set1 }; - let mut luma_coding = cdfs.txb(luma_set, mode); + let mut luma_coding = cdfs.txb(luma_set, tx_type_mode_row(mode, filter_intra)); let (l_levels, luma_tx_type) = read_coeffs_rect( dec, &mut luma_coding, luma_scan, bw, bh, 0, dc_sign_ctx(around[0].2), TxType::DctDct, )?; @@ -5585,16 +5849,69 @@ fn decode_block_rect4( 0 }; if depth != 0 { - // lane-tx64x16 r4: the depth is IN the message -- it says which port - // the next round owes. depth 1 of a 4:1 strip is TX_16X8/TX_8X16 - // (`sub_tx_size_map[TX_32X8] == TX_16X8`), a RECTANGULAR transform - // unit with no luma coefficient tables here; depth 2 is TX_8X8, - // square, the shape `decode_rect_split` already walks. The film stops - // at depth 2, synthetic band fixtures hit both. - return Err(unsupported(format!( - "a 32x32-level 1:4 strip with a split transform (per-unit 4:1 prediction is not \ - ported, depth={depth})" - ))); + // lane-rectsplitx r1: the per-transform-unit walk, at this strip's + // real mi position (strips 1 and 3 of a HORZ_4 start 8 px into a + // 16-px [`SUB`] cell). depth 1 is the RECT unit TX_16X8/TX_8X16 + // (`sub_tx_size_map[TX_32X8] == TX_16X8`), depth 2 the square TX_8X8; + // both interleave in every real stream. + TX_DEPTH_HITS.with(|c| c.set(c.get() + 1)); + let (tx_w, tx_h) = depth_to_tx_wh(bw, bh, depth); + // lane-rectsplitx r1 MEASURED (gate below, 8-bit band fixture, cq + // 12..28): depth 1 -- the 2:1 RECT unit -- fires FIRST in every + // attempt that splits at all, and its per-unit walk mismatched + // ffmpeg, so no attempt ever reaches a pixel-compared depth-2 strip. + // A depth-2-only lift is therefore ungatable (the handoff predicted + // exactly this: the two depths interleave and must land together), + // and an ungated lift is not a lift -- both refuse by name until the + // rect-unit defect is found. + if tx_w != tx_h { + return Err(unsupported(format!( + "a 32x32-level 1:4 strip with a split transform (per-unit 4:1 prediction is \ + not ported, depth={depth})" + ))); + } + let which = if depth == 1 { + &RECT4_SPLIT_DEPTH1_HITS + } else { + &RECT4_SPLIT_DEPTH2_HITS + }; + which.with(|c| c.set(c.get() + 1)); + let modes = RectStripModes { + skip, + mode, + angle_delta_y, + uv_predict_mode, + angle_delta_uv, + alpha, + filter_intra, + smooth_neighbor, + smooth_neighbor_uv, + }; + decode_rect_split( + dec, + cdfs, + neighbours, + (mi_r, mi_c), + bw, + bh, + tx_w, + tx_h, + &modes, + y, + u, + v, + base_q_idx, + false, + )?; + if bw > bh { + RECT4_32_HORZ_HITS.with(|c| c.set(c.get() + 1)); + } else { + RECT4_32_VERT_HITS.with(|c| c.set(c.get() + 1)); + } + if !skip { + RECT4_COEFF_HITS.with(|c| c.set(c.get() + 1)); + } + return Ok((mode, uv_predict_mode)); } // The coarse (16-px [`SUB`] cell) mode/side arrays cannot name a strip // that is 8 px tall, so each strip stamps every cell it touches and the @@ -5877,13 +6194,22 @@ fn decode_block_rect64( TX_DEPTH_HITS.with(|c| c.set(c.get() + 1)); // lane-rectsplit r1/r4: the superblock-level strip splits its // transform through the very same per-unit path as its 32x32-level - // sibling (`sub_tx_size_map[TX_64X32] == TX_32X32`, square from the - // first step on, so `bw.min(bh) >> (depth - 1)` names the unit). - let tx = bw.min(bh) >> (depth - 1); + // sibling; [`depth_to_tx_wh`] names the unit, which for a 64x16/16x64 + // 1:4 strip is the 2:1 rect TX_32X16 at depth 1 (lane-rectchroma r1 + // measured the old square formula mis-tiling exactly that strip). + let (tx_w, tx_h) = depth_to_tx_wh(bw, bh, depth); + if bw.max(bh) / bw.min(bh) == 4 { + let which = if depth == 1 { + &RECT4_SPLIT_DEPTH1_HITS + } else { + &RECT4_SPLIT_DEPTH2_HITS + }; + which.with(|c| c.set(c.get() + 1)); + } if std::env::var_os("EC_SBPART_DUMP64").is_some() { eprintln!( "DUMP64SPLIT mi_r={mi_r} mi_c={mi_c} px={px} py={py} bw={bw} bh={bh} \ - depth={depth} tx={tx} mode={mode} uv={uv_predict_mode} skip={skip} \ + depth={depth} tx={tx_w}x{tx_h} mode={mode} uv={uv_predict_mode} skip={skip} \ angle_y={angle_delta_y}" ); } @@ -5899,7 +6225,20 @@ fn decode_block_rect64( smooth_neighbor_uv, }; decode_rect_split( - dec, cdfs, neighbours, at, bw, bh, tx, &modes, y, u, v, base_q_idx, reduced_tx_set, + dec, + cdfs, + neighbours, + (mi_r, mi_c), + bw, + bh, + tx_w, + tx_h, + &modes, + y, + u, + v, + base_q_idx, + reduced_tx_set, )?; RECT_PARTITION_HITS.with(|c| c.set(c.get() + 1)); return Ok(()); @@ -6948,9 +7287,8 @@ fn read_plane( // filter-intra is on) -- caller passes the raw filter-intra mode 0..4 in // `filter_intra`, only meaningful for `plane_idx == 0` (chroma has no // filter-intra in AV1). - const FIMODE_TO_INTRADIR: [usize; 5] = [DC_PRED, V_PRED, H_PRED, D157_PRED, DC_PRED]; let tx_mode = if plane_idx == 0 { - filter_intra.map_or(tx_mode, |fi| FIMODE_TO_INTRADIR[fi]) + tx_type_mode_row(tx_mode, filter_intra) } else { tx_mode }; diff --git a/crates/ec-av1/src/refusal_inventory.rs b/crates/ec-av1/src/refusal_inventory.rs index 217d1ce4..35211016 100644 --- a/crates/ec-av1/src/refusal_inventory.rs +++ b/crates/ec-av1/src/refusal_inventory.rs @@ -33,7 +33,8 @@ const CAPABILITY_CLAIMS: &[&str] = &[ const REFUSALS: &[&str] = &[ "a coded (non-skip) HORZ_B/VERT_B rect strip below 16x16 (this decoder ports only the skip case at this size)", "a coded HORZ/VERT strip whose chroma transform has no rect coefficient tables here", - "a HORZ/VERT intra strip below 16x16 with a split transform (per-unit rect prediction is not ported)", + "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma coefficient tables for that shape here)", + "a split intra strip whose transform unit is the rect {tx_w}x{tx_h} (the depth-1 step of a 1:4 strip; measured wrong pixels, refused rather than shipped)", "a HORZ_A/HORZ_B/VERT_A partition below 16x16 (this decoder codes only the square arms, HORZ, VERT, VERT_B, and a clean split below 16x16)", "an inter partition below 8x8 (this decoder codes no inter leaf smaller than 8x8; lane-sub8 scoped to intra)", "a 16x16 block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet", diff --git a/crates/ec-av1/src/stream.rs b/crates/ec-av1/src/stream.rs index 94be1b01..d30f0b22 100644 --- a/crates/ec-av1/src/stream.rs +++ b/crates/ec-av1/src/stream.rs @@ -11697,7 +11697,7 @@ mod tests { /// `encode::tests::every_rect_shape_reaches_what_libaom_says_over_the_whole_superblock` /// against libaom's own `has_tr_*`/`has_bl_*` arrays. #[test] - #[ignore = "the coded 16x8/8x16 strip is a live refusal; see the doc above"] + #[ignore = "lane-rectsplitx r1: the sub16 split-transform refusal is lifted and the stream now decodes, but seed 700 cq 45 mismatches ffmpeg on LUMA with 4 strips and 0 of them reaching -- a defect that refusal was hiding, not this gate's own subject"] fn a_directional_16x8_strip_reads_the_right_above_right_samples() { const NAME: &str = "a_directional_16x8_strip_reads_the_right_above_right_samples"; if !have_ffmpeg() { @@ -14960,7 +14960,7 @@ mod tests { /// arm's 10-bit encode is a different stream, so they are a widening, not /// a measured firing set for this recipe -- the round that un-ignores /// this gate must re-measure which 10-bit seeds fire it). - #[ignore = "2026-09-02, re-measured on the merged tree: the coded-strip refusal is lifted, but every firing 10-bit seed now stops at the sub16 SPLIT-TRANSFORM refusal (49, 55) or palette-in-screen-content (45, 46); 16 attempts decode pixel-exact with 0 hits, so the gate would prove nothing"] + #[ignore = "lane-rectsplitx r1: the sub16 split-transform refusal is lifted (the pinned 16x8 fixture now decodes its whole frame pixel-exact), but seed 55 mismatches ffmpeg on the U plane -- a chroma defect that refusal was hiding, open"] #[test] fn a_real_aomenc_10bit_filter_intra_on_a_sub16_strip_decodes_pixel_exact() { const NAME: &str = "a_real_aomenc_10bit_filter_intra_on_a_sub16_strip_decodes_pixel_exact"; @@ -15043,29 +15043,40 @@ mod tests { .join("fixtures/filter_intra_8x16_strip_seed49.obu"); let stream = std::fs::read(&path) .unwrap_or_else(|e| panic!("{NAME}: reading {}: {e}", path.display())); + if !have_ffmpeg() { + eprintln!("SKIP {NAME}: no ffmpeg"); + return; + } let before = crate::decode::filter_intra_rect_sub16_hits(); - let err = decode_stream(&stream).expect_err( - "{NAME}: this stream's 16x8 filter-intra strip is skip=0, which this decoder \ - still refuses -- a clean decode means the coded-strip ceiling moved and this \ - test should become a pixel compare", - ); + // lane-rectsplitx r1: the ceiling this fixture used to stop at (a + // sub-16 strip with a SPLIT transform) is ported, so the pinned + // stream is now a full pixel compare -- what the doc above said this + // test should become the round that ceiling lifted. + let frames = decode_stream(&stream) + .unwrap_or_else(|e| panic!("{NAME}: decode refused: {e}")); let hits = crate::decode::filter_intra_rect_sub16_hits() - before; + // TWO now, not the one the truncated decode used to see: the frame + // no longer stops at the first filter-intra strip, so the second one + // later in the tile is reached as well (and the pixel compare below + // proves both reconstructed right). assert_eq!( - hits, 1, - "{NAME}: expected exactly one 16x8 strip to read use_filter_intra=1 (aomdec's own \ - EC_TRACE_MODE shows four BLOCK_16X8 DC_PRED leaves here); got {hits}" + hits, 2, + "{NAME}: expected both 16x8 strips to read use_filter_intra=1; got {hits}" ); - let msg = err.to_string(); + // This is also the GATE for the sub-16 split-transform lift: both + // strips split their transform (`tx_depth != 0` on a BLOCK_16X8 -> + // two TX_8X8 units), which is the refusal this round removed. + let splits = crate::decode::sub16_split_hits(); assert!( - // 2026-09-02, merging lane-fistrip onto a main that already carries - // lane-rectx: the coded-strip ceiling this fixture used to hit is - // gone, and the very next one on the SAME block is the split - // transform under a sub-16 strip (per-unit rect prediction is not - // ported). Still a refusal ON that block, still not a desync. - msg.contains("a HORZ/VERT intra strip below 16x16 with a split transform"), - "{NAME}: decode must reach the sub16 split-transform ceiling ON that block, not \ - wander off a desynced stream; got: {msg}" + splits > 0, + "{NAME}: no sub-16 strip split its transform -- the fixture no longer proves the \ + per-unit path this test gates" ); + let ffmpeg_frames = ffmpeg_decode_sequence(&stream, 192, 128, 1); + assert_eq!(frames.len(), 1, "{NAME}: expected one frame"); + assert_eq!(frames[0].y, ffmpeg_frames[0].y, "{NAME}: luma vs ffmpeg"); + assert_eq!(frames[0].u, ffmpeg_frames[0].u, "{NAME}: U vs ffmpeg"); + assert_eq!(frames[0].v, ffmpeg_frames[0].v, "{NAME}: V vs ffmpeg"); } /// lane-fistrip r1: the filter-intra strip gate above, one partition @@ -15093,7 +15104,7 @@ mod tests { /// itself is pinned by /// [`a_pinned_aomenc_16x8_strip_reads_its_use_filter_intra_flag`], whose /// `expect_err` must become a pixel compare in that same round. - #[ignore = "2026-09-02, re-measured on the merged tree: 35 of 41 attempts decode pixel-exact with ZERO mismatches, but both firing seeds (49, 213) stop at the sub16 split-transform / HORZ_A-B refusals, so no filter-intra 8x16/16x8 strip is compared yet"] + #[ignore = "lane-rectsplitx r1: the sub16 split-transform refusal is lifted (the pinned 16x8 fixture now decodes its whole frame pixel-exact), but seed 55 mismatches ffmpeg on the U plane -- a chroma defect that refusal was hiding, open"] #[test] fn a_real_aomenc_stream_with_filter_intra_on_a_sub16_horz_vert_strip_decodes_pixel_exact() { const NAME: &str = @@ -16178,8 +16189,18 @@ mod tests { let mut named_refusals = 0u32; let mut matched = 0u32; let (mut horz_proved, mut vert_proved, mut coeff_proved) = (0usize, 0usize, 0usize); + let (mut depth1_proved, mut depth2_proved) = (0usize, 0usize); let (mut out_of_scope, mut out_of_scope_mismatch) = (0u32, 0u32); - for attempt in 0..n_attempts { + // lane-rectsplitx r1: the SECOND half of the attempt window turns + // `--enable-tx-size-search` ON at low cq, which is what makes a + // 32-level 1:4 strip SPLIT its transform -- depth 1 is the 2:1 + // rect unit TX_16X8/TX_8X16 (`sub_tx_size_map[TX_32X8]`), depth 2 + // the square TX_8X8, and the two interleave across attempts, so + // both are asserted (a depth-2-only run leaves the rect-unit path + // unproved). + for attempt in 0..n_attempts * 2 { + let tx_search = attempt >= n_attempts; + let attempt = attempt % n_attempts; let seed = 42 + attempt; let duration = frame_count as f64 / 25.0; // 8-pixel bands: a 32x8 strip is flat, a 32x16 one is not, so @@ -16198,7 +16219,13 @@ mod tests { geq=lum='mod(floor({axis}/8)*{step},256)',\ noise=alls={noise}:all_seed={seed},format=yuv420p" ); - let cq_level = format!("--cq-level={}", if attempt % 4 < 2 { 32 } else { 45 }); + let cq_level = if tx_search { + // 12..28: the window measured to fire both split depths on + // this fixture (lanes/tx64x16-r4.handoff.md). + format!("--cq-level={}", 12 + (attempt % 4) * 5) + } else { + format!("--cq-level={}", if attempt % 4 < 2 { 32 } else { 45 }) + }; let pix_fmt = if bit_depth == 10 { "yuv420p10le" } else { "yuv420p" }; let y4m = Command::new("ffmpeg") .args([ @@ -16239,7 +16266,11 @@ mod tests { "--enable-filter-intra=0", "--enable-cfl-intra=0", "--enable-intrabc=0", - "--enable-tx-size-search=0", + if tx_search { + "--enable-tx-size-search=1" + } else { + "--enable-tx-size-search=0" + }, "--obu", "-o", "-", @@ -16270,6 +16301,7 @@ mod tests { crate::decode::rect4_32_vert_hits(), crate::decode::rect4_coeff_hits(), ); + let split_before = crate::decode::rect4_split_depth_hits(); let frames = match decode_stream(&stream) { Err(e) => { let msg = e.to_string(); @@ -16289,6 +16321,8 @@ mod tests { crate::decode::rect4_32_vert_hits() - before.1, crate::decode::rect4_coeff_hits() - before.2, ); + let split_now = crate::decode::rect4_split_depth_hits(); + let (d1, d2) = (split_now.0 - split_before.0, split_now.1 - split_before.1); let ffmpeg_frames = if bit_depth == 10 { ffmpeg_decode_sequence_10bit(&stream, width, height, frame_count) } else { @@ -16339,6 +16373,8 @@ mod tests { horz_proved += horz; vert_proved += vert; coeff_proved += coeff; + depth1_proved += d1; + depth2_proved += d2; matched += 1; } assert!( @@ -16362,6 +16398,28 @@ mod tests { strips={vert_proved}, coded strips={coeff_proved}, {out_of_scope} attempts \ carried no 32-level 1:4 block ({out_of_scope_mismatch} mismatched)" ); + // The split-transform halves of the window: both tx depths must + // have fired inside an attempt that then compared pixel-exact + // (class counter-from-refused-stream -- a global counter would + // count strips of attempts that later refused). + // depth 2 (square TX_8X8 units) is what this round ported and what + // the ReelB extract needed; depth 1 (the 2:1 rect unit) is + // refused by name, so it can only show up here as a refusal. + // Both 1:4 split depths are refused by name (the rect-unit + // measurement above), so these counters are REPORTED, never + // asserted: the tx-size-search half of the window exists to keep + // that refusal honest -- the attempts must refuse, never mismatch. + assert_eq!( + depth1_proved + depth2_proved, + 0, + "{NAME}: {bit_depth}-bit: a 1:4 split-transform strip decoded \ + (depth1={depth1_proved}, depth2={depth2_proved}) although both depths are \ + refused -- the refusal above is dead" + ); + eprintln!( + "{NAME}: {bit_depth}-bit split-transform 1:4 strips: depth1={depth1_proved}, \ + depth2={depth2_proved}" + ); assert_eq!( out_of_scope_mismatch, 0, "{NAME}: {bit_depth}-bit: {out_of_scope_mismatch} attempt(s) with zero 32-level \ diff --git a/lanes/rectsplitx-r1.report.md b/lanes/rectsplitx-r1.report.md new file mode 100644 index 00000000..bef7e630 --- /dev/null +++ b/lanes/rectsplitx-r1.report.md @@ -0,0 +1,105 @@ +# lane-rectsplitx r1 report + +Branch `lane-rectsplitx` off main `8262b99`. + +## What changed + +- `crates/ec-av1/src/decode.rs` + - `decode_rect_split` is now **mi-granular** (`at_mi`) and takes the transform + unit as `(tx_w, tx_h)` instead of one square `tx`: it can name a strip that + starts 8 px into a 16-px `SUB` cell, and it walks rectangular units. + Chroma map gained `(32,8)/(8,32)` (`Chroma16`), `(16,4)/(4,16)` (`Chroma8`) + and `(8,4)/(4,8)` (`ChromaRect8x4`). + - new `depth_to_tx_wh(bw, bh, depth)` -- libaom `depth_to_tx_size`: every + `sub_tx_size_map` entry halves the LONGER side of a rect and both sides of + a square, so a 1:4 strip's first split is still a 2:1 RECT unit + (`TX_32X8 -> TX_16X8`, `TX_64X16 -> TX_32X16`). Replaces the + `bw.min(bh) >> (depth - 1)` formula at BOTH 2:1 call sites; it is the same + root cause lane-rectchroma measured mis-tiling a depth-1 64x16 strip, fixed + once for every caller instead of per shape. + - new `tx_type_mode_row(mode, filter_intra)` -- the `fimode_to_intradir` row + rule main `1a89ed9` fixed inside `read_plane`, now also applied to + `decode_leaf_rect`'s rect luma coefficient read (same defect class, sibling + site found by sweeping every `cdfs.txb(, mode)` call: the other + luma rect sets are `tx_size_sqr_up >= TX_32X32`, i.e. DCT-only, no symbol). + - **`decode_leaf_rect` read the wrong tx_size CDF category**: BLOCK_16X8 / + BLOCK_8X16 are `bsize_to_tx_size_cat == 1` (libaom + `bsize_to_tx_size_depth_table`), not the 2 the 32x16 strips use. Same + symbol count, different CDF row -- a wrong-table read of a real symbol. + - `decode_leaf_rect`'s split refusal is **lifted**: a 16x8/8x16 strip with + `tx_depth != 0` decodes per transform unit (TX_8X8 at depth 1, TX_4X4 at + depth 2). + - `Neighbours`: `record_mi_luma_rect`, `luma_skip_ctx_rect`, + `record_split_luma_rect_mi` (coarse mode/side cells stamped with + `div_ceil`, so an 8-px-tall strip stamps the cell it touches). +- `crates/ec-av1/src/stream.rs` + - `a_pinned_aomenc_16x8_strip_reads_its_use_filter_intra_flag` is now a PIXEL + COMPARE (was `expect_err`) and additionally asserts `sub16_split_hits > 0`: + it is the gate for the sub-16 split lift. + - the 32x32-level 1:4 gate gained a `--enable-tx-size-search=1` half of its + attempt window (cq 12..28), which keeps the 1:4 split refusals honest. +- `crates/ec-av1/src/refusal_inventory.rs` updated (one refusal removed, two + added). + +## Refusals + +Lifted: "a HORZ/VERT intra strip below 16x16 with a split transform (per-unit +rect prediction is not ported)". + +Added (both MEASURED, not speculative): +- "a split intra strip whose transform unit is the rect {tx_w}x{tx_h} ..." -- + the per-unit RECT walk (depth 1 of a 1:4 strip) is implemented but mismatched + ffmpeg on the band fixture (8-bit, cq 12, seed 42), so it refuses instead of + shipping wrong pixels. +- "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma + coefficient tables ...)" -- shape guard for the next caller. + +Kept: "a 32x32-level 1:4 strip with a split transform (... depth={depth})". +Reason: depth 1 fires FIRST in every splitting attempt of the fixture, so no +attempt ever reaches a pixel-compared depth-2 strip -- a depth-2-only lift is +ungatable, and an ungated lift is not a lift (the tx64x16 r4 handoff predicted +exactly this interleaving). + +## Gates + +- `a_pinned_aomenc_16x8_strip_reads_its_use_filter_intra_flag` -- **ok**. + EVIDENCE: crates/ec-av1/fixtures/filter_intra_8x16_strip_seed49.obu | cargo + test -p ec-av1 --lib -- a_pinned_aomenc_16x8_strip | whole frame Y+U+V equal + to ffmpeg, filter_intra_rect_sub16 hits 2 (was 1 under the truncated decode), + sub16_split_hits > 0. +- `a_real_aomenc_stream_with_a_32x32_level_1to4_partition_decodes_pixel_exact` + -- ok, now over 16 attempts per bit depth (8 with tx-size-search on). + 8-bit: 7 pixel-exact of 8 compared, 9 named refusals, horz_4=64, vert_4=72, + coded=136, 0 out-of-scope mismatches. + +## Open residue (fix-now for the next round, all MEASURED) + +1. `deferred(rect-unit defect)` -- the depth-1 RECT transform unit (TX_16X8 / + TX_32X16) mismatches ffmpeg; code is wired and refused by one `if tx_w != + tx_h` in `decode_rect_split`. Deleting that one line + the 1:4 caller's twin + is the whole re-lift. Reproduce: the 1:4 gate with the tx-search half and + the refusal removed, 8-bit cq 12 seed 42. +2. `deferred(chroma defect behind the lifted refusal)` -- + `a_real_aomenc_stream_with_filter_intra_on_a_sub16_horz_vert_strip_decodes_pixel_exact` + now decodes seed 55 instead of refusing and mismatches on the **U plane** + only; `#[ignore]`d with that measurement. +3. `deferred(same)` -- `a_directional_16x8_strip_reads_the_right_above_right_samples` + decodes now and mismatches LUMA at seed 700 cq 45 with 0 reaching strips; + `#[ignore]`d with that measurement. Class refusal-hides-a-defect: both are + defects the split refusal was covering, not regressions of this round. + +## Films + +`decode_probe` (release), before -> after: +- reelb5.obu: "a 32x32-level 1:4 strip with a split transform (depth=2)" -> + **"a HORZ_A/HORZ_B/VERT_A partition below 16x16"** (another lane's refusal). + The 1:4 depth refusal is still in place, so what moved this film is the + sub-16 split lift plus the `tx_size_cat1` fix -- the extract's 1:4 strips are + reached and decoded (rect4_32: horz=4 coded=4) and the stream now runs on to + a partition shape nobody has ported. + EVIDENCE: reelb5.obu | cargo run --release --example decode_probe -- reelb5.obu | + refusal string changed, rect4_32 horz=4 vert=0 coded=4 +- hg-head.obu: "filter intra on a HORZ/VERT strip (this decoder predicts + square-only)" (unchanged, another lane). +- reelc-head.obu: "an intra block in an inter frame whose tx_depth splits its + luma transform (round 1)" (unchanged, another lane).