edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-av1-422f — square-block chroma is the plane block's own rect unit; refusal stays
Outcome
STOP with the 4:2:2 header refusal in place, byte-identical (probe refuses
without the env; the local bypass was reverted before commit). The
square-block path (decode.rs's (luma_set, chroma_set, luma_tx, chroma_tx, scans) selection, formerly 16704-16721) now models av1_get_max_uv_txsize
as av1_get_adjusted_tx_size(max_txsize_rect_lookup[plane_bsize]) — the RECT
that fills the (side/2, side) plane block — and all three chroma walks read
one (chroma_tx, chroma_tx_h) unit per grid cell, keyed on ss (1,0). The
av1422e first miss (mi(4,4) side 16: ours two 8x8 units, oracle one TX_8X16)
is gone, and the decode now aligns with the oracle unit-for-unit through 117
coefficient units — every 16x16 block's U/V TX_8X16 pair, every 8x8 leaf's
U/V TX_4X8 pair, every 16x8 strip's 8x8-square chroma — with equal entry rngs
wherever ours prints them. The stream is not pixel-exact: the next divergence
is the sub-8x8 4x4-leaf chroma at 4:2:2 (TX_4X4 units, one per even-column
leaf), which lives in decode_leaf_split4/decode_leaf8 — other lanes — so
the refusal is retained.
Change (decode.rs + decode_probe.rs only)
- Selection arm at ss (1,0): per-axis unit dims
chroma_tx(width) xchroma_tx_h(height) — 4 -> (4,4), 8 -> (4,8), 16 -> (8,16), 32 -> (16,32), 64/128 -> (32,32) — with the unit's TxbSet/scan:ChromaRect8x4+SCAN_4X8,ChromaRect16x8+SCAN_8X16,ChromaRect32x16+SCAN_16X32,Chroma32+scan32. The destructure gainschroma_tx_h; 4:2:0/4:4:4/lossless arms carrychroma_txtwice, so their walks are untouched. - New
read_rect_chroma_unit: one rect chroma unit via theread_coeffs_rectroute (thechroma_tiledarm's andleaf8_chroma422_unit's proven shape):txb_skip_ctx= above+left in the offset-7 rows (the unit covers the plane block exactly, so no +3), the mode-derived defaulttx_typeunlessINTRABC_CHROMA_TXis armed, theside >= 32DCT_DCT clamp,dequant_and_inverse_typed_wh+push_intra_rect. Bumps the newCHROMA422_RECT_HITSwitness counter (keyed ss (1,0), unit w != h). - New
push_intra_unit:push_intrawhen square,push_intra_rectwhen rect — used by the skip walk. - All three chroma walks (skip, single-TU, chunked) key on the per-axis
unit dims:
cn_rows = chroma_height / chroma_tx_h,luma_span_y = chroma_tx_h << ss_y, per-axis cu positions and palette windows. Below side 64 a 4:2:2 frame's grid is 1x1 and the one unit is the whole plane block. The chunked walk's edge clip computesmax_units_hper axis at ss (1,0) (the shared halved formula assumes a subsampled height and would clip units libaom codes); the shared rows stay for 4:2:0/4:4:4. - New
Neighbours::around_mi_422_chromafor the square path's chroma context reads: libaomget_txb_ctx_generalsums its dc-sign votes overtxb_w_unitCHROMA 4-px cells, and at ss_x 1 one chroma cell spans TWO luma mi columns — the per-luma-mi sum double-counts the above votes and flipsdc_sign_ctxwhen the above and left votes have opposite signs (measured at mi(4,4) plane 1: ours readdc_sign_cdf[1], the oracle row 0). Sampling every second above cell counts each chroma column once, which is exactly libaom's sum; the level booleans are ORs over duplicated cells and cannot change. Used by the single-TU walk's rect branch and both multi-unit loops at ss (1,0) only; 4:2:0/4:4:4 keeparound_mi_rect. examples/decode_probe.rs: printschroma422_rect.
Untouched: decode_leaf8, decode_leaf_split4, decode_rect4_16_strip,
decode_block_128rect, decode_rect_split, the resize header reader, the
frame-9 filter path, and refusal_inventory.rs (the refusal string is
byte-identical; the gate stays green).
Measurement
Fixture /tmp/t422.obu, sha256
d3fa4beeb1309033e4a03f5ae5c431c8fa8386ba1ada088684710423c7938129 (reused by
hash, 256x144, 22 frames). Oracle $HOME/.cache/aom-oracle/build/aomdec
EC_TRACE=1 EC_TRACE_MODE_STEP=1 EC_TRACE_COEFF=1; ours decode_probe
(debug, gate-counters, private target dir) with a LOCAL
EC_AV1_ALLOW_422_PROBE env-gated bypass at the stream.rs refusal —
reverted before commit, and the refusal re-proven to fire without the env.
- Unit-level: 117 consecutive units with equal ENTRY rngs (rect reads print
entry=; the first entry mismatch is unit #117), identical unit order and shapes: 16x16 blocks read ONE TX_8X16 per plane (mi(4,4): U entry 44042, all_zero ctx row 2 = libaom ctx 9, post-rng 36040, eob 3 — the av1422e first miss, now exact), 8x8 leaves ONE TX_4X8 per plane, 16x8 strips the 8x8 square, 8x16 strips 4x16. - Symbol-level: the deduplicated rng trajectories match value-for-value through the mi(8,0) leaf's V (ours state 1100), modulo four oracle-instrumentation print gaps (sub-reads libaom's patched print does not emit; the trajectories re-align around each).
- Counters:
chroma422_rect: 28,chroma422_square: 23— 28 rect chroma units ran on the 4:2:2 frame (a 4:2:0/4:4:4 frame cannot increment it; the counter reads 0 under the old square model).
First remaining divergence (named next site, with oracle evidence)
At the 8x8 sub8 group whose leaves sit at mi(8,10)/(8,11)/(9,10)/(9,11): the
oracle's 4x4 LEAVES at even mi columns are chroma references at 4:2:2 and
each codes a TX_4X4 chroma unit (mi(9,10) plane 1, 38 steps, after only its
own luma) — ss_size_lookup[BLOCK_4X4][1][0] is BLOCK_4X4, so the 2x4 plane
rounds up and reads as TX_4X4. Ours reads the leaf's second luma TX_4X4 as
all-zero where the oracle codes coefficients (oracle 16 steps, ours 1), the
first value-level divergence, and everything after is desynced; the run then
ends at decode_rect4_16_strip's closed-shape panic (shape-driven, reached
by the same partition walk). Both sites live in decode_leaf_split4 /
decode_leaf8 / decode_rect4_16_strip — other lanes. The sub-8x8 4:2:2
model needs the is_chroma_ref rule !(mi_col & ss_x) (every even-column
leaf, not 4:2:0's single bottom-right leaf) plus the TX_4X4 chroma shape.
State
- Refusal
a chroma format of 4:2:2 (subsampling_x != subsampling_y)...byte-identical (bypass reverted;git difftouches only decode.rs and decode_probe.rs; probe refuses without the env). cargo check -p ec-av1(private target dir$HOME/.cache/cargo-target-av1422f): 0 warnings.- 420 gates green:
a_real_aomenc_stream_with_a_skipped_8x8_intra_leaf_ whose_tx_split_decodes_pixel_exact+ its 10-bit twin — 2/2 pass (the new arms are unreachable at 420 by their ss condition;chroma_tx == chroma_tx_hon every 4:2:0/4:4:4 path). Refusal gatea_non_420_subsampled_sequence_header_is_refused_by_namegreen. - No push. Traces left at /tmp/ours422f.txt and /tmp/oracle422.txt.