av1intrapred: intrabc TX4 leaf chroma predicts from the frame copy
Browse files at this commit3ab8e305a49e9b284cd765ddad40771f4dd81762Parent: 7fb533f2 changed files +35 -20
- crates/ec-av1/src/decode.rs +11 -0
- lanes/av1intrapred.report.md +24 -20
crates/ec-av1/src/decode.rsmodified+11 -0
| @@ -17050,6 +17050,17 @@ fn decode_leaf8( | ||
| 17050 | 17050 | Some((yb, _, _)) => Some(yb.clone()), |
| 17051 | 17051 | None => palette_y_buf, |
| 17052 | 17052 | }; |
| 17053 | + // lane-av1intrapred: the chroma twin of the `palette_y_buf` wrap above -- | |
| 17054 | + // `decode_block` does the same for its own `palette_uv_bufs` | |
| 17055 | + // (decode.rs's single-TU and multi-TU chroma reads). Without it, an | |
| 17056 | + // intrabc leaf whose var-tx tree split to TX_4X4 reached the TX4 arm's | |
| 17057 | + // chroma reads with the override unset: the unit predicted INTRA from | |
| 17058 | + // the UV mode (intrabc's is DC) instead of copying the frame at the DV, | |
| 17059 | + // R5 first differing pixel U(184,4), block mi (2,92). | |
| 17060 | + let palette_uv_bufs = match &intrabc_bufs { | |
| 17061 | + Some((_, ub, vb)) => Some((ub.clone(), vb.clone())), | |
| 17062 | + None => palette_uv_bufs, | |
| 17063 | + }; | |
| 17053 | 17064 | let (luma_grid, u_grid, v_grid); |
| 17054 | 17065 | if skip { |
| 17055 | 17066 | // lane-hgkf r2 (same shape as `decode_block`'s own skip branch): an |
lanes/av1intrapred.report.mdmodified+24 -20
| @@ -1,4 +1,4 @@ | ||
| 1 | -# lane-av1-intrapred — stop-report: first divergence is a chroma txb_skip CDF-content divergence at mi (36,66) plane 2, not intra prediction | |
| 1 | +# lane-av1-intrapred — r2: the chroma txb_skip CDF fork (intrabc TX4 chroma tx inheritance) and the intrabc chroma frame-copy prediction fork are FIXED; R5/W2 byte-exact | |
| 2 | 2 | |
| 3 | 3 | Base 7f863c5f (lane-av1-ibcvtx), worktree edith_codecs-av1intra, branch lane-av1-intrapred. |
| 4 | 4 | Tree left CLEAN (all temporary probes reverted; decode.rs/tile.rs byte-identical to base). No push. |
| @@ -71,7 +71,7 @@ which I could not complete within this run's budget. | ||
| 71 | 71 | |
| 72 | 72 | --- |
| 73 | 73 | |
| 74 | -# lane-av1-intrapred r2 — the reported CDF fork is FIXED; next fork is intrabc chroma prediction | |
| 74 | +# lane-av1-intrapred r2 — the reported CDF fork is FIXED; the follow-up intrabc chroma prediction fork is also FIXED | |
| 75 | 75 | |
| 76 | 76 | Base 3f6748d5, same worktree/branch. The reported "chroma txb_skip CDF-content" fork was |
| 77 | 77 | neither the Chroma4 defaults (all four q tables match aom `token_cdfs.h` exactly) nor the |
| @@ -117,24 +117,28 @@ adaptation — it was the missing `INTRABC_CHROMA_TX` arming in `decode_leaf8`'s | ||
| 117 | 117 | * Pre-fix non-vacuity: scratch worktree at 3f6748d5 rebuild reproduces the byte-352 fork |
| 118 | 118 | on W2 and byte-82216 on R5. |
| 119 | 119 | |
| 120 | -## Next fork (new class — NOT entropy, NOT the ticket's CDF fork) | |
| 120 | +## Next fork — FIXED in the same pass (r2b): intrabc chroma frame-copy prediction | |
| 121 | 121 | |
| 122 | 122 | `R5` first differing byte 231864 = chroma U pixel **(184,4)**; 3305 differing bytes, all |
| 123 | 123 | chroma (U 1730 / V 1575), origin unit = the chroma 4x4 at cpx (184,4), i.e. the 8x8 |
| 124 | -**intrabc** leaf at luma (368,8), mi **(2,92)**, var-tx TX4 split, luma TU (1,0) coded | |
| 125 | -`H_ADST`, TU (0,0) `DCT_DCT`, chroma inherits `DCT_DCT` on BOTH sides (ours: probe slot | |
| 126 | -`Some(DctDct)`; aom: `EC_TXTYPE mi=2,92 plane=1 tx_type=0`). The full symbol stream is | |
| 127 | -aligned (3321/3321 `all_zero` reads, rng-identical), luma is byte-exact, so this is a | |
| 128 | -**prediction-stage** divergence: the intrabc chroma frame-copy (bilinear at the chroma | |
| 129 | -half-pel phase of the block DV) produces different samples than aomdec for this unit and | |
| 130 | -everything predicted off it. Trace line: | |
| 131 | - | |
| 132 | -``` | |
| 133 | -R5: ours U(184,4)=[103,97,107,101] aom=[86,116,55,110]; entropy identical | |
| 134 | - (read 2428 U / 2429 V of block mi (2,92) match through their coefficients); | |
| 135 | - suspect the chroma DV rounding/clamp in the leaf8 intrabc_bufs path | |
| 136 | - (mv_to_q4(cpx, dv_col, false) — odd-DV chroma phase) vs libaom's | |
| 137 | - av1_predict_intra_block intrabc clamp. | |
| 138 | -``` | |
| 139 | - | |
| 140 | -W2 shows the same signature (first diff U(168,4), byte 231848). | |
| 124 | +**intrabc** leaf at luma (368,8), mi **(2,92)**, var-tx TX4 split. Entropy was fully | |
| 125 | +aligned (3321/3321 `all_zero` reads rng-identical, luma byte-exact), the DV matched | |
| 126 | +exactly (`EC_DV mi_row=2 mi_col=92 dv_col=-2560 dv_row=0`, same as aom's `mv0=(0,-2560)`, | |
| 127 | +source = integer-phase copy of U(24,4)), so the divergence was prediction-stage: the TX4 | |
| 128 | +arm's chroma reads override the intra prediction through `palette_uv_bufs`, but only | |
| 129 | +`decode_block` wrapped that pair with the leaf's `intrabc_bufs` frame-copy buffers | |
| 130 | +(decode.rs:15833) — `decode_leaf8` wrapped only `palette_y_buf` (lane-t900 r32), so an | |
| 131 | +intrabc TX4 leaf's chroma predicted INTRA from the UV mode (intrabc's is DC) instead of | |
| 132 | +copying the frame at the DV. | |
| 133 | + | |
| 134 | +**Fix (r2b, third hunk):** `decode_leaf8` wraps `palette_uv_bufs` with `intrabc_bufs`'s | |
| 135 | +`ub`/`vb` right after the `palette_y_buf` wrap — the chroma twin of decode.rs:15833. | |
| 136 | + | |
| 137 | +**Gates after r2b (all machine-captured):** | |
| 138 | + | |
| 139 | +* R5: **byte-exact vs aomdec AND ffmpeg** (the stop report's primary gate). | |
| 140 | +* W2 (cq8 re-encode): **byte-exact vs aomdec**. | |
| 141 | +* R9: byte-exact vs ffmpeg (regression clean). | |
| 142 | +* Cached-fixture sweep A1/A2/A3/D1/D2/D3: byte-exact vs their ffmpeg raws. | |
| 143 | +* Targeted tests (intrabc/lossless/screen filters): 14 passed, 0 failed. Full suite on | |
| 144 | + the r2 fix alone: 607 passed / 0 failed (exit 0). |