forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

av1422b.report.md5.0 KiBHistoryRawDownload

lane-av1-422b — decode_block square-chroma walk (4:2:2, refusal still up)

Outcome

STOP with the refusal in place (stream.rs subsampling_x != subsampling_y, byte-identical to main — restored before the commit; no bypass committed). Not pixel-exact yet: the bypassed-refusal probe desyncs INSIDE the first 16x16 PARTITION_HORZ_A of frame 0, before decode_block's own chroma walk is ever reached. Next wrong site named below.

Landed (all keyed to reachability only at ss (1,0); 420/444 arms unchanged)

  1. decode_block tx-size arm: new 4:2:2 branch — the uv plane block is (side/2, side) (ss_size_lookup[..][1][0]), so av1_get_max_uv_txsize is the SQUARE transform of the smaller dimension capped at TX_32X32: 4→TX_4X4 (2x4 rounds to BLOCK_4X4), 8→TX_4X4, 16→TX_8X8, 32→TX_16X16, 64→TX_32X32, 128→TX_32X32 (BLOCK_64X128 adjusts TX_64X64 down). Units stay square; the unit GRID is (side/2)/tx wide by side/tx tall — never square above a 4x4 luma block.
  2. All three chroma walks in decode_block (skip arm, single-luma-TU arm, multi-TU mu-chunk arm) generalized from square cn x cn to cn_cols x cn_rows; each unit's luma anchor split per axis (chroma_tx << ss_x wide, chroma_tx << ss_y tall): around_mi_rect, tu_reach_rect (new helper; keeps the square mismatch counter semantics), record_mi_chroma(cu_mi, span_x, span_y, ...), units tuples widened to carry both spans.
  3. intrabc chroma prediction buffers sized chroma_side x chroma_height.
  4. TxbSet::Chroma8/Chroma16 txb_skip tables widened to six rows: rows 3..6 are av1_default_txb_skip_cdfs[q][TX_8X8/16X16][10..13] (get_txb_ctx's +10 rows; neutral 16384 in libaom — its encoder never reaches them at 4:2:0/4:4:4, a 4:2:2 plane block larger than an 8x8/16x16 transform does). Mirrors the existing TXB_SKIP_CHROMA_4_BIG/ CHROMA_32_BIG assembly. Unused rows are never adapted, so 420/444 CDF adaptation is unchanged.
  5. chroma422_square_hits() made pub and printed by examples/decode_probe.rs (like every other capability counter) for the witness gate later.
  6. EC_PART/EC_PART_VAL traces behind EC_TRACE at the 64/32/16/8-level partition symbol reads, byte-format-matched to the oracle aomdec's own trace (same instrumented-oracle pairing the file already uses elsewhere).

Measurement (local bypass, NOT committed)

Fixture: ffmpeg testsrc2 256x144 yuv422p → aomenc --profile=2 --obu -w 256 -h 144 --passes=1 --end-usage=q --cq-level=32 --cpu-used=3 --limit=16 (sha256 d3fa4beeb1309033e4a03f5ae5c431c8fa8386ba1ada088684710423c7938129); oracle aomdec --rawvideo (I422).

  • With the refusal bypassed, decode_block's new arm runs and the pre-existing txb_skip[3] panic is gone (the widening in 4 fixes it).
  • Desync localization via EC_TRACE=1 partition pairing: every partition symbol pairs rng-for-rng with the oracle through the 64→32 split and the FIRST 16x16 ((0,0) value 4 = HORZ_A, rng 57096→45060→49312 identical). The oracle's NEXT 16-level read is (0,4) at tell 1079; ours is the second quadrant at tell 700 — the divergence is inside HORZ_A's own pieces: the two 8x8 leaves (decode_leaf8, whose chroma at 4:2:2 is 4x8 = two TX_4X4 units per plane) and/or the 16x8 bottom strip (decode_rect_split's chroma_tiled (8,8) arm — its EC_RECTCHROMA_GAP luma=16x8 tx=8x8 chroma=8x8 diagnostic fires right before the panic point).

The 8x32/32x64 leaf note, resolved against the oracle source

av1_ss_size_lookup[..][1][0] (common_data.c:17): 16X4→8X4 VALID, 32X8→16X8 VALID, 64X16→32X16 VALID, but 4X16, 8X32, 16X64 (the TALL 1:4 shapes) are BLOCK_INVALID at 4:2:2. libaom's ENCODER disables exactly those: partition_search.c (part4_search_allowed) requires get_plane_block_size(subsize, ss_x, ss_y) != BLOCK_INVALID before a HORZ_4/ VERT_4 may be coded. So aomenc never writes tall 1:4 leaves at 4:2:2 — the 4x16 leaf our decoder tripped on (EC_RECTCHROMA_GAP then the closed-shape unreachable in decode_rect4_16_strip) is a phantom partition produced by the upstream desync above, not a missing portrait block size. Nothing invented; the shape guard stays closed.

Next wrong site

decode_rect_split's chroma_tiled square-chroma arm for 16x8 strips and decode_leaf8's 4x8 chroma (first HORZ_A pieces) — re-check those against the oracle's EC_COEFF pairing before re-touching decode_block's walk.

Gates

  • a_real_aomenc_128x128_none_inter_blocks_coded_chroma_per_mu_chunk_decodes_ pixel_exact (420): PASS.
  • a_non_420_subsampled_sequence_header_is_refused_by_name (422 refusal + 420 control): PASS.
  • 444 check: aomenc --profile=1 testsrc2 256x144 through decode_probe byte-compares IDENTICALLY at clean 5674d2c5 and with this diff (first diff at char 50689 on both — pre-existing branch behavior against this quick oracle recipe, not touched by this slice; the merged-main 444 gate c3c67f17 is not on this branch yet).
  • cargo check -p ec-av1 --all-targets: 0 warnings.