diff --git a/crates/ec-av1/src/decode.rs b/crates/ec-av1/src/decode.rs index 4a469423..afc04d90 100644 --- a/crates/ec-av1/src/decode.rs +++ b/crates/ec-av1/src/decode.rs @@ -22767,25 +22767,29 @@ fn read_inter_rect_chroma( fctx: &crate::decode::FrameCtx, ) -> Result<(Grid, Grid, Vec<((usize, usize), usize, Grid, usize, usize)>)> { let (uw, uh) = (write_chroma_w.min(32), write_chroma_h.min(32)); - // lane-av1-422m: an 8x32 luma block HAS no 4:2:2 plane residual block -- - // `av1_ss_size_lookup[BLOCK_8X32][1][0]` is BLOCK_INVALID - // (`av1/common/common_data.c:38`) -- so libaom never codes its chroma as - // a (4, 32) unit, and no such coefficient set exists (no TX_4X32 - // either). The plane is still coded, CHUNKED at luma-granular TX_4X4: - // `decode_token_recon_block` (`decodeframe.c:1022`) steps the plane in - // `get_vartx_max_txsize` units, where the `BLOCK_INVALID` plane size - // indexes `max_txsize_rect_lookup` one past its end and in the pinned - // release build reads the adjacent `vtx_tab[0]` = DCT_1D = 0 = TX_4X4; - // `decode_reconstruct_tx`'s `if (tx_size == plane_tx_size || plane)` - // never recurses for chroma, so every unit reads at TX_4X4. Chunk the - // same way: 8 units per plane over the 4x32 chroma plane. TX_4X4 units - // also never inherit a tx_type (`av1_get_tx_type` returns DCT_DCT for - // `tx_size == TX_4X4`, blockd.h), so the inherited luma type is dropped. + // lane-av1-422m, CORRECTED lane-av1-422n: an 8x32 luma block HAS no + // 4:2:2 plane residual block -- `av1_ss_size_lookup[BLOCK_8X32][1][0]` + // is BLOCK_INVALID (= 255, blockd.h) -- so libaom never codes its chroma + // as a (4, 32) unit, and no such coefficient set exists (no TX_4X32 + // either). The plane is still coded, CHUNKED: `decode_token_recon_block` + // (`decodeframe.c:1022`) steps the plane in `get_vartx_max_txsize` + // units, where the `BLOCK_INVALID` plane size indexes + // `max_txsize_rect_lookup` OUT OF BOUNDS and the byte read there in the + // pinned Release oracle build is TX_4X8 -- the committed + // "adjacent `vtx_tab[0]` = TX_4X4" reading was wrong (reviewer FAIL on + // e24dc84b). `decode_reconstruct_tx`'s + // `if (tx_size == plane_tx_size || plane)` never recurses for chroma, so + // every unit reads at TX_4X8: FOUR stacked 4x8 units per plane over the + // 4x32 chroma plane. The units KEEP a tx type: `av1_get_tx_type` + // (blockd.h) has no TX_4X4 early-out -- it derives from the block's + // inherited luma type reduced into the TX_4X8 ext-tx set + // (`reduce_inherited_chroma_tx_type`), exactly like every other rect + // unit here, so the 4:2:2 drop-the-type special case is gone. let invalid_ss_plane = ss_x(fctx) == 1 && ss_y(fctx) == 0 && (write_chroma_w, write_chroma_h) == (4, 32); - let (uw, uh) = if invalid_ss_plane { (4, 4) } else { (uw, uh) }; - let inherit_tx_type = if invalid_ss_plane { None } else { Some(luma_tx_type) }; + let (uw, uh) = if invalid_ss_plane { (4, 8) } else { (uw, uh) }; + let inherit_tx_type = Some(luma_tx_type); let (nx, ny) = (write_chroma_w / uw, write_chroma_h / uh); let multi = nx * ny > 1; let set = rect_inter_chroma_set(uw, uh)?; diff --git a/lanes/av1422n.report.md b/lanes/av1422n.report.md new file mode 100644 index 00000000..ad968aed --- /dev/null +++ b/lanes/av1422n.report.md @@ -0,0 +1,74 @@ +# lane-av1-422n — e24dc84b's (4, 32) chunk is corrected from eight TX_4X4 to +# FOUR TX_4X8 units; the header refusal STAYS (the stream is not pixel-exact +# and stops at the (2, 16) rect-pair chroma shape) + +## Outcome + +1. `read_inter_rect_chroma`'s invalid-ss-size arm now chunks the (4, 32) + 4:2:2 chroma plane of an 8x32 luma block into FOUR TX_4X8 units per plane + (a 1x4 grid: 4 wide, 8 tall each). The committed eight-TX_4X4 chunking + was wrong: reviewer FAIL on e24dc84b. `BLOCK_INVALID` is 255, and the + out-of-bounds byte `get_vartx_max_txsize` reads from + `max_txsize_rect_lookup` in the pinned Release oracle build is TX_4X8 — + not the "adjacent `vtx_tab[0]` = TX_4X4" the m report claimed. +2. The units KEEP a tx type: `av1_get_tx_type` (blockd.h) has no TX_4X4 + early-out, so the m lane's `inherit_tx_type = None` special case is gone. + The units derive the type from the block's luma type through + `reduce_inherited_chroma_tx_type` into the TX_4X8 ext-tx set, exactly + like every other rect unit on this path. `(4, 8)` resolves through the + existing `rect_inter_chroma_set` row `(8, 4) | (4, 8) => ChromaRect8x4`; + no table row was added, and the (4, 32) refusal arm below it stays. +3. The (32, 64) intra chroma edit made earlier this session was REVERTED + per instruction before the chunk fix; the intra arm is byte-identical to + e24dc84b. 4:2:0 paths untouched. + +## Counter (first real exercise of `CHROMA422_CHUNK_HITS`) + +With the header refusal temporarily bypassed (probe only, restored +byte-identical — see below), the fixture walks 32 TX_4X8 chunk units +(`CHROMA422_CHUNK_HITS`, instrumented per unit) before the next stop. The +m report's count never printed because the probe panicked first; with the +corrected chunking the units demonstrably run. + +## Frontier (NOT fixed — another shape, another lane's arm) + +`decode_rect4_16_strip`'s closed chroma-shape set (`decode.rs:14902`) has no +`(2, 16)` row: a 4x16 luma pair's 4:2:2 chroma plane arrives there and hits +the `unreachable!`. The probe decodes frame 1 and stops early in frame 2, +after the 32 TX_4X8 units. The (32, 64) intra scratch panic did NOT +reproduce on this walk — this stop precedes it. + +## Pixels — delete condition unmet, refusal STAYS + +- Frame 1 (keyframe): luma byte-exact vs `aomdec` (oracle: 16 shown I422 + frames); U/V diverge from chroma (23, 0) on — a pre-existing keyframe + 4:2:2 chroma gap present at e24dc84b too (frame 1 decodes through + `decode_block`, which neither `read_inter_rect_chroma` nor the intra arm + touches). +- Frames 2+ are not comparable (the frame-2 stop above). +- The 16-frame pixel-exact + counter delete condition is unmet, so the + header refusal stands untouched. + +## Verification + +- `cargo check -p ec-av1 --all-targets` (target dir + `~/.cache/cargo-target-av1422n`): **0 warnings**. +- 420 gate green under `EC_AV1_REQUIRE_AOMENC=1`: + `a_real_aomenc_stream_with_a_skipped_8x8_intra_leaf_whose_tx_split_decodes_ + pixel_exact`: 1 passed, 0 failed. +- Probe bypass reverted: `git diff` after the run shows ONLY + `crates/ec-av1/src/decode.rs` (the chunk fix + comment rewrite); the + default 4:2:2 refusal fires as before (`REFUSED: unsupported: ... 4:2:2 + ...`). +- Oracle reference: `$HOME/.cache/aom-oracle/build/aomdec` on the fixture + (sha256 `d3fa4beeb1309033e4a03f5ae5c431c8fa8386ba1ada088684710423c7938129`) + → 16 shown frames. +- Untouched: the (4, 32) refusal arm in `rect_inter_chroma_set`, the 4:2:0 + group-tail chroma SKIP arm, the k lane's `read_rect_chroma_unit` arms, + `decode_probe.rs` (byte-identical to e24dc84b). + +## State + +- Commit on lane-av1-422n (no push): the corrected chunking + this report. +- Next stop named for the owning lane: `decode_rect4_16_strip` chroma shape + `(2, 16)`.