forge
Explore
Log in

Don't you dare go Hollow

A var-tx inter block published its parent's side into the partition-context bands

Browse files at this commit

aabeeaf8825577a1ee548bd484a92039e8db4e03Ahmet Kaan GümüşParent: 1ca3c6e
  • fix
    • a var-tx inter block published its parent's side into the partition-context bands
Show full message
fix(av1): a var-tx inter block published its parent's side into the partition-context bands

The `vartx_leaves` branch of `decode_inter_block` called
`record_split_luma_rect_mi(at, side, side, ..)` on the premise that "a var-tx
block is always square". A superblock-level PARTITION_VERT inter strip is
32x64 with `side == 64`, so every such strip stamped 64 into
`above_side_mi`/`left_side_mi` instead of its own 32x64. The next superblock's
64-level partition context then read `above_side_mi*2 <= 64` as false and
picked CDF row 0 where libaom picked row 1.

Class `tx-grid-published-block-side` (7th instance). On the pinned 192x68 cq61
tile_cols=1 8-bit stream the 64x64 partition of mi(16,32) now enters and exits
at the oracle's ranges (ctx 0 -> 1, rng 51641 -> 38495, aomdec EC_PART ctx=13 =
bsl*4+1); the edge-straddling gate goes 3622 -> 3376 differing pixels. Residue
is a frame-1 reconstruction defect (mode and coefficient ladders of frame 1 are
now element-exact vs the instrumented oracle) -- see lanes/mergefix-r3.report.md.
crates/ec-av1/src/decode.rsmodified+7 -3
@@ -20850,9 +20850,13 @@ fn decode_inter_block(
2085020850 if vartx_leaves.is_some() {
2085120851 // Plane 0 is already correct per transform unit
2085220852 // ([`Neighbours::record_mi_luma`] above); this writes everything else
20853- // [`Neighbours::record_rect`] would (a var-tx block is always square,
20854- // so `write_w == write_h == side`).
20855- neighbours.record_split_luma_rect_mi(at, side, side, mode_for_tx, uv_predict_mode, [&u_grid, &v_grid]);
20853+ // [`Neighbours::record_rect`] would.
20854+ // lane-mergefix r3 (class `tx-grid-published-block-side`): a var-tx
20855+ // block is NOT always square -- a superblock-level PARTITION_VERT
20856+ // inter strip is 32x64 with `side == 64`, and publishing `side, side`
20857+ // stamped the PARENT's 64 into `above_side_mi`/`left_side_mi`, so the
20858+ // next superblock's partition ctx read 0 where libaom read 1.
20859+ neighbours.record_split_luma_rect_mi(at, write_w, write_h, mode_for_tx, uv_predict_mode, [&u_grid, &v_grid]);
2085620860 } else {
2085720861 neighbours.record_rect_mi(
2085820862 at,