R1 report -- 16-level 1:4 partition, paired chroma, split transform
Browse files at this commit0bdb3cc5966643f703af4c81c03df2c6ceda6dc2Parent: e1a08a1- docs
- r1 report -- 16-level 1:4 partition, paired chroma, split transform
1 changed file +109 -0
- lanes/r14-r1.report.md +109 -0
lanes/r14-r1.report.mdadded+109 -0
| @@ -0,0 +1,109 @@ | |||
| 1 | +# lane-r14 r1 -- the 16x16-level 1:4 partition (four 16x4 / 4x16 strips) | ||
| 2 | + | ||
| 3 | +Branch `lane-r14` off main `0df090a`; commits `9bde843` (partition + paired | ||
| 4 | +chroma) and `ccd58a2` (split transform). | ||
| 5 | + | ||
| 6 | +## Film first | ||
| 7 | + | ||
| 8 | +`ffmpeg -ss 300 -t 0.4 -i <the 4K 10-bit AV1 mkv> -c:v copy -f obu kf300.obu`, | ||
| 9 | +then `decode_probe`: | ||
| 10 | + | ||
| 11 | +* BEFORE: `REFUSED: a 1:4 partition below 16x16 (PARTITION_HORZ_4/VERT_4, four | ||
| 12 | + 16x4/4x16 strips ...)`. | ||
| 13 | +* AFTER 9bde843: `REFUSED: a 16x4/4x16 strip whose transform is split` -- every | ||
| 14 | + 16-level 1:4 strip in that key frame reads `tx_depth != 0`, so the partition | ||
| 15 | + alone was not enough. | ||
| 16 | +* AFTER ccd58a2: `REFUSED: a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs | ||
| 17 | + rectangular residual coding` -- ANOTHER lane's wall; the 1:4 one is gone, with | ||
| 18 | + 104 16x4 + 172 4x16 strips decoded at the 32 level alone before it stops. | ||
| 19 | + | ||
| 20 | +EVIDENCE: /tmp/claude-1000/-home-user-Documents-Code-Rust-edith-codecs/b6d8a07f-96a4-4bbb-b378-af9ae25cf7c9/scratchpad/r14/kf300.obu | decode_probe before/after each commit | refusal string moved 1:4-partition -> 1:4-split-transform -> rect-residual (another lane) | ||
| 21 | + | ||
| 22 | +## What changed | ||
| 23 | + | ||
| 24 | +* `crates/ec-av1/src/decode.rs` -- `decode_rect4_16` (new): the four strips of a | ||
| 25 | + 16-level `PARTITION_HORZ_4`/`VERT_4`, wired at the key-frame 16-level | ||
| 26 | + partition site (the old refusal is now | ||
| 27 | + "a 16x16-level partition value outside PARTITION_NONE..PARTITION_VERT_4", | ||
| 28 | + the SB-level wording one size down). | ||
| 29 | + - CHROMA is what is new at this size: `is_chroma_reference` is false for a | ||
| 30 | + 4:2:0 block one mi tall (wide) on an EVEN mi row (column), so strips 0 and 2 | ||
| 31 | + read no `uv_mode`/`cfl_alpha`/`angle_delta_uv` and code no chroma; strips 1 | ||
| 32 | + and 3 close the pair and carry the 8x4 (4x8) chroma of the whole 16x8 (8x16) | ||
| 33 | + luma pair at the PAIR's origin (`setup_pred_plane`'s `mi_row -= 1`), CfL | ||
| 34 | + averaging the pair's luma. | ||
| 35 | + - `read_intra_mode_rect` grew a `has_chroma` (`is_chroma_reference`) parameter; | ||
| 36 | + the four existing call sites pass `true`. | ||
| 37 | + - Split transform: `decode_rect_split`'s per-unit walk inlined (its chroma is | ||
| 38 | + the block's, ours is the pair's). depth 1 = TX_8X4/TX_4X8 rect units | ||
| 39 | + (`TxbSet::LumaRect4x8`), depth 2 = square TX_4X4 via `read_plane`. | ||
| 40 | + - `filter_intra_size_class_rect`: classes 12/13 for 16x4/4x16. | ||
| 41 | + - `palette_bsize_ctx_wh`: DEFECT SWEPT -- `av1_allow_palette`'s | ||
| 42 | + `sb_type >= BLOCK_8X8` is an ENUM INDEX test that BLOCK_4X16 (16) and | ||
| 43 | + BLOCK_16X4 (17) clear, so a 64-pixel 1:4 strip DOES read `palette_y_mode` | ||
| 44 | + (ctx 0) in a screen-content frame; the old "both sides >= 8" bound dropped | ||
| 45 | + that symbol. Now `bw <= 64 && bh <= 64 && bw * bh >= 64`, which reproduces | ||
| 46 | + the enum-index rule for every shape. | ||
| 47 | +* `crates/ec-av1/src/cdf.rs` -- `FILTER_INTRA` rows 12/13 (10368/12770), the | ||
| 48 | + values `filter_intra_classes_carry_their_own_libaom_default_row` already | ||
| 49 | + pinned for BLOCK_16X4/BLOCK_4X16; that test now lists both as owning a class. | ||
| 50 | +* `crates/ec-av1/src/cdf_state.rs` -- `TxbSet::LumaRect16x4{,Set1}`: `Luma8`'s | ||
| 51 | + coefficient tables (`get_txsize_entropy_ctx(TX_16X4)` = the 8x8 class, 64 | ||
| 52 | + positions) with the `TX_4X4` `tx_type` row. | ||
| 53 | +* `crates/ec-av1/src/refusal_inventory.rs` -- the 1:4-below-16x16 refusal is | ||
| 54 | + gone; the 16-level partition-value guard replaces it. | ||
| 55 | +* `crates/ec-av1/src/stream.rs` -- the gate. | ||
| 56 | + | ||
| 57 | +## Gate | ||
| 58 | + | ||
| 59 | +`a_real_aomenc_stream_with_a_16_level_1to4_partition_decodes_pixel_exact` | ||
| 60 | +(4-pixel bands, transposed per attempt, explicit-seed noise, 192x128, | ||
| 61 | +`--enable-1to4-partitions=1 --enable-rect-partitions=1 --enable-ab-partitions=0 | ||
| 62 | +--min-partition-size=4 --max-partition-size=16 --enable-filter-intra=1 | ||
| 63 | +--cpu-used=0`, second half of the window `--enable-tx-size-search=1`), 8 seeds x | ||
| 64 | +2 tx-search arms x 2 bit depths. | ||
| 65 | + | ||
| 66 | +``` | ||
| 67 | +systemd-run --user --scope -q -p MemoryMax=8G env CARGO_TARGET_DIR=$HOME/.cache/cargo-target-r14 \ | ||
| 68 | + EC_NOMEMGUARD=1 EC_AV1_REQUIRE_AOMENC=1 nice -n 10 cargo test -p ec-av1 --lib -j3 \ | ||
| 69 | + a_real_aomenc_stream_with_a_16_level_1to4 -- --nocapture | ||
| 70 | +``` | ||
| 71 | + | ||
| 72 | +Result (both green): | ||
| 73 | + | ||
| 74 | +* 8-bit: 15 compared attempts, 192 16x4 / 288 4x16 strips, 240 chroma pairs, | ||
| 75 | + 486 coded units, 102 split-transform strips, 0 refusals, 1 out of scope. | ||
| 76 | +* 10-bit: 16 compared attempts, 148 16x4 / 280 4x16 strips, 214 chroma pairs, | ||
| 77 | + 433 coded units, 82 split-transform strips, 0 refusals, 0 out of scope. | ||
| 78 | + | ||
| 79 | +Every decoded frame is pixel-compared against ffmpeg (`assert_eq` on all three | ||
| 80 | +planes); a decode error is asserted to be a NAMED refusal, never a SKIP. | ||
| 81 | + | ||
| 82 | +EVIDENCE: cargo test output above | 31 real aomenc streams encoded, decoded and compared | 340 16x4 + 568 4x16 strips, 454 chroma pairs, 184 split-transform strips, 0 mismatches | ||
| 83 | + | ||
| 84 | +Encoder-side proof the shape is really in the stream (independent of our | ||
| 85 | +counters): instrumented `aomdec EC_TRACE=1` on the same recipe prints | ||
| 86 | +`EC_PART bsize=6 value=8` (HORZ_4 at BLOCK_16X16) 6x and `value=9` (VERT_4) | ||
| 87 | +10x on the two axes of the fixture. | ||
| 88 | + | ||
| 89 | +## Refusals | ||
| 90 | + | ||
| 91 | +* LIFTED: "a 1:4 partition below 16x16 (PARTITION_HORZ_4/VERT_4, four 16x4/4x16 | ||
| 92 | + strips ...)". | ||
| 93 | +* STILL REFUSED at this shape: "a 1:4 rect strip that actually uses a palette" | ||
| 94 | + (shared with the 32-level pair; reconstruction unported). | ||
| 95 | +* NEW (replacing the lifted one, same site): "a 16x16-level partition value | ||
| 96 | + outside PARTITION_NONE..PARTITION_VERT_4". | ||
| 97 | + | ||
| 98 | +## Residue | ||
| 99 | + | ||
| 100 | +* deferred: the INTER twin of this partition (the inter 16-level site still | ||
| 101 | + refuses 1:4 by its own name) -- unblocked by an inter fixture that reaches a | ||
| 102 | + 16-level 1:4, out of this lane's intra scope. | ||
| 103 | +* deferred: CfL over the pair is written but no gate proves it fired -- | ||
| 104 | + `--enable-cfl-intra` stays `=0` on this recipe because there is no CfL hit | ||
| 105 | + counter, and enabling the flag alone would falsely retire the tool from | ||
| 106 | + `gate_coverage::NEVER_EXERCISED_*`. Unblocked by a CfL counter + a fixture | ||
| 107 | + whose chroma actually correlates with luma. | ||
| 108 | +* accepted: no `--tile-columns` arm in this gate -- the lane added no per-mi | ||
| 109 | + neighbour map, it reuses the existing tile-edge-guarded ones. | ||