diff --git a/crates/ec-av1/src/cdf_state.rs b/crates/ec-av1/src/cdf_state.rs index 330dcad8..33c194d5 100644 --- a/crates/ec-av1/src/cdf_state.rs +++ b/crates/ec-av1/src/cdf_state.rs @@ -420,6 +420,12 @@ pub(crate) struct Cdfs { /// The two motion vector components' own tables: separate owned state, /// since spec 8.3.2 adapts one component without touching the other. pub mv_comp: [MvComponentCdfs; 2], + /// libaom's `ndvc` (`av1_init_mv_probs`): the block-vector MV context an + /// intrabc block reads (spec's `MV_INTRABC_CONTEXT`). Same spec-8.4 + /// defaults as [`Self::mv_joint`]/[`Self::mv_comp`], separate adaptation. + pub dv_joint: [u16; 5], + /// [`Self::dv_joint`]'s per-component half. + pub dv_comp: [MvComponentCdfs; 2], /// The `use_filter_intra` flag, indexed by block-size class (`[0]`=4x4, /// `[1]`=8x8, `[2]`=16x16, `[3]`=32x32, `[4]`=32x16, `[5]`=16x32) -- /// see [`cdf::FILTER_INTRA`]. @@ -682,6 +688,10 @@ impl Cdfs { reset2(&mut self.ref_mv); reset2(&mut self.drl_mode); reset1(&mut self.mv_joint); + reset1(&mut self.dv_joint); + self.dv_comp + .iter_mut() + .for_each(MvComponentCdfs::reset_counts); self.mv_comp .iter_mut() .for_each(MvComponentCdfs::reset_counts); @@ -1155,6 +1165,8 @@ impl Cdfs { drl_mode: cdf::DRL_MODE, mv_joint: cdf::MV_JOINT, mv_comp: [MvComponentCdfs::new(), MvComponentCdfs::new()], + dv_joint: cdf::MV_JOINT, + dv_comp: [MvComponentCdfs::new(), MvComponentCdfs::new()], filter_intra: cdf::FILTER_INTRA, filter_intra_mode: cdf::FILTER_INTRA_MODE, tx_size_cat0: cdf::TX_SIZE_CAT0, diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index be8f124f..02719966 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -587,6 +587,69 @@ thread_local! { const { std::cell::RefCell::new(None) }; } +thread_local! { + /// The current frame's `mi` grid, kept only while a frame header set + /// `allow_intrabc` -- an intrabc block's DV predictor is the ordinary + /// MV stack ([`crate::mvstack::find_mv_stack`]) built against + /// `INTRA_FRAME`, which needs the neighbour state a key frame otherwise + /// never keeps. `(grid, mi_cols, mi_rows)`; `None` on every frame that + /// does not allow intrabc (so nothing is paid for it). + /// + /// corner-cut: only [`decode_block`] (the square path) records into it, + /// so a frame mixing intrabc with rect/sub-8x8 leaves would predict off + /// an incomplete grid. Ceiling: the DV *value* (never the parse) would + /// be wrong there; upgrade = record from the rect/leaf paths too. + static INTRABC_MI_GRID: std::cell::RefCell> = + const { std::cell::RefCell::new(None) }; + /// The block vector [`read_intra_mode`] just decoded, handed to + /// [`decode_block`] off the call stack (same idiom as [`PALETTE_PRED`], + /// which the alternative -- a tenth tuple member through every caller -- + /// already avoids). Always `.take()`n by the block that reads it. + static INTRABC_DV: std::cell::Cell> = const { std::cell::Cell::new(None) }; + /// How many blocks decoded `use_intrabc == 1` -- the gate's hit counter. + static INTRABC_HITS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Current value of [`INTRABC_HITS`]. +pub(crate) fn intrabc_hits() -> usize { + INTRABC_HITS.with(|c| c.get()) +} + +/// Zeroes [`INTRABC_HITS`] (gate tests call this before a decode). +pub(crate) fn reset_intrabc_hits() { + INTRABC_HITS.with(|c| c.set(0)); +} + +/// Records one coded block into [`INTRABC_MI_GRID`]: every block contributes +/// its size (libaom's `scan_row_mbmi` advances `processed_rows` off any +/// candidate's `bsize`, ref-match or not), an intrabc one also its DV as an +/// `INTRA_FRAME` candidate (libaom treats intrabc as `is_inter_block`). +fn record_intrabc_mi(mi_r: usize, mi_c: usize, n4: usize, dv: Option<(i32, i32)>) { + INTRABC_MI_GRID.with(|g| { + let mut g = g.borrow_mut(); + let Some((grid, _, _)) = g.as_mut() else { + return; + }; + let info = crate::mvstack::MiInfo { + is_inter: dv.is_some(), + ref_frame: 0, + ref_frame1: None, + mv: dv.unwrap_or((0, 0)), + mv1: None, + is_new_mv: dv.is_some(), + is_global_mv0: false, + is_global_mv1: false, + size: n4, + size_h: n4, + }; + for r in mi_r..mi_r + n4 { + for c in mi_c..mi_c + n4 { + grid.set(r, c, info); + } + } + }); +} + // How many blocks decoded `skip_mode == 1` (lane-av1comp round 14) -- // proves a real `skip_mode_present` stream actually reached a block that // picked it, not just that the frame header bit was set. @@ -4049,9 +4112,18 @@ fn read_intra_mode( eprintln!("TRACE use_intrabc value={}", use_intrabc as i32); } if use_intrabc { - return Err(unsupported( - "a block that actually uses intrabc (this decoder never reconstructs one)", - )); + let dv = read_intrabc_dv(dec, cdfs, mi_r, mi_c, side); + if trace { + eprintln!("TRACE intrabc dv={dv:?}"); + } + INTRABC_DV.with(|c| c.set(Some(dv))); + INTRABC_HITS.with(|c| c.set(c.get() + 1)); + // spec 5.11.13 / libaom `read_intra_frame_mode_info` returns the + // moment `is_intrabc_block`: no y/uv mode, angle delta, palette, + // CFL or filter-intra syntax follows. `YMode`/`UVMode` are forced + // `DC_PRED` (which is also what the neighbour mode contexts and + // the loop filter then see). + return Ok((skip, DC_PRED, 0, DC_PRED, 0, None, None, None, None)); } } let above_ctx = INTRA_MODE_CTX[above_mode]; @@ -4768,6 +4840,16 @@ fn decode_block( r * (SUB / MI), c * (SUB / MI), )?; + let intrabc_dv = INTRABC_DV.with(|c| c.take()); + // libaom `parse_decode_block`: an intrabc block is `inter_block_tx`, so + // under `TX_MODE_SELECT` its transform size comes from the inter var-tx + // partition tree (`read_var_tx_size`), a syntax element this decoder has + // nowhere -- reading the intra `tx_depth` symbol instead would desync. + if intrabc_dv.is_some() && tx_select && !skip { + return Err(unsupported( + "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)", + )); + } // `predict` panics outside `DC_PRED..=PAETH_PRED` (0..=12); `UV_CFL_PRED` // (13) predicts as `DC_PRED` with the [`cfl_scaled`] nudge carrying the // actual chroma-from-luma correlation, same as this decoder always did. @@ -4807,10 +4889,45 @@ fn decode_block( } else { luma_set }; + let luma_set = if intrabc_dv.is_some() { + txbset_for_inter(logical_tx, reduced_tx_set) + } else { + luma_set + }; let luma_scan = scan_for(coeff_tx_side, scan32, scan16, scan8, scan4); let reach = Reach::of(side, px, py, y.width, y.height); let (cpx, cpy) = (px / 2, py / 2); let chroma_side = side / 2; + // spec 7.11.3.4 with `use_intrabc`: the reference is the *current* + // frame's own pre-loop-filter reconstruction (all loop filters are off + // whenever `allow_intrabc`, frame.rs:194/210/252/272) at the full-pel + // block vector, with the BILINEAR kernel libaom forces for intrabc -- + // luma is a straight copy, chroma lands half-pel whenever the luma DV is + // odd, which is exactly what the bilinear taps then interpolate. + let intrabc_bufs = intrabc_dv.map(|(dv_row, dv_col)| { + let mut yb = vec![0u16; side * side]; + mc::predict_with_filter( + &y.data, y.width, y.true_width, y.true_height, + mv_to_q4(px, dv_col, true), mv_to_q4(py, dv_row, true), + side, side, mc::InterpFilterKind::Bilinear, &mut yb, + ); + let mut ub = vec![0u16; chroma_side * chroma_side]; + mc::predict_with_filter( + &u.data, u.width, u.true_width, u.true_height, + mv_to_q4(cpx, dv_col, false), mv_to_q4(cpy, dv_row, false), + chroma_side, chroma_side, mc::InterpFilterKind::Bilinear, &mut ub, + ); + let mut vb = vec![0u16; chroma_side * chroma_side]; + mc::predict_with_filter( + &v.data, v.width, v.true_width, v.true_height, + mv_to_q4(cpx, dv_col, false), mv_to_q4(cpy, dv_row, false), + chroma_side, chroma_side, mc::InterpFilterKind::Bilinear, &mut vb, + ); + (yb, ub, vb) + }); + if let Some((yb, _, _)) = &intrabc_bufs { + PALETTE_PRED.with(|c| *c.borrow_mut() = Some(yb.clone())); + } // A palette-Y block's own prediction is the reconstructed colour-index // map, not `predict()`'s edge-based one -- [`PALETTE_PRED`] carries it // to [`PlaneBuf::reconstruct`]'s next call rather than threading a @@ -4843,6 +4960,13 @@ fn decode_block( puv.map.iter().map(|&idx| puv.v_colors[idx as usize]).collect(), ) }); + // The chroma half of the intrabc prediction rides the same per-plane + // override slot the UV-palette buffers do (set fresh before each plane's + // own `reconstruct`/`read_plane` call below). + let palette_uv_bufs = match &intrabc_bufs { + Some((_, ub, vb)) => Some((ub.clone(), vb.clone())), + None => palette_uv_bufs, + }; if skip { // A skipped block codes no residual syntax at all (spec 5.11.34): // straight prediction, on every plane. @@ -5108,6 +5232,7 @@ fn decode_block( logical_tx as u8, 0, ); + record_intrabc_mi(mi_r, mi_c, side / MI, intrabc_dv); Ok(()) } @@ -5775,6 +5900,21 @@ fn scan_for<'a>( /// `tx_size_sqr == TX_16X16` branch ignores `use_reduced_set` once it is past /// the `TX_32X32`/reduced-set checks), so only the 8x8 and 4x4 cases have a /// second table ([`TxbSet::Luma8Set1`]/[`TxbSet::Luma4Set1`]). +/// [`txbset_for`], for a block libaom's `is_inter_block` calls inter -- which +/// an intrabc block is (`blockd.h:373`), so its `tx_type` comes off the +/// inter `ext_tx` sets, never the mode-indexed intra ones. +fn txbset_for_inter(tx_px: usize, reduced_tx_set: bool) -> TxbSet { + match tx_px { + 64 => TxbSet::Luma64, + 32 => TxbSet::Luma32Inter, + 16 if reduced_tx_set => TxbSet::Luma16Inter, + 16 => TxbSet::Luma16InterSet1, + 8 if reduced_tx_set => TxbSet::Luma8Inter, + 8 => TxbSet::Luma8InterSet1, + _ => TxbSet::Luma64, + } +} + fn txbset_for(tx_px: usize, reduced_tx_set: bool) -> TxbSet { match tx_px { 64 => TxbSet::Luma64, @@ -6573,6 +6713,16 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( } ENABLE_EDGE_FILTER.with(|f| f.set(enable_edge_filter)); let (sb_cols, sb_rows) = (mi_cols.div_ceil(SB_MI), mi_rows.div_ceil(SB_MI)); + INTRABC_MI_GRID.with(|g| { + *g.borrow_mut() = allow_intrabc.then(|| { + ( + crate::mvstack::MiGrid::new(mi_cols as usize, mi_rows as usize), + mi_cols as usize, + mi_rows as usize, + ) + }); + }); + INTRABC_DV.with(|c| c.set(None)); CDEF_BITS.with(|c| c.set(cdef.bits)); CDEF_SB_COLS.with(|c| c.set(sb_cols as usize)); CDEF_IDX_GRID.with(|g| *g.borrow_mut() = vec![0u8; sb_cols as usize * sb_rows as usize]); @@ -7677,6 +7827,58 @@ fn read_mv( (pred.0 + diff.0, pred.1 + diff.1) } +/// One intrabc block's block vector (spec 5.11.13 `read_intrabc_info` -> +/// `assign_mv` with `use_intrabc`, libaom `assign_dv`/`av1_find_ref_dv`). +/// +/// The predictor is the ordinary MV stack built against `INTRA_FRAME` +/// (`av1_find_mv_refs(..., INTRA_FRAME, ...)`): `nearestmv`, or `nearmv` +/// when that is zero, or -- when both are -- the fixed fallback DV one +/// superblock up, or `INTRABC_DELAY_PIXELS` (256) plus one superblock to the +/// left when this is the tile's first superblock row. The predictor is then +/// rounded to full pel, and the difference reads off the *dv* nmv context +/// (libaom `ndvc`) at full-pel precision (`MV_SUBPEL_NONE`: no `fr`/`hp` +/// symbols, exactly this decoder's `force_integer_mv` carve-out). No DRL +/// symbol is coded for a DV, so none of this can move the bitstream +/// position -- only the reconstructed vector. +fn read_intrabc_dv( + dec: &mut SymbolDecoder, + cdfs: &mut Cdfs, + mi_r: usize, + mi_c: usize, + side: usize, +) -> (i32, i32) { + const INTRABC_DELAY_PIXELS: i32 = 256; + let n4 = side / MI; + let stack_pred = INTRABC_MI_GRID.with(|g| { + let g = g.borrow(); + g.as_ref().map(|(grid, mi_cols, mi_rows)| { + let stack = crate::mvstack::find_mv_stack( + grid, mi_r, mi_c, n4, n4, 0, /* INTRA_FRAME */ + *mi_cols, *mi_rows, + ); + if stack.nearest_mv == (0, 0) { + stack.near_mv + } else { + stack.nearest_mv + } + }) + }); + let mut pred = stack_pred.unwrap_or((0, 0)); + if pred == (0, 0) { + // `av1_find_ref_dv` (mvref_common.c). Tile row start is 0 here (the + // single-tile-row case every intrabc gate stream is). + let sb_px = SB_MI as i32 * MI as i32; + pred = if mi_r < SB_MI as usize { + (0, -(sb_px + INTRABC_DELAY_PIXELS) * 8) + } else { + (-sb_px * 8, 0) + }; + } + // "Ref DV should not have sub-pel" (`assign_dv`): floor to full pel. + let pred = ((pred.0 >> 3) * 8, (pred.1 >> 3) * 8); + read_mv(dec, &mut cdfs.dv_comp, &mut cdfs.dv_joint, pred, false, true) +} + /// A 1/8-pel motion vector component converted to the 1/16-pel offset /// [`mc::predict`] takes, duplicating [`crate::encode`]'s private `mv_to_q4` /// (its own doc comment explains the `*2`/`*1` luma/chroma split). diff --git a/crates/ec-av1/src/gate_coverage.rs b/crates/ec-av1/src/gate_coverage.rs index 5b60712b..53165792 100644 --- a/crates/ec-av1/src/gate_coverage.rs +++ b/crates/ec-av1/src/gate_coverage.rs @@ -33,7 +33,13 @@ /// its tool is now covered by a real stream. #[cfg(test)] const NEVER_EXERCISED: &[(&str, &str)] = &[ - ("enable-intrabc", "intra block copy syntax is consumed but no block is reconstructed from it"), + // lane-intrabc r1: the DV itself (mv stack against INTRA_FRAME, `ndvc` + // full-pel read, `av1_find_ref_dv` fallback) and the block-copy + // prediction are now decoded, but every real aomenc intrabc block this + // lane could produce sits under TX_MODE_SELECT, whose inter var-tx + // partition tree is unread -- so no stream reconstructs one end to end + // yet and this entry stays. + ("enable-intrabc", "the block vector is decoded and predicted from, but every real stream's intrabc block needs the unread inter var-tx transform tree"), ]; #[cfg(test)] diff --git a/crates/ec-av1/src/mvstack.rs b/crates/ec-av1/src/mvstack.rs index 96284d7c..8c0fd438 100644 --- a/crates/ec-av1/src/mvstack.rs +++ b/crates/ec-av1/src/mvstack.rs @@ -327,6 +327,13 @@ fn add_candidate(candidates: &mut Vec, mv: (i32, i32), weight: u32) /// `LAST_FRAME`) pass an all-`false` table, matching this stub's old /// always-`false` behaviour exactly. fn sign_bias(table: &SignBiasTable, ref_frame: i8) -> bool { + // lane-intrabc: `INTRA_FRAME` (0) and `NONE` (-1) sit *below* the table's + // own `LAST_FRAME` base and have no sign bias at all -- an intrabc block + // queries the stack with `ref_frame == INTRA_FRAME`, which indexed this + // table at `usize::MAX` before. + if ref_frame < LAST_FRAME { + return false; + } table[(ref_frame - LAST_FRAME) as usize] } @@ -359,6 +366,11 @@ pub const NO_GM_MV: GmMvTable = [(0, 0); 7]; /// `table[ref_frame - LAST_FRAME]`, [`sign_bias`]'s shape for a /// [`GmMvTable`]. fn gm_mv(table: &GmMvTable, ref_frame: i8) -> (i32, i32) { + // Same below-`LAST_FRAME` guard as [`sign_bias`]: `INTRA_FRAME` (the + // intrabc query's own ref) has no global motion model. + if ref_frame < LAST_FRAME { + return (0, 0); + } table[(ref_frame - LAST_FRAME) as usize] } diff --git a/crates/ec-av1/src/refusal_inventory.rs b/crates/ec-av1/src/refusal_inventory.rs index fb771602..b6a2428f 100644 --- a/crates/ec-av1/src/refusal_inventory.rs +++ b/crates/ec-av1/src/refusal_inventory.rs @@ -52,7 +52,7 @@ const REFUSALS: &[&str] = &[ "a HORZ/VERT intra strip with a split transform (per-unit rect prediction is not ported)", "a block that actually uses a palette (UV) -- reconstruction is out of scope", "a block that actually uses a palette (Y) -- reconstruction is out of scope", - "a block that actually uses intrabc (this decoder never reconstructs one)", + "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)", "a frame OBU with no tile group", "a frame naming primary_ref_frame at a reference slot with no saved CDF state", "a frame with no mode-info grid", diff --git a/lanes/intrabc-r1.report.md b/lanes/intrabc-r1.report.md new file mode 100644 index 00000000..72436d9f --- /dev/null +++ b/lanes/intrabc-r1.report.md @@ -0,0 +1,108 @@ +# lane-intrabc r1 — the block vector decodes; the transform tree does not + +## Verdict + +The headline refusal `a block that actually uses intrabc (this decoder never +reconstructs one)` is **replaced, not lifted**. Its successor names the real +remaining wall: + +``` +an intrabc block under TxMode::Select (its transform size is coded by the +inter var-tx partition tree, which this decoder never reads) +``` + +Everything the charter listed *before* the residual is implemented and runs on +real aomenc streams: `use_intrabc`, the DV's own mv stack, the `ndvc` full-pel +`read_mv`, `av1_find_ref_dv`'s fallback, and the block-copy prediction. No +pixel-exact gate exists yet, because no aomenc recipe found this round produces +an intrabc block that does *not* also need `read_var_tx_size`. + +## What changed (worktree `edith_codecs-intrabc`, branch `lane-intrabc`) + +- `crates/ec-av1/src/cdf_state.rs:422` — `dv_joint`/`dv_comp`: libaom's `ndvc` + (`av1_init_mv_probs` gives it the same spec-8.4 defaults as `nmvc`, separate + adaptation), added to the per-frame counter-reset list at `:684`. +- `crates/ec-av1/src/decode.rs:590` — `INTRABC_MI_GRID` / `INTRABC_DV` / + `INTRABC_HITS` thread-locals + `intrabc_hits()`, `reset_intrabc_hits()`, + `record_intrabc_mi()`. The mi grid exists only while a frame header set + `allow_intrabc`. +- `crates/ec-av1/src/decode.rs:4046` (`read_intra_mode`) — `use_intrabc == 1` + now reads the DV instead of refusing, and returns immediately with + `YMode`/`UVMode` forced `DC_PRED` (libaom `read_intra_frame_mode_info` + returns at `decodemv.c:895`, so no mode/angle/palette/CFL/filter-intra + syntax follows). +- `crates/ec-av1/src/decode.rs:7681` — `read_intrabc_dv`: MV stack against + `INTRA_FRAME`, `nearest` else `near`, else `av1_find_ref_dv` + (`(0, -(64+256)*8)` in the first SB row, else `(-64*8, 0)`), predictor + floored to full pel, then `read_mv` on `dv_comp`/`dv_joint` with + `MV_SUBPEL_NONE` semantics (`force_integer_mv=true`, + `allow_high_precision_mv=false`). No DRL symbol is coded for a DV, so a + wrong predictor can only move pixels, never the bitstream position. +- `crates/ec-av1/src/decode.rs` (`decode_block`) — takes the DV, refuses + var-tx by name, switches the luma `TxbSet` to the **inter** ext-tx sets + (`txbset_for_inter`, since libaom's `is_inter_block` is true for intrabc, + `blockd.h:373`), builds the Y/U/V block-copy prediction with + `mc::predict_with_filter(.., Bilinear, ..)` off the *current* planes and + ships it through the existing `PALETTE_PRED` per-block prediction override, + and records the block into the mi grid. +- `crates/ec-av1/src/mvstack.rs:330,368` — **two real index bugs**: + `sign_bias()` and `gm_mv()` both indexed `table[ref_frame - LAST_FRAME]` + with no lower guard, so any query with `ref_frame == INTRA_FRAME` (0), which + is exactly what an intrabc block does, panicked with + `index out of bounds: the len is 7 but the index is 18446744073709551615`. + Both now return the neutral value below `LAST_FRAME`. Same-shape sweep: those + are the only two `- LAST_FRAME` table indexes in the crate. +- `crates/ec-av1/src/refusal_inventory.rs:55`, `gate_coverage.rs:36` — refusal + string replaced; `enable-intrabc` stays in `NEVER_EXERCISED` with its reason + rewritten to the true state. + +## Fixture recipe (the round's most reusable finding) + +Intra block copy is **impossible in a 64x64 frame**: a valid DV must clear +`INTRABC_DELAY_PIXELS` (256) plus one superblock, so a single-SB frame can +never contain one. Every 64x64 sweep this lane ran (3 sources x 6 cq) produced +zero intrabc blocks. A 512-wide frame with horizontally repeated content does: + +``` +ffmpeg -f lavfi -i "testsrc2=size=64x64:rate=1" -t 0.04 \ + -vf "tile=8x1,scale=512:64" -pix_fmt yuv420p -f rawvideo wide512.yuv +~/.cache/aom-oracle/build/aomenc --codec=av1 -w 512 -h 64 --i420 --limit=1 \ + --kf-max-dist=1 --cpu-used=1 --passes=1 --end-usage=q --cq-level=20 \ + --enable-intrabc=1 --tune-content=screen --enable-palette=0 \ + --enable-rect-partitions=0 --enable-ab-partitions=0 \ + --enable-1to4-partitions=0 --min-partition-size=16 --max-partition-size=32 \ + --obu -o w.obu wide512.yuv +cargo run -p ec-av1 --release --example decode_probe -- w.obu +``` + +`--enable-palette=0` and the partition switches are a **deviation from the +charter's gate recipe** (`--enable-palette=1`): with palette on, or with rect/AB +partitions available, the stream refuses on palette or on a sub-16x16 AB +partition *before* the first intrabc block, so it cannot isolate this lane's +capability at all. `cpu-used` must be <= 2 — at 3 and above aomenc's speed +features stop searching intrabc entirely (sweep: cpu 3/5/6/8 x cq 20/40, all 8 +decode clean, i.e. no intrabc block at all). + +## EVIDENCE + +EVIDENCE: /tmp/claude-1000/-home-user-Documents-Code-Rust-edith-codecs/b6d8a07f-96a4-4bbb-b378-af9ae25cf7c9/scratchpad/w.obu | recipe above, cpu-used 1 and 2 x cq 20/40, decode_probe before vs after | before: `REFUSED: ... a block that actually uses intrabc`; after: `REFUSED: ... an intrabc block under TxMode::Select` — the `use_intrabc` symbol, the DV read and the prediction all ran, 4/4 streams +EVIDENCE: same streams | sweep cpu-used 0,1,2,3,5,6,8 x cq 20,40,55 | intrabc only appears at cpu-used <= 2; cpu 0 stops earlier on an SB-level partition type + +## Residue + +- fix-now (next round, needs its own charter): `read_var_tx_size` — the + `txfm_partition` CDF (21 contexts) does not exist anywhere in the crate, nor + do the above/left txfm-context arrays it needs, nor does the residual loop + handle a non-uniform TU tree. This is the single blocker between here and a + pixel-exact intrabc gate. +- deferred(var-tx): the pixel-exact 8-bit/10-bit gate the charter asks for, and + the `gate_coverage.rs` entry retirement — no stream can reach reconstruction + until var-tx reads. +- accepted, documented as corner-cuts in source: only `decode_block` (square + path) records into the intrabc mi grid; a frame mixing intrabc with rect or + sub-8x8 leaves would predict off an incomplete grid (DV value only, never the + parse). Chroma of an inter/intrabc block should inherit the co-located luma + `tx_type` (libaom `av1_get_tx_type`), while `read_plane` still derives + `DCT_DCT` for chroma — no symbol difference, but a suspected pixel difference + the moment luma picks a non-DCT type. Both are prime suspects for the first + pixel mismatch once var-tx lands.