edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching·0 forks·Rust·370.3 MiB·9b67700·Tahinli·3 days ago·4021 commits
| 1 | # lane-rectsplitx r1 report |
| 2 | |
| 3 | Branch `lane-rectsplitx` off main `8262b99`. |
| 4 | |
| 5 | ## What changed |
| 6 | |
| 7 | - `crates/ec-av1/src/decode.rs` |
| 8 | - `decode_rect_split` is now **mi-granular** (`at_mi`) and takes the transform |
| 9 | unit as `(tx_w, tx_h)` instead of one square `tx`: it can name a strip that |
| 10 | starts 8 px into a 16-px `SUB` cell, and it walks rectangular units. |
| 11 | Chroma map gained `(32,8)/(8,32)` (`Chroma16`), `(16,4)/(4,16)` (`Chroma8`) |
| 12 | and `(8,4)/(4,8)` (`ChromaRect8x4`). |
| 13 | - new `depth_to_tx_wh(bw, bh, depth)` -- libaom `depth_to_tx_size`: every |
| 14 | `sub_tx_size_map` entry halves the LONGER side of a rect and both sides of |
| 15 | a square, so a 1:4 strip's first split is still a 2:1 RECT unit |
| 16 | (`TX_32X8 -> TX_16X8`, `TX_64X16 -> TX_32X16`). Replaces the |
| 17 | `bw.min(bh) >> (depth - 1)` formula at BOTH 2:1 call sites; it is the same |
| 18 | root cause lane-rectchroma measured mis-tiling a depth-1 64x16 strip, fixed |
| 19 | once for every caller instead of per shape. |
| 20 | - new `tx_type_mode_row(mode, filter_intra)` -- the `fimode_to_intradir` row |
| 21 | rule main `1a89ed9` fixed inside `read_plane`, now also applied to |
| 22 | `decode_leaf_rect`'s rect luma coefficient read (same defect class, sibling |
| 23 | site found by sweeping every `cdfs.txb(<luma set>, mode)` call: the other |
| 24 | luma rect sets are `tx_size_sqr_up >= TX_32X32`, i.e. DCT-only, no symbol). |
| 25 | - **`decode_leaf_rect` read the wrong tx_size CDF category**: BLOCK_16X8 / |
| 26 | BLOCK_8X16 are `bsize_to_tx_size_cat == 1` (libaom |
| 27 | `bsize_to_tx_size_depth_table`), not the 2 the 32x16 strips use. Same |
| 28 | symbol count, different CDF row -- a wrong-table read of a real symbol. |
| 29 | - `decode_leaf_rect`'s split refusal is **lifted**: a 16x8/8x16 strip with |
| 30 | `tx_depth != 0` decodes per transform unit (TX_8X8 at depth 1, TX_4X4 at |
| 31 | depth 2). |
| 32 | - `Neighbours`: `record_mi_luma_rect`, `luma_skip_ctx_rect`, |
| 33 | `record_split_luma_rect_mi` (coarse mode/side cells stamped with |
| 34 | `div_ceil`, so an 8-px-tall strip stamps the cell it touches). |
| 35 | - `crates/ec-av1/src/stream.rs` |
| 36 | - `a_pinned_aomenc_16x8_strip_reads_its_use_filter_intra_flag` is now a PIXEL |
| 37 | COMPARE (was `expect_err`) and additionally asserts `sub16_split_hits > 0`: |
| 38 | it is the gate for the sub-16 split lift. |
| 39 | - the 32x32-level 1:4 gate gained a `--enable-tx-size-search=1` half of its |
| 40 | attempt window (cq 12..28), which keeps the 1:4 split refusals honest. |
| 41 | - `crates/ec-av1/src/refusal_inventory.rs` updated (one refusal removed, two |
| 42 | added). |
| 43 | |
| 44 | ## Refusals |
| 45 | |
| 46 | Lifted: "a HORZ/VERT intra strip below 16x16 with a split transform (per-unit |
| 47 | rect prediction is not ported)". |
| 48 | |
| 49 | Added (both MEASURED, not speculative): |
| 50 | - "a split intra strip whose transform unit is the rect {tx_w}x{tx_h} ..." -- |
| 51 | the per-unit RECT walk (depth 1 of a 1:4 strip) is implemented but mismatched |
| 52 | ffmpeg on the band fixture (8-bit, cq 12, seed 42), so it refuses instead of |
| 53 | shipping wrong pixels. |
| 54 | - "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma |
| 55 | coefficient tables ...)" -- shape guard for the next caller. |
| 56 | |
| 57 | Kept: "a 32x32-level 1:4 strip with a split transform (... depth={depth})". |
| 58 | Reason: depth 1 fires FIRST in every splitting attempt of the fixture, so no |
| 59 | attempt ever reaches a pixel-compared depth-2 strip -- a depth-2-only lift is |
| 60 | ungatable, and an ungated lift is not a lift (the tx64x16 r4 handoff predicted |
| 61 | exactly this interleaving). |
| 62 | |
| 63 | ## Gates |
| 64 | |
| 65 | - `a_pinned_aomenc_16x8_strip_reads_its_use_filter_intra_flag` -- **ok**. |
| 66 | EVIDENCE: crates/ec-av1/fixtures/filter_intra_8x16_strip_seed49.obu | cargo |
| 67 | test -p ec-av1 --lib -- a_pinned_aomenc_16x8_strip | whole frame Y+U+V equal |
| 68 | to ffmpeg, filter_intra_rect_sub16 hits 2 (was 1 under the truncated decode), |
| 69 | sub16_split_hits > 0. |
| 70 | - `a_real_aomenc_stream_with_a_32x32_level_1to4_partition_decodes_pixel_exact` |
| 71 | -- ok, now over 16 attempts per bit depth (8 with tx-size-search on). |
| 72 | 8-bit: 7 pixel-exact of 8 compared, 9 named refusals, horz_4=64, vert_4=72, |
| 73 | coded=136, 0 out-of-scope mismatches. |
| 74 | |
| 75 | ## Open residue (fix-now for the next round, all MEASURED) |
| 76 | |
| 77 | 1. `deferred(rect-unit defect)` -- the depth-1 RECT transform unit (TX_16X8 / |
| 78 | TX_32X16) mismatches ffmpeg; code is wired and refused by one `if tx_w != |
| 79 | tx_h` in `decode_rect_split`. Deleting that one line + the 1:4 caller's twin |
| 80 | is the whole re-lift. Reproduce: the 1:4 gate with the tx-search half and |
| 81 | the refusal removed, 8-bit cq 12 seed 42. |
| 82 | 2. `deferred(chroma defect behind the lifted refusal)` -- |
| 83 | `a_real_aomenc_stream_with_filter_intra_on_a_sub16_horz_vert_strip_decodes_pixel_exact` |
| 84 | now decodes seed 55 instead of refusing and mismatches on the **U plane** |
| 85 | only; `#[ignore]`d with that measurement. |
| 86 | 3. `deferred(same)` -- `a_directional_16x8_strip_reads_the_right_above_right_samples` |
| 87 | decodes now and mismatches LUMA at seed 700 cq 45 with 0 reaching strips; |
| 88 | `#[ignore]`d with that measurement. Class refusal-hides-a-defect: both are |
| 89 | defects the split refusal was covering, not regressions of this round. |
| 90 | |
| 91 | ## Films |
| 92 | |
| 93 | `decode_probe` (release), before -> after: |
| 94 | - reelb5.obu: "a 32x32-level 1:4 strip with a split transform (depth=2)" -> |
| 95 | **"a HORZ_A/HORZ_B/VERT_A partition below 16x16"** (another lane's refusal). |
| 96 | The 1:4 depth refusal is still in place, so what moved this film is the |
| 97 | sub-16 split lift plus the `tx_size_cat1` fix -- the extract's 1:4 strips are |
| 98 | reached and decoded (rect4_32: horz=4 coded=4) and the stream now runs on to |
| 99 | a partition shape nobody has ported. |
| 100 | EVIDENCE: reelb5.obu | cargo run --release --example decode_probe -- reelb5.obu | |
| 101 | refusal string changed, rect4_32 horz=4 vert=0 coded=4 |
| 102 | - hg-head.obu: "filter intra on a HORZ/VERT strip (this decoder predicts |
| 103 | square-only)" (unchanged, another lane). |
| 104 | - reelc-head.obu: "an intra block in an inter frame whose tx_depth splits its |
| 105 | luma transform (round 1)" (unchanged, another lane). |