lane-av1422warp: a 4:2:2 rect leaf's chroma dc-sign vote must sample chroma cells
Browse files at this commitcb5d22b0bd04fbc52d91e027cc18168c47c8bc6bParent: 3d97c321 changed file +22 -1
- crates/ec-av1/src/decode.rs +22 -1
crates/ec-av1/src/decode.rsmodified+22 -1
| @@ -13701,7 +13701,28 @@ fn decode_leaf_rect( | |||
| 13701 | } else { | 13701 | } else { |
| 13702 | TxbSet::ChromaRect8x4 | 13702 | TxbSet::ChromaRect8x4 |
| 13703 | }; | 13703 | }; |
| 13704 | - let around = neighbours.around_mi_rect(leaf_mi, bw, bh); | 13704 | + // lane-av1422warp: at ss (1,0) this leaf's chroma is a SQUARE |
| 13705 | + // (side/2, side) block, so `side` chroma 4-px cells above it spread | ||
| 13706 | + // over `side` LUMA mi columns -- one chroma column per PAIR of luma | ||
| 13707 | + // mi cells, and both carry the covering unit's whole-unit dc sign. | ||
| 13708 | + // The per-mi rect gather therefore double-counts every chroma | ||
| 13709 | + // column's sign. `around_mi_422_chroma`'s every-second above-cell | ||
| 13710 | + // sampling is libaom's `txb_w_unit` sum, and every other 4:2:2 chroma | ||
| 13711 | + // gather in this file already routes through it (see the gate at this | ||
| 13712 | + // arm's siblings); this one did not, so a 4:2:2 rect leaf voted over | ||
| 13713 | + // luma unit counts. Measured on the pinned 4:2:2 rotzoom stream | ||
| 13714 | + // (a1.obu frame 0): the 16x8 leaf at mi(48,28) resolved its V plane's | ||
| 13715 | + // dc sign from vote 0 (`dc_sign_cdf[0]`) where the oracle resolves a | ||
| 13716 | + // negative vote (`dc_sign_cdf[1]`), which is the first bit-position | ||
| 13717 | + // divergence in the frame (the bit offset is a clean constant through | ||
| 13718 | + // coefficient unit 1418 and turns 6 bits at 1419). Luma keeps the | ||
| 13719 | + // per-mi gather; 4:2:0 and 4:4:4 keep the plain rect walk verbatim. | ||
| 13720 | + let mut around = neighbours.around_mi_rect(leaf_mi, bw, bh); | ||
| 13721 | + if chroma_422 { | ||
| 13722 | + let c = neighbours.around_mi_422_chroma(leaf_mi, bw, bh); | ||
| 13723 | + around[1] = c[1]; | ||
| 13724 | + around[2] = c[2]; | ||
| 13725 | + } | ||
| 13705 | let luma_set = if reduced_tx_set { | 13726 | let luma_set = if reduced_tx_set { |
| 13706 | TxbSet::LumaRect16x8 | 13727 | TxbSet::LumaRect16x8 |
| 13707 | } else { | 13728 | } else { |