forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to lanes/av1chromadc.report.mdClear filter

2026-09-29

4:4:4 2x2 chroma walk: window the intra-BC/palette override per unitAhmet Kaan Gümüş · 69d5cc5
4:4:4 2x2 chroma walk: window the intra-BC/palette override per unit

A skipped 64x64 square block at 4:4:4 has a 64x64 chroma plane block, which
libaom walks as a 2x2 grid of TX_32X32 units (get_vartx_max_txsize ->
av1_get_adjusted_tx_size(TX_64X64) = TX_32X32). Its chroma prediction is not
edge-derived: it is the intra-BC / UV-palette override, a whole
`chroma_side x chroma_height` buffer on the PALETTE_PRED slot, and
`PlaneBuf::reconstruct` uses the buffer it takes as the UNIT's own
`chroma_tx x chroma_tx_h` prediction (`let prediction = if let Some(buf) = pred
{ buf } else { ... }`). A multi-unit plane block must therefore hand each unit
its own WINDOW of it.

The pre-fix call was `set_palette_pred(ub.clone(), fctx)`: the whole buffer, for
every unit. At 4:2:0 the chroma plane block of a 64x64 block is a single 32x32
unit, so the whole buffer IS that unit's window and the bug is INVISIBLE --
which is why every 4:2:0 gate stayed green -- and at 4:4:4 every unit took the
buffer's first 32x32. The site already said so for LUMA ("its per-TU windowing
is the non-skip loop's own `palette_y_buf` slice, untested for skip and
unreachable in these streams"); the chroma half never got the same treatment and
r512.obu is the stream that makes it reachable.

MEASURED PROOF, before the fix (EC_PRED, per-unit prediction trace; identical
sums and identical row0/col0 are the signature of a copied window):

  OUR_PRED x=320 y=448 plane=1 side=32 sum=882176 row0=[241 x8] col0=[241,202,...]
  OUR_PRED x=352 y=448 plane=1 side=32 sum=882176 row0=[241 x8] col0=[241,202,...]
  OUR_PRED x=320 y=448 plane=2 side=32 sum=751936 row0=[110 x8] col0=[110,222,...]
  OUR_PRED x=352 y=448 plane=2 side=32 sum=751936 row0=[110 x8] col0=[110,222,...]

and EC_DEBUG_EDGES printed nothing for x=320/352 at y=448, i.e. edges() was
never called -- the prediction came from the override. The coded sibling at
x=448 DOES print its edges, and its units were already right.

RED-BEFORE, on the UNPATCHED tree, new gate
`a_444_skipped_64x64_square_block_windows_its_chroma_override_per_unit`:

  decode-order frame 0 plane U is byte-exact nowhere -- first divergence at
  sample 229728 of 262144 (x=352, y=448), 7488 samples wrong. The seed is frame
  0, mi=(112,80) px=(320,448) side=64 skip=1, whose chroma unit cu=(1,0) at
  px=(352,448) must be the SECOND 32x32 window of the block's chroma override
  and not a copy of cu=(0,0)'s.

AFTER, same oracle (aomdec EC_AV1_FINAL_DUMP vs set_final_dump_prefix, 512x512
8-bit 4:4:4, decode order), wrong samples per plane:

  f0  Y 0 | U 7488 -> 0 | V 8128 -> 0
  f1  Y 0 | U 22571 -> 0 | V 41782 -> 0
  f2  Y 0 | U 0 | V 0

79969 -> 0: every plane of every frame byte-exact, 2359296/2359296 samples. The
floors in `a_444_intrabc_owned_rect_strip_sizes_its_chroma_plane_block_and_decodes`
were RAISED from [[262144, 229728, 229728], [262144, 65704, 65704], [262144,
262144, 262144]] to [[262144; 3]; 3]; both floors' history is in that test's doc.
No floor was lowered. decode_intrabc_owned_rect is NOT touched.

CLASS SWEEP, all four unit positions of every multi-unit chroma-override walk on
the witness (temporary EC_ZZSRC probe, removed before this commit; win_head is
the unit window's first eight samples):

  f0 px=(320,448) skip=1 intrabc  (0,0)=241 (1,0)=202 (0,1)=241 (1,1)=202
  f0 px=(384,448) skip=1 intrabc  (0,0)=202 (1,0)=203 (0,1)=202 (1,1)=203
  f1 px=(128,128) skip=1 intrabc  (0,0)=54  (1,0)=54  (0,1)=54  (1,1)=54
  f1 px=(320,448) skip=1 intrabc  (0,0)=240 (1,0)=202 (0,1)=240 (1,1)=202
  f1 px=(448,384) skip=1 intrabc  (0,0)=166 (1,0)=166 (0,1)=166 (1,1)=166

The rule: invisible when the buffer is constant across the plane block, wrong at
exactly (1,0) and (1,1) when it varies, and (0,0)/(0,1) never wrong -- they
read offset 0, which is their own window. That is why the r2 dirty map starts at
x=352 = 320+32 and not at x=320. Every multi-unit walk on this witness is
src=intrabc; the UV-palette source shares the fixed line but has no multi-unit
witness here, and that cell of the class is argued, not measured.

f1 HYPOTHESIS CONFIRMED: r2 predicted f1's dirty column x=128..192 (first dirty
cell (168,128), 56/64 wrong) was the skipped 64x64 at px=(128,128). It is -- the
only multi-unit override walk in that column -- and frame 1 goes 22571 U + 41782
V wrong to 0 with this fix and no other change.

New counter SKIP_CHROMA_OVERRIDE_WINDOW_HITS counts chroma units whose override
had to be windowed (cn_cols * cn_rows > 1), exclusive to this walk; the gate
asserts >= 8 before it compares a single sample, so the exactness cannot be
vacuous.

Gates: 34/34 on the 4:4:4-lossless + intrabc_rect + 4:2:0-twin set (33 of r5
plus this lane's new gate). The wider `rect intrabc ibc chroma 444 420
subsampl` family is 141 passed / 0 failed / 5 ignored on this tip against
140 / 0 / 5 on the base 57834ee2, the set difference being exactly this lane's
new gate. Mutations, each reverted: M1 the pre-fix whole-buffer shape -> RED at
229728 (x=352,y=448); M2 window row stride chroma_side -> chroma_tx -> RED at
229824 (x=448,y=448); M3 cu_row/cu_col transposed -> RED at 229728.