forge
Explore
Log in

Don't you dare go Hollow

The chroma-inherits-luma-tx_type finding and the three refuted hypotheses

Browse files at this commit

7971d3434195a2df15af58948ab99adc989b6c91Ahmet Kaan GümüşParent: 25e26f3
  • docs
    • the chroma-inherits-luma-tx_type finding and the three refuted hypotheses
Show full message
docs(txrd): the chroma-inherits-luma-tx_type finding and the three refuted hypotheses
lanes/txrd.report.mdadded+75 -0
@@ -0,0 +1,75 @@
1+# lane-txrd -- why the unconditional transform-type search collapsed
2+
3+Branch `lane-txrd` off `01fa1fd5`. Predecessors: `lanes/txset.report.md`
4+(intra 5-type set), `lanes/txset2.report.md` (inter `DCT_IDTX`), both of
5+which shipped their search SCREEN-GATED because turning it on for all
6+content lost ~20 BD points on the two synthetic bars rows.
7+
8+## The finding
9+
10+The type search was never mispriced. **An inter block's chroma transform
11+type is not coded: the decoder derives it from the LUMA type at the block's
12+chroma-reference position** (spec 5.11.40, libaom `av1_get_tx_type`; our own
13+reader does it at `decode.rs:18234`, `reduce_inherited_chroma_tx_type`).
14+The encoder produced its chroma levels under a `DCT_DCT` basis whatever the
15+luma type search chose, so every non-`DCT_DCT` luma winner had its chroma
16+levels inverse-transformed on a basis they were never made for.
17+
18+Per-plane PSNR, bars 1080p, q=60, control vs the unconditional arm
19+(`EC_AV1_FRAME_PSNR=1`, frames 0..11):
20+
21+| plane | control frame 1..11 | unconditional arm |
22+|---|---|---|
23+| Y | 53.66 53.44 53.30 53.24 ... | **53.70 53.52 53.40 53.32 ...** (BETTER) |
24+| U | 51.97 51.89 51.78 51.55 ... | 49.15 48.19 47.74 47.57 ... |
25+| V | 52.52 52.35 52.25 52.14 ... | **45.53 44.19 44.16 42.82 ...** (-7 dB) |
26+
27+Luma is better on every frame -- the search's own win is real -- and the
28+all-plane mean the gate ranks on (`psnr_all` concatenates Y, U and V) reads
29+53.13 -> 50.20. Class `metric blind to a plane`, on top of
30+`parsed then discarded` / `override slot on one arm`: a decoder-DERIVED
31+field the encoder never mirrored.
32+
33+## The three chartered hypotheses, all refuted first
34+
35+1. **RDOQ's transform-domain distortion / typed gain.** The forward-inverse
36+ gain was MEASURED per type and size (`alpha = <res, rec> / <res, res>` at
37+ q_idx 20): 0.977 .. 1.030 over all sixteen types at 4/8/16 and both types
38+ at 32. No type is mis-scaled, so the `(coeff - level*q)/8` model is as
39+ valid for `IDTX` and the ADST kernels as for `DCT_DCT`.
40+2. **The rate term.** `EC_AV1_TXRD_LAMBDA=0` (types compared on
41+ reconstruction error alone, rate weight zero) reproduces the collapse to
42+ the digit: bars 1080p +24.2/+4.2 against the arm's +23.1/+3.3 and the
43+ control's -1.0/-16.8. A rate-term calibration cannot be the cause of a
44+ loss that survives the rate term being switched off.
45+3. **The loop filters.** Pre-filter frame luma SSE (`EC_PREFILTER`) is LOWER
46+ in the arm on every frame at every quantizer (q=60 leaves: 26.02M vs the
47+ control's 26.21M), and so is the post-filter one (25.47M vs 25.60M). The
48+ filters were never the loss; the loss was in a plane nobody was reading.
49+
50+The census also showed the chosen types dominating the `DCT_DCT` trial on
51+BOTH terms (sse -5.5%, priced bits -19.1%) -- which is what a defect that
52+lives outside luma looks like from inside the luma search.
53+
54+## The fix
55+
56+`encode::recode_inter_chroma`: once `commit_inter_luma` has chosen the
57+block's luma type, the two chroma planes are re-coded at
58+`reduce_inherited_chroma_tx_type(luma_type, chroma_w, chroma_h)` -- the
59+decoder's own rule -- before they are committed. Wired at all three inter
60+commit sites that can carry a non-`DCT_DCT` luma type (the `code_square_inter`
61+winner and its intra-vs-inter tail, and `search_inter_block`'s 32x32 path);
62+a split block hands over `luma_tx_types[0]`, the top-left unit, which is the
63+position `xd->tx_type_map` is indexed at. An OBMC/warp winner commits the
64+flat trial with no type search, so its `luma_tx_types` is empty and nothing
65+is re-coded.
66+
67+SWEEP (same shape elsewhere): intra chroma derives its type from the UV MODE,
68+not from luma (`Intra_Mode_To_Tx_Type`), and the encoder already codes it that
69+way -- so the intra 5-type search of lane-txset is NOT affected. The only
70+other inheritance is intrabc's (`fctx.intrabc_chroma_tx`), whose luma type is
71+always `DCT_DCT` in this encoder.
72+
73+## Gates
74+
75+See the table appended below; the arms are running at the time of writing.