forge
Explore
Log in

Don't you dare go Hollow

The palette neighbour bands are cleared by the key-frame sub-8x8 leaves

Browse files at this commit

2fe9a361b00e3c0df5c0bb0af64ad4ac0bcee851Ahmet Kaan GümüşParent: 66e8f70
  • fix
    • the palette neighbour bands are cleared by the key-frame sub-8x8 leaves
Show full message
fix(av1): the palette neighbour bands are cleared by the key-frame sub-8x8 leaves

Narrows the previous commit: the 5 INTER-side zero-stamps regressed 13 tests
(our own encoder's screen streams stopped decoding) because the inter readers'
band index/footprint convention is not the palette bands' -- reverted, recorded
in lanes/dkey.report.md as the open half of the sweep. The two key-frame
sub-8x8 stamps, which are what the measured mi(76,88) desync needed, stay.
crates/ec-av1/src/decode.rsmodified+0 -54
@@ -29614,15 +29614,6 @@ fn decode_inter_block(
2961429614 write_h / MI,
2961529615 skip,
2961629616 );
29617- // lane-dkey sweep: an INTER block (and every sub-8x8 leaf) has
29618- // `palette_size == 0` in libaom's mi grid, so the next block's
29619- // `av1_get_palette_mode_ctx`/colour cache must read 0 across this
29620- // footprint. Only the >=8x8 intra readers published palette state, so a
29621- // palette block's size/colours stayed standing in the mi-granular bands
29622- // and a later intra block read `palette_y_mode` off the wrong CDF row
29623- // (class [[cdf-row-held-constant]]).
29624- neighbours.record_palette_y_rect((rmi, cmi), write_w, write_h, 0, [0u16; 8]);
29625- neighbours.record_palette_uv_rect((rmi, cmi), write_w, write_h, 0, [0u16; 8]);
2962629617 neighbours.fill_lf_grid_rect(
2962729618 (rmi, cmi),
2962829619 write_w / MI,
@@ -30107,15 +30098,6 @@ fn decode_inter_sub8_split4(
3010730098 // var-tx context instead of leaving whatever the previous block left.
3010830099 set_txfm_ctxs(neighbours, lmi, B4, 1, 1, false);
3010930100 neighbours.fill_skip_grid_rect(lmi, 1, 1, skip);
30110- // lane-dkey sweep: an INTER block (and every sub-8x8 leaf) has
30111- // `palette_size == 0` in libaom's mi grid, so the next block's
30112- // `av1_get_palette_mode_ctx`/colour cache must read 0 across this
30113- // footprint. Only the >=8x8 intra readers published palette state, so a
30114- // palette block's size/colours stayed standing in the mi-granular bands
30115- // and a later intra block read `palette_y_mode` off the wrong CDF row
30116- // (class [[cdf-row-held-constant]]).
30117- neighbours.record_palette_y_rect(lmi, MI, MI, 0, [0u16; 8]);
30118- neighbours.record_palette_uv_rect(lmi, MI, MI, 0, [0u16; 8]);
3011930101 neighbours.fill_lf_grid_rect(lmi, 1, 1, B4 as u8, B4 as u8, ref_frame.max(LAST_FRAME), fctx);
3012030102 last_skip = skip;
3012130103 }
@@ -30573,15 +30555,6 @@ fn decode_intra_sub8_leaf(
3057330555 }
3057430556 let (tx_w, tx_h) = if split { (4, 4) } else { (bw, bh) };
3057530557 neighbours.fill_skip_grid_rect(lmi, w_mi, h_mi, skip);
30576- // lane-dkey sweep: an INTER block (and every sub-8x8 leaf) has
30577- // `palette_size == 0` in libaom's mi grid, so the next block's
30578- // `av1_get_palette_mode_ctx`/colour cache must read 0 across this
30579- // footprint. Only the >=8x8 intra readers published palette state, so a
30580- // palette block's size/colours stayed standing in the mi-granular bands
30581- // and a later intra block read `palette_y_mode` off the wrong CDF row
30582- // (class [[cdf-row-held-constant]]).
30583- neighbours.record_palette_y_rect(lmi, w_mi * MI, h_mi * MI, 0, [0u16; 8]);
30584- neighbours.record_palette_uv_rect(lmi, w_mi * MI, h_mi * MI, 0, [0u16; 8]);
3058530558 neighbours.fill_lf_grid_rect(lmi, w_mi, h_mi, tx_w as u8, tx_h as u8, 0, fctx);
3058630559 // `set_txfm_ctxs(tx_size, n4_w, n4_h, skip && is_inter == 0, xd)`: an
3058730560 // intra block of an inter frame publishes its TRANSFORM dims, never its
@@ -31195,15 +31168,6 @@ fn decode_inter_sub8_rect2(
3119531168 neighbours.record_mode_mi(rmi, cmi, w_mi, h_mi, DC_PRED);
3119631169 neighbours.record_inter_rect_mi(lmi, w_mi, h_mi, skip, true, ref_frame, resolved_filter, false);
3119731170 neighbours.fill_skip_grid_rect(lmi, w_mi, h_mi, skip);
31198- // lane-dkey sweep: an INTER block (and every sub-8x8 leaf) has
31199- // `palette_size == 0` in libaom's mi grid, so the next block's
31200- // `av1_get_palette_mode_ctx`/colour cache must read 0 across this
31201- // footprint. Only the >=8x8 intra readers published palette state, so a
31202- // palette block's size/colours stayed standing in the mi-granular bands
31203- // and a later intra block read `palette_y_mode` off the wrong CDF row
31204- // (class [[cdf-row-held-constant]]).
31205- neighbours.record_palette_y_rect(lmi, w_mi * MI, h_mi * MI, 0, [0u16; 8]);
31206- neighbours.record_palette_uv_rect(lmi, w_mi * MI, h_mi * MI, 0, [0u16; 8]);
3120731171 last_skip = skip;
3120831172 }
3120931173 // lane-sub8intra: when the chroma-reference sub-block was INTRA it coded
@@ -32306,15 +32270,6 @@ fn decode_inter_block8(
3230632270 // dlist excludes it (3 luma samples on a 192x128 inter frame).
3230732271 hit!(INTER8_SKIP_BAND_HITS);
3230832272 neighbours.fill_skip_grid(leaf_mi, 2, skip);
32309- // lane-dkey sweep: an INTER block (and every sub-8x8 leaf) has
32310- // `palette_size == 0` in libaom's mi grid, so the next block's
32311- // `av1_get_palette_mode_ctx`/colour cache must read 0 across this
32312- // footprint. Only the >=8x8 intra readers published palette state, so a
32313- // palette block's size/colours stayed standing in the mi-granular bands
32314- // and a later intra block read `palette_y_mode` off the wrong CDF row
32315- // (class [[cdf-row-held-constant]]).
32316- neighbours.record_palette_y_rect(leaf_mi, 8, 8, 0, [0u16; 8]);
32317- neighbours.record_palette_uv_rect(leaf_mi, 8, 8, 0, [0u16; 8]);
3231832273 // lane-sub8x4 r2: `split8` is this leaf's OWN var-tx split, so
3231932274 // the deblock grid must publish the TX_4X4 leaves' width the
3232032275 // same way the fall-through arm below does (libaom
@@ -33512,15 +33467,6 @@ fn decode_inter_block8(
3351233467 // gate failed on an instrumentation gap, with the band written either way.
3351333468 hit!(INTER8_SKIP_BAND_HITS);
3351433469 neighbours.fill_skip_grid(leaf_mi, 2, skip);
33515- // lane-dkey sweep: an INTER block (and every sub-8x8 leaf) has
33516- // `palette_size == 0` in libaom's mi grid, so the next block's
33517- // `av1_get_palette_mode_ctx`/colour cache must read 0 across this
33518- // footprint. Only the >=8x8 intra readers published palette state, so a
33519- // palette block's size/colours stayed standing in the mi-granular bands
33520- // and a later intra block read `palette_y_mode` off the wrong CDF row
33521- // (class [[cdf-row-held-constant]]).
33522- neighbours.record_palette_y_rect(leaf_mi, 8, 8, 0, [0u16; 8]);
33523- neighbours.record_palette_uv_rect(leaf_mi, 8, 8, 0, [0u16; 8]);
3352433470 neighbours.fill_lf_grid(
3352533471 leaf_mi,
3352633472 2,
lanes/dkey.report.mdmodified+17 -5
@@ -47,8 +47,15 @@ paths only.
4747 ## Sweep
4848
4949 `fill_skip_grid*` (every leaf block publishes it) vs `record_palette_*` over
50-all 16 block readers: 9 readers had skip but no palette publication. Fixed the
51-7 that provably code no palette. **Remaining, deferred:** `decode_rect_split`,
50+all 16 block readers: 9 readers had skip but no palette publication. Stamped
51+7; the 5 INTER-side stamps (`decode_inter_block`, `decode_inter_block8` x2,
52+`decode_inter_sub8_split4`, `decode_inter_sub8_rect2`, `decode_intra_sub8_leaf`)
53+REGRESSED 13 tests (our own encoder's screen streams stopped decoding: "a
54+reference frame selected with no picture at this frame's own ref_frame_idx
55+slot") and were reverted -- the inter readers' `(rmi, cmi)`/`write_w`/`write_h`
56+are not the same footprint convention the palette bands index, so those stamps
57+zeroed cells belonging to real palette blocks. Only the two KEY-frame sub-8x8
58+stamps ship. **Remaining, deferred:** `decode_rect_split`,
5259 `decode_leaf_rect`, `decode_block_rect4`, `decode_rect4_16_strip` and
5360 `decode_intra_rect_in_inter` are >=8x8 intra readers that CAN code palette
5461 (`decode_intra_rect_in_inter` reads `palette_y_mode` at decode.rs:10131) and
@@ -68,8 +75,8 @@ neighbours). Needs each reader's decoded palette threaded to the tail.
6875
6976 ## Files
7077
71-* `crates/ec-av1/src/decode.rs` — the 7 zero-stamps (2 in the key-frame sub8
72- readers, 5 in the inter/sub8 readers).
78+* `crates/ec-av1/src/decode.rs` — 2 zero-stamps, in `decode_leaf_split4` and
79+ `decode_leaf_rect8` (the key-frame sub-8x8 groups).
7380 * `crates/ec-av1/src/encode.rs` — `external_ladder` now decodes EVERY reference
7481 ladder point through `decode_stream` and asserts sample-exactness against
7582 ffmpeg, naming encoder/params/frame/plane/sample (the assertion that would
@@ -82,7 +89,12 @@ neighbours). Needs each reader's decoded palette threaded to the tail.
8289 1. **crf 5 inter-frame Golomb refusal** — key frame is exact now; the failure
8390 is in an inter frame (`EC_MM` trace, last read mi(124,412)). Unblocks: diff
8491 aomdec `EC_MODE`/`EC_STACK` against our `EC_MM` from the first inter frame.
85-2. **The palette-publishing mirror gap** above (5 readers).
92+2. **The inter-side half of the sweep** (5 readers, reverted above) and the
93+ palette-publishing mirror gap (`decode_intra_rect_in_inter` reads
94+ `palette_y_mode` and publishes nothing). Unblocks: read each inter reader's
95+ real band-index/footprint convention before stamping (the failing tests are
96+ `encoder::tests::the_content_gate_keeps_screen_streams_flat` and the 12
97+ others listed in the suite log).
8698 3. **The sensitive `force_integer_mv` fixture**: a 1920x1024 source with a
8799 textured patch moving 2.5 px per duplicate-pair (half-pel motion, exact
88100 duplicate frames) makes libaom round 72 projected candidates