edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-av1-422 — 4:2:2 chroma behind the header refusal
Outcome
STOP with the refusal in place (stream.rs subsampling_x != subsampling_y, byte-identical to main).
Not pixel-exact yet: the bypassed-refusal probe still desyncs/pantes on the census fixture
(aomenc --profile=2, 256x144, 16 frames, testsrc2 422 y4m). Next wrong site named below.
Landed on this branch: the finished, provably 420/444-invariant slice of the class fix.
cargo check -p ec-av1 --all-targets: 0 warnings.
Fixture provenance
ffmpeg -f lavfi -i testsrc2=256x144:rate=30 -frames:v 16 -pix_fmt yuv422p /tmp/t422.y4maomenc --codec=av1 --profile=2 --obu -w 256 -h 144 --passes=1 --end-usage=q --cq-level=32 --cpu-used=3 --limit=16- Refusal string confirmed firing on main before any edit (decode_probe on the OBU).
- Oracle decode:
$HOME/.cache/aom-oracle/build/aomdec(I422 raw). ffmpeg 8.1.2 available; aomdec used as primary pixel oracle.
Class (confirmed against the aom oracle source, ~/.cache/aom-oracle/src)
At ss (1,0) chroma width halves, height does not. Sites assume either a single shared
ss for both axes or an ss==(0,0) ? 444 : 420 two-arm split, so 422 falls into the 420 arm.
Ground truth tables: av1_ss_size_lookup (common_data.c:17), is_chroma_reference
(av1_common_int.h:1454), av1_get_max_uv_txsize (blockd.h:1372).
Fixes landed (all keyed to reachability only at ss 1,0; 420/444 arms byte-identical)
decode_rect_splitchroma: square chroma rows (8,8)/(16,16)/(32,32) routed through the square reader via thechroma_tiledarm (libaom: chroma of a 16x8/32x16/64x32 luma strip is an 8x8/16x16/32x32 square). Includes 4:2:2 CFL strip support via the same path.decode_rect4_16_strip: (8,8) arm + 422 strips are their own chroma reference (ss_size_lookup[16X4][1][0]= BLOCK_8X4, per-strip, no 4:2:0 pair merge); also fixed almi.1 - 1underflow the 422 has_chroma change exposed.decode_leaf_rectchroma match: (16,16) and (8,32) rows.decode_block_rect4chroma match: (16,8) and (8,4) rows; the portrait-leaf unreachable now names the shape.cfl_ac_ss:cfl_luma_subsampling_422_lbd_cbranch (horizontal luma pairs, full height,(a+b) << 2), before the 4:2:0 square/rect helpers.mv_to_q4Y axis: 8 call sites passedss_x(fctx)for the row component — nowss_y(sub-8x8/inter chroma MC bilinear predict sites).has_chromafor 1:4 strip pairs (decode_rect4_16 + inter twin):i % 2 == 1 || ss_y == 0(is_chroma_reference's row-parity clause drops out when ss_y=0).CHROMA422_SQUARE_HITScounter (decode.rs): incremented only when a square chroma coefficient unit is read on a frame with ss (1,0); a restored/2 chroma heightdiverts 4:2:2 squares onto the rect rows and the counter reads 0. Accessorchroma422_square_hits(). No gate asserts it yet — the refusal still gates all 422 decode (deferred below).
Next wrong site (first blocker on the fixture, in parent's order)
decode_block (~line 16621 on this tree): the ss==(0,0) ? 444 : 420 tx-size arm. Its whole
chroma section walks cn x cn square chroma_tx units; at 4:2:2 a square luma block's chroma
is (side/2, side) — a RECT plane block (e.g. 8x16 for a 16x16 block) needing rect chroma sets
and a non-square unit walk. Same open class after it: decode_inter_block's square-chroma
arms (~31922/33422), film_grain.rs apply_grain (hardcoded 420 subblock halving), and the
1:4 portrait-leaf question — ss_size_lookup[BLOCK_8X32][1][0] is BLOCK_INVALID yet the
aomenc fixture carries 8x32 leaves that aomdec accepts, so the upstream desync (decode_block /
inter chroma) is still producing phantom partitions; that ordering must be re-checked once the
square-chroma sites land.
Deferred
- Refusal lift + witness gate (
chroma422_square_hits()+ pixel-exact vs aomdec/ffmpeg): deferred(until decode_block/inter square-chroma class lands and the probe is pixel-exact). Refusal stays; a lifted refusal with wrong pixels is a fail.