forge
Explore
Log in

Don't you dare go Hollow

Commits

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

2026-09-30

lane-av1422llpred2: a chroma plane's reach is answered against the PLANE-SCALED block -- ll422_allintra is byte-exactAhmet Kaan Gümüş · 8530c01
lane-av1422llpred2: a chroma plane's reach is answered against the PLANE-SCALED block -- ll422_allintra is byte-exact

ROOT CAUSE (named expression): libaom computes `bsize = scale_chroma_bsize(mbmi->bsize, ss_x, ss_y)`
(reconintra.c:1649, called from av1_predict_intra_block at :1823), so a CHROMA plane's
has_top_right/has_bottom_left are answered against the PLANE-SCALED block shape, not the luma block's.
At ss (1,0) a BLOCK_4X4 luma leaf is answered as BLOCK_8X4 = 2 mi wide, 1 mi tall.

MECHANISM: that widening puts `blk_col_in_sb = (mi_col & (sb_mi_size - 1)) >> bw_in_mi_log2` at 0
where the one-mi-wide luma BLOCK_4X4 reads column 1 (reconintra.c:421), so libaom takes the
"leftmost column of superblock" arm (reconintra.c:429-435) -- `8 + 0 + 1 < 16 >> 0` is TRUE -- which the
per-block has_bl_4x4 table denies. Ours was `Reach::of(4, px, py, ...)` -> `Reach::bottom_left` ->
has_bl_4x4 at (row 8, col 1, per_side 16), index 257 -> HAS_BOTTOM_LEFT[3][32] = 84 = 0b0101_0100,
bit 1 CLEAR -> below_left = FALSE, so the below-left column was never copied and the directional
predictor's base term came off a replicated tail.

FIX: `Reach::of_tu_chroma(..)` with mi_bw/mi_bh from `chroma_mi_shape(leaf_shape, ss_x, ss_y)`
(encode.rs), the Rust transcription of scale_chroma_bsize -- only the BLOCK_4X4/4X8/8X4/4X16/16X4
family is remapped, every other size passes through, so at ss (0,0) and for any block of 8 or more this
is the block's own (bw/4, bh/4). For the failing unit: bw_log2 = 1, blk_col = (49 & 15) >> 1 = 0,
from_block = 8, sb_height = 16 - 8 = 8, `0 + 4 < 8 << 2 = 32` -> below_left TRUE.

WHY THE SIGNATURE WAS INTERIOR-ONLY: build_directional_and_filter_intra_predictors
(reconintra.c:1150-1158) copies n_left_px into left_col[0..3] and, only `if (n_bottomleft_px > 0)`, the
next n_bottomleft_px into left_col[4..7]; with the reach denied left_col[4..7] is never copied.
av1_dr_prediction_z3_c reads left_col[base]/[base+1] with base = (23*(c+1)+r) >> 6
(dr_intra_derivative[70] = 23). At p_angle 203 row 0 is above-driven and col 0 reads only left_col[0..3],
so row0/col0 stay byte-identical and only the interior base term moves -- coefficients untouched, hence
a bit-identical stream.

PLACEMENT WAS RULED OUT FIRST, not assumed: the oracle's rung reports mi_col=49 while the unit lands at
chroma x 96 -- both are right (49 is the ODD-column chroma-reference leaf, `is_chroma_reference`,
av1_common_int.h:1454, and setup_pred_plane snaps the plane origin back to the even column,
reconinter.h:392-393). Verified placement identical (both U planes agree byte-for-byte at chroma
x 96..99 on the failing rows; 2400 chroma units per plane = a perfect 160x240 tiling on both sides)
BEFORE blaming the reach.

MEASURED BY MAIN on this branch, bypassed release build vs `aomdec --rawvideo`, `cmp`:
- ll422_allintra: BYTE-EXACT (was Y 0 / U 2984 / V 3067); prediction-sum disagreements 453 of 9600 -> 0.
- controls ll420_allintra and ll444_allintra: still BYTE-EXACT.
- W_intrabc (16 frames): Y 917974 / U 474453 / V 487693 (U -53); X_intrabc_tiled: 864325/421720/414871
  (unchanged within a few samples) -- the 16-frame lossless INTER cells are a different mechanism.
Oracle-flip control: one oracle byte rotated moves the count by exactly +1.

NOT GATEABLE, stated plainly: 4:2:2 is refused at the sequence header, so no committed test build can
reach the fixed path; the evidence is the measurement table plus the flip control, and this change is
NOT described as gated. Regression: 420/422/444/lossless/warp/intra -- see the merge message.