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(
29614 write_h / MI,29614 write_h / MI,
29615 skip,29615 skip,
29616 );29616 );
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]);
29626 neighbours.fill_lf_grid_rect(29617 neighbours.fill_lf_grid_rect(
29627 (rmi, cmi),29618 (rmi, cmi),
29628 write_w / MI,29619 write_w / MI,
@@ -30107,15 +30098,6 @@ fn decode_inter_sub8_split4(
30107 // var-tx context instead of leaving whatever the previous block left.30098 // var-tx context instead of leaving whatever the previous block left.
30108 set_txfm_ctxs(neighbours, lmi, B4, 1, 1, false);30099 set_txfm_ctxs(neighbours, lmi, B4, 1, 1, false);
30109 neighbours.fill_skip_grid_rect(lmi, 1, 1, skip);30100 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]);
30119 neighbours.fill_lf_grid_rect(lmi, 1, 1, B4 as u8, B4 as u8, ref_frame.max(LAST_FRAME), fctx);30101 neighbours.fill_lf_grid_rect(lmi, 1, 1, B4 as u8, B4 as u8, ref_frame.max(LAST_FRAME), fctx);
30120 last_skip = skip;30102 last_skip = skip;
30121 }30103 }
@@ -30573,15 +30555,6 @@ fn decode_intra_sub8_leaf(
30573 }30555 }
30574 let (tx_w, tx_h) = if split { (4, 4) } else { (bw, bh) };30556 let (tx_w, tx_h) = if split { (4, 4) } else { (bw, bh) };
30575 neighbours.fill_skip_grid_rect(lmi, w_mi, h_mi, skip);30557 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]);
30585 neighbours.fill_lf_grid_rect(lmi, w_mi, h_mi, tx_w as u8, tx_h as u8, 0, fctx);30558 neighbours.fill_lf_grid_rect(lmi, w_mi, h_mi, tx_w as u8, tx_h as u8, 0, fctx);
30586 // `set_txfm_ctxs(tx_size, n4_w, n4_h, skip && is_inter == 0, xd)`: an30559 // `set_txfm_ctxs(tx_size, n4_w, n4_h, skip && is_inter == 0, xd)`: an
30587 // intra block of an inter frame publishes its TRANSFORM dims, never its30560 // intra block of an inter frame publishes its TRANSFORM dims, never its
@@ -31195,15 +31168,6 @@ fn decode_inter_sub8_rect2(
31195 neighbours.record_mode_mi(rmi, cmi, w_mi, h_mi, DC_PRED);31168 neighbours.record_mode_mi(rmi, cmi, w_mi, h_mi, DC_PRED);
31196 neighbours.record_inter_rect_mi(lmi, w_mi, h_mi, skip, true, ref_frame, resolved_filter, false);31169 neighbours.record_inter_rect_mi(lmi, w_mi, h_mi, skip, true, ref_frame, resolved_filter, false);
31197 neighbours.fill_skip_grid_rect(lmi, w_mi, h_mi, skip);31170 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]);
31207 last_skip = skip;31171 last_skip = skip;
31208 }31172 }
31209 // lane-sub8intra: when the chroma-reference sub-block was INTRA it coded31173 // lane-sub8intra: when the chroma-reference sub-block was INTRA it coded
@@ -32306,15 +32270,6 @@ fn decode_inter_block8(
32306 // dlist excludes it (3 luma samples on a 192x128 inter frame).32270 // dlist excludes it (3 luma samples on a 192x128 inter frame).
32307 hit!(INTER8_SKIP_BAND_HITS);32271 hit!(INTER8_SKIP_BAND_HITS);
32308 neighbours.fill_skip_grid(leaf_mi, 2, skip);32272 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]);
32318 // lane-sub8x4 r2: `split8` is this leaf's OWN var-tx split, so32273 // lane-sub8x4 r2: `split8` is this leaf's OWN var-tx split, so
32319 // the deblock grid must publish the TX_4X4 leaves' width the32274 // the deblock grid must publish the TX_4X4 leaves' width the
32320 // same way the fall-through arm below does (libaom32275 // same way the fall-through arm below does (libaom
@@ -33512,15 +33467,6 @@ fn decode_inter_block8(
33512 // gate failed on an instrumentation gap, with the band written either way.33467 // gate failed on an instrumentation gap, with the band written either way.
33513 hit!(INTER8_SKIP_BAND_HITS);33468 hit!(INTER8_SKIP_BAND_HITS);
33514 neighbours.fill_skip_grid(leaf_mi, 2, skip);33469 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]);
33524 neighbours.fill_lf_grid(33470 neighbours.fill_lf_grid(
33525 leaf_mi,33471 leaf_mi,
33526 2,33472 2,
lanes/dkey.report.mdmodified+17 -5
@@ -47,8 +47,15 @@ paths only.
47 ## Sweep47 ## Sweep
48 48
49 `fill_skip_grid*` (every leaf block publishes it) vs `record_palette_*` over49 `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 the50+all 16 block readers: 9 readers had skip but no palette publication. Stamped
51-7 that provably code no palette. **Remaining, deferred:** `decode_rect_split`,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`,
52 `decode_leaf_rect`, `decode_block_rect4`, `decode_rect4_16_strip` and59 `decode_leaf_rect`, `decode_block_rect4`, `decode_rect4_16_strip` and
53 `decode_intra_rect_in_inter` are >=8x8 intra readers that CAN code palette60 `decode_intra_rect_in_inter` are >=8x8 intra readers that CAN code palette
54 (`decode_intra_rect_in_inter` reads `palette_y_mode` at decode.rs:10131) and61 (`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.
68 75
69 ## Files76 ## Files
70 77
71-* `crates/ec-av1/src/decode.rs` — the 7 zero-stamps (2 in the key-frame sub878+* `crates/ec-av1/src/decode.rs` — 2 zero-stamps, in `decode_leaf_split4` and
72- readers, 5 in the inter/sub8 readers).79+ `decode_leaf_rect8` (the key-frame sub-8x8 groups).
73 * `crates/ec-av1/src/encode.rs` — `external_ladder` now decodes EVERY reference80 * `crates/ec-av1/src/encode.rs` — `external_ladder` now decodes EVERY reference
74 ladder point through `decode_stream` and asserts sample-exactness against81 ladder point through `decode_stream` and asserts sample-exactness against
75 ffmpeg, naming encoder/params/frame/plane/sample (the assertion that would82 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.
82 1. **crf 5 inter-frame Golomb refusal** — key frame is exact now; the failure89 1. **crf 5 inter-frame Golomb refusal** — key frame is exact now; the failure
83 is in an inter frame (`EC_MM` trace, last read mi(124,412)). Unblocks: diff90 is in an inter frame (`EC_MM` trace, last read mi(124,412)). Unblocks: diff
84 aomdec `EC_MODE`/`EC_STACK` against our `EC_MM` from the first inter frame.91 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).
86 3. **The sensitive `force_integer_mv` fixture**: a 1920x1024 source with a98 3. **The sensitive `force_integer_mv` fixture**: a 1920x1024 source with a
87 textured patch moving 2.5 px per duplicate-pair (half-pel motion, exact99 textured patch moving 2.5 px per duplicate-pair (half-pel motion, exact
88 duplicate frames) makes libaom round 72 projected candidates100 duplicate frames) makes libaom round 72 projected candidates