forge
Explore
Log in

Don't you dare go Hollow

Compound 8x8 leaf published transform width 8 to the deblock grid even when its var-tx split it into 4x4 units

Browse files at this commit

315f5f2c944e8262290ad8e2f2dcaec248cd107dAhmet Kaan GümüşParent: 885adf5
  • fix
    • compound 8x8 leaf published transform width 8 to the deblock grid even when its var-tx split it into 4x4 units
Show full message
fix(av1): compound 8x8 leaf published transform width 8 to the deblock grid even when its var-tx split it into 4x4 units

`decode_inter_block8`'s COMPOUND early return called `fill_lf_grid(leaf_mi, 2, 8, ..)`
with a literal 8 where the fall-through single-ref tail writes `if split8 { 4 } else { 8 }`.
libaom `get_transform_size` (av1_loopfilter.c:207) reads the per-TU `inter_tx_size` for a
non-skip inter luma block, so the leaf's interior vertical/horizontal edges at x % 8 == 4
are real filter edges. Ours skipped them and widened the neighbouring edge's filter from
4-tap to 8-tap. Class early-return-skips-tail, third instance in this same arm.

Witness (8-bit 128x128 6-frame inter stream, cq 63): entropy and the pre-filter picture were
already exact on every frame; the POSTDEBLOCK dump vs the instrumented aomdec's diverged on
decode frame 2 at luma (78..80, 58..63), 12 px, max delta 3, around the unfiltered x=60 edge
of the 8x8 at mi(20,14) -- our `EC_AV1_DEBLOCK_TRACE_V` printed no VEDGE at x0=60 there while
the block's four TX_4X4 units demand one. A 12-stream sub-8x8-intra probe sweep
(8/10-bit x cq 48/55/63 x 128x128/192x128) goes 10/12 -> 12/12 pixel-EXACT vs ffmpeg.
crates/ec-av1/src/decode.rsmodified+12 -1
@@ -5010,6 +5010,9 @@ impl Neighbours {
5010 tx_h_px: u8,5010 tx_h_px: u8,
5011 ) {5011 ) {
5012 let (mi_r, mi_c) = at_mi;5012 let (mi_r, mi_c) = at_mi;
5013+ if std::env::var_os("EC_TXGRID_TRACE").is_some() {
5014+ eprintln!("EC_LFLEAF mi_row={mi_r} mi_col={mi_c} w_mi={w_mi} h_mi={h_mi} tx_px={tx_px} tx_h_px={tx_h_px}");
5015+ }
5013 for rr in 0..h_mi {5016 for rr in 0..h_mi {
5014 for cc in 0..w_mi {5017 for cc in 0..w_mi {
5015 let idx = (mi_r + rr) * self.skip_grid_cols_mi + (mi_c + cc);5018 let idx = (mi_r + rr) * self.skip_grid_cols_mi + (mi_c + cc);
@@ -24980,10 +24983,18 @@ fn decode_inter_block8(
24980 // dlist excludes it (3 luma samples on a 192x128 inter frame).24983 // dlist excludes it (3 luma samples on a 192x128 inter frame).
24981 INTER8_SKIP_BAND_HITS.with(|c| c.set(c.get() + 1));24984 INTER8_SKIP_BAND_HITS.with(|c| c.set(c.get() + 1));
24982 neighbours.fill_skip_grid(leaf_mi, 2, skip);24985 neighbours.fill_skip_grid(leaf_mi, 2, skip);
24986+ // lane-sub8x4 r2: `split8` is this leaf's OWN var-tx split, so
24987+ // the deblock grid must publish the TX_4X4 leaves' width the
24988+ // same way the fall-through arm below does (libaom
24989+ // `get_transform_size`, av1_loopfilter.c:207, reads the per-TU
24990+ // `inter_tx_size` for a non-skip inter luma block). Hardcoding
24991+ // 8 here left a compound var-tx 8x8 leaf's interior vertical
24992+ // edge at x % 8 == 4 unfiltered -- class early-return-skips-tail,
24993+ // third instance in this same arm.
24983 neighbours.fill_lf_grid(24994 neighbours.fill_lf_grid(
24984 leaf_mi,24995 leaf_mi,
24985 2,24996 2,
24986- 8,24997+ if split8 { 4 } else { 8 },
24987 if is_inter { leaf_refs.0.max(LAST_FRAME) } else { 0 },24998 if is_inter { leaf_refs.0.max(LAST_FRAME) } else { 0 },
24988 );24999 );
24989 return Ok((25000 return Ok((