forge
Explore
Log in

Don't you dare go Hollow

16x16 partition ctx reads stale coarse side after a leaf8 sibling

Browse files at this commit

4353787102b92f59995dd95799f13bf64a74082aAhmet Kaan GümüşParent: 9a69856
  • fix
    • 16x16 partition ctx reads stale coarse side after a leaf8 sibling
Show full message
fix(av1): 16x16 partition ctx reads stale coarse side after a leaf8 sibling

partition_ctx (SUB-grid) only advances above_side/left_side in whole-16px
steps, so write_leaf8's record_mi (mi-precise only) never updated them: the
next 16x16-level split query after a leaf8 quadrant read a stale side value
instead of 8. Delegate partition_ctx through partition_ctx_mi (same pattern
as around/around_mi), which record already keeps in sync at mi granularity
for every block. Confirmed against a debug aomdec EC_RNG/EC_TRACE2 trace:
the 16x16-level ctx at mi(4,8) now matches libaom's (row 1 both sides,
after subtracting aomdec's shared-cdf bsl*4 offset). Full ec-av1 gate green,
no regressions.

Not sufficient on its own: the 40x32 straddle test still desyncs, now
traced to the BLOCK_8X8 leaf's own partition-symbol context/table, not the
TX_TYPE/EOB_PT pair r8 flagged -- see ledger for handoff.
crates/ec-av1/src/tile.rsmodified+7 -1
@@ -804,8 +804,14 @@ impl Neighbours {
804 }804 }
805 805
806 fn partition_ctx(&self, at: (usize, usize), side: usize) -> usize {806 fn partition_ctx(&self, at: (usize, usize), side: usize) -> usize {
807+ // Delegates to the mi-precise reader (same pattern as `around` /
808+ // `around_mi`): `above_side`/`left_side` are only ever advanced in
809+ // whole-[`SUB`] steps by [`Self::record`], so a leaf8's `record_mi`
810+ // (lane-av1-rect) -- which only touches the finer mi arrays -- leaves
811+ // them stale for the *next* sibling's own partition symbol, reading a
812+ // 16x16-slot side that already split into 8x8s underneath it.
807 let (r, c) = at;813 let (r, c) = at;
808- 2 * usize::from(self.left_side[r] * 2 <= side) + usize::from(self.above_side[c] * 2 <= side)814+ self.partition_ctx_mi((r * (SUB / MI), c * (SUB / MI)), side)
809 }815 }
810 816
811 /// [`Self::partition_ctx`] at mi granularity, for an 8x8 leaf of a817 /// [`Self::partition_ctx`] at mi granularity, for an 8x8 leaf of a