edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-av1-422m — the (4, 32) refusal is replaced by libaom's TX_4X4 chunking for
that one shape; the header refusal STAYS (the stream's next stop is a
different class, the intra-in-inter 64x64 chroma (32, 64) panic)
Outcome
read_inter_rect_chromano longer refuses (4, 32): an 8x32 luma block's 4:2:2 chroma plane now codes as EIGHT TX_4X4 chunks per plane, exactly the chunking libaom's decoder performs for a plane whosess_size_lookupentry is BLOCK_INVALID. 4:2:0 and 4:4:4 are bit-identical by construction (the arm gates on ss (1,0) AND write rect exactly (4, 32) — impossible at any other format).- The header refusal is NOT deleted: with the chunking in, the 16-frame stream decodes PAST the previously refusing block and stops at a NEW hole owned by another lane — the intra-in-inter 64x64 chroma arm reads its whole (32, 64) plane as ONE unit and trips the rect-coeff scratch bound. The delete condition (16-frame pixel-exact vs aomdec) is unmet, so the refusal stays.
The chunking mechanism (measured against the pinned oracle, ~/.cache/aom-oracle/src)
av1_ss_size_lookup[BLOCK_8X32][1][0] = BLOCK_INVALID(av1/common/common_data.c:38): an 8x32 luma block HAS no 4:2:2 plane residual block; no TX_4X32 exists either.decode_token_recon_block's inter residual loop (av1/decoder/decodeframe.c:1022) still walks the plane inget_vartx_max_txsizeunits.get_vartx_max_txsize(av1/common/blockd.h:1447) doesmax_txsize_rect_lookup[plane_bsize]withplane_bsize == BLOCK_INVALID— one element PAST the 22-entry table. The oracle build is Release (CMakeCache.txt:CMAKE_BUILD_TYPE=Release, asserts compiled out), and the table's adjacent neighbour in declaration order isvtx_tab, whose first entryDCT_1D = 0 = TX_4X4. So the chroma max tx size resolves to TX_4X4.decode_reconstruct_tx(decodeframe.c:303) NEVER recurses for chroma (if (tx_size == plane_tx_size || plane)), so every chroma unit reads at TX_4X4: the 4x32 plane codes as 8 stacked 4x4 coefficient units.- Empirical proof the chunking matches the bitstream: the same fixture bytes
(sha256
d3fa4beeb1309033e4a03f5ae5c431c8fa8386ba1ada088684710423c7938129) stopped at the (4, 32) refusal before the change; after it, decode consumes that block's chroma and reaches the LATER intra-arm panic below — entropy stayed consistent across the chunked units.
The fix (scoped to the one shape)
read_inter_rect_chroma (decode.rs): when ss is (1, 0) and the write rect
is exactly (4, 32), chunk into (4, 4) units — the existing multi-unit loop
then stamps per-unit chroma neighbour contexts, embeds into the square-stride
grid, and returns the per-unit list for the tail's re-stamp, unchanged. Each
unit reads TxbSet::Chroma4 / default_scan(4) (the lane-av1-422j rows) and
inherits NO tx_type (av1_get_tx_type returns DCT_DCT for
tx_size == TX_4X4, blockd.h), so inherit_tx_type is None for these
units.
Counter CHROMA422_CHUNK_HITS (+ chroma422_chunk_hits(), printed by
decode_probe as chroma422_chunk:): one hit per TX_4X4 chunk unit read; a
4:2:0/4:4:4 frame cannot increment it. On the current fixture the probe
panics at the later stop before report() prints, so the number is not yet
exercised on a full decode; the units demonstrably ran (frontier evidence
above).
Next stop named (NOT fixed — another shape, another lane's arm)
decode_inter_block's INTRA arm (lane-av1-422k's
read_rect_chroma_unit call, decode.rs:35166/35208) codes a 64x64 intra
block's 4:2:2 chroma plane as ONE (32, 64) unit with TxbSet::Chroma32:
thread 'main' panicked at crates/ec-av1/src/decode.rs:7195:9:
rect coeff scratch w=32 h=64 n=2448
libaom chunks that plane too: the intra residual walk
(read_coeffs_and_intra, decodeframe.c) steps av1_get_tx_size units, and
av1_get_max_uv_txsize(BLOCK_64X64, 1, 0) =
av1_get_adjusted_tx_size(TX_32X64) = TX_32X32 (blockd.h:1361), i.e.
two 32x32 units per plane. Lifting it means re-plumbing the k lane's
whole-plane arm into a per-unit walk (set rows, per-unit around_mi_422_chroma
contexts, restamp) — that is the intra 4:2:2 chroma lane's territory, and the
(4, 32) inter shape this ticket owns is done.
Verification
cargo check -p ec-av1 --all-targets(target dir~/.cache/cargo-target-av1422m): 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. - Header refusal restored byte-identical after the probe bypass
(
stream.rsrefusal block untouched); default 4:2:2 refusal fires as before. - Oracle decode reference for the fixture:
$HOME/.cache/aom-oracle/build/ aomdec→ 16 shown frames (I422 y4m). - Untouched: the 4:2:0 group-tail chroma SKIP arm, the k lane's
read_rect_chroma_unitarms,rect_inter_chroma_set's tables (no new row; the (4, 32) refusal arm stays for any FUTURE unchunked arrival).
State
- Commit on lane-av1-422m (no push): the chunking + counter + probe print + this report.
- No table row added. The header refusal stands.