edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
Lane av1444128: AV1 4:4:4 inter 128x128 mu-chunk chroma port (side>64 arm)
Base: main 73f3ac64. Branch lane-av1-444-128, worktree
/home/user/Documents/Code/Rust/edith_codecs-av1444128. Closes the named gap
in lanes/av1444.report.md continuation 8 item 5: "an inter 128x128 block at
4:4:4 still codes ONE chroma unit per mu chunk where libaom codes four
(side > 64 arm)".
What changed (decode.rs, both inter arms -- compound and single-ref; the two
arms' text was byte-identical, the patch asserts that and rewrites both)
- The chunk tail's chroma read is now a per-unit walk (libaom
decode_token_recon_block, decodeframe.c mu loop +av1_get_max_uv_txsizeblockd.h:1361):av1_get_max_uv_txsize(BLOCK_128X128)= TX_32X32, and the mu walk enumerates EVERY TX_32X32 unit of the chunk's chroma per plane in raster order. At ss 0/0 the chunk's chroma is 64x64 -> FOUR units; at 4:2:0 it is 32x32 -> the loop degenerates to the one unit the arm always coded (chunk_chroma = chroma_side * 64 / side,units = chunk_chroma / 32-- derived from the existingchroma_side, so the patch composes with the 444 lane'schroma_side = side >> ss_xthreading without touching it). - Per-unit geometry and stamps (the 444 lane's continuation-8 lesson):
each unit reads
around_miat its own mi origin over its own entropy-cell span (64 px at 4:2:0, 32 px = 8 mi cells at ss 0/0;get_txb_ctxreads 8 chroma context cells either way) andrecord_mi_chromas the unit's own grid immediately, so the next unit over reads this one's state. Offsets (cu_x/cu_y, the MC predictor slice, the assembledu_units/v_unitsgrid placement) are all generalized offchunk_chroma; at 4:2:0 every generalized expression equals the old literal (byte-identical degenerate case, witnessed below). - Per-unit chroma tx_type inheritance (
av1_get_tx_type, blockd.h:1291): an inter block's chroma unit inherits the coded type of the luma leaf covering its own quadrant (the map is read at the chroma 4x4 position scaled back to luma), not the block's first leaf. The arms now collect each luma leaf's(row, col, tw, th, tx_type)and resolve the cover per unit. At 4:2:0 with unsplit TX_64X64 leaves every type is DCT_DCT and this equals the oldfirst_tx_typepass-through (byte-identical); with split leaves the old code was wrong and the new code is libaom-exact.reduce_inherited_chroma_tx_type(the chroma ext-tx narrowing) is unchanged. - The lossless sub-arm's call now passes the generalized chunk offset/size; its internal per-unit walk is unchanged.
- New regression gate
a_real_aomenc_128x128_none_inter_blocks_coded_chroma_per_mu_chunk_decodes_pixel_exact(stream.rs): testsrc2 128x128,--sb-size=128 --min-partition-size=64 --max-partition-size=128 --cq-level=8 --cpu-used=2, 12 frames; the key frame splits to 64x64 (detailed content) and ALL 11 inter frames are non-skip 128x128 PARTITION_NONE blocks. Hard census asserts (inter_sb128_none_hits >= 8,chroma_split_tx_hits >= 64= two units per plane per coded block -- measured 11 and 88) + pixel-exact viadecode_all_frames_vs_oracle.
Reproduce (ticket step 1)
Recipe: ffmpeg testsrc2=size=128x128 12f y4m | aomenc --profile=1 --sb-size=128 --min-partition-size=64 --max-partition-size=128 --cq-level=8 --cpu-used=2 --enable-obmc=0 --enable-warped-motion=0 --enable-interintra-comp=0 --enable-interintra-wedge=0 --enable-smooth-interintra=0 --enable-ref-frame-mvs=0 --kf-max-dist=100 --enable-fwd-kf=0 --enable-palette=0 --enable-intrabc=0 --enable-cdef=0 --enable-restoration=0 --loopfilter-control=0 --obu (w128_444.obu,
scripts in $HOME/.cache/av1444128/). Partition census (instrumented aomdec
EC_TRACE): frame 0 = 128 root SPLIT (four 64x64 NONE -- no 128x128 INTRA
block anywhere, which matters because the 444 tree's INTRA 128 arm is still
one-unit-per-chunk, see gaps); frames 1..11 = 128x128 PARTITION_NONE, all
non-skip. Pre-port confirmation (probe built from lane-av1-444 1ad7e0fc):
frame 0 decodes byte-exact; every inter frame is garbage (~40k differing
samples of 49152) with the entropy ladder still consuming the same symbol
count -- our side reads 24 coefficient units per inter frame where libaom reads
48, and the oracle trace shows the FOUR TX_32X32 chroma units per chunk per
plane (EC_COEFF plane=1 rows/cols 0,0 0,8 8,0 8,8 per chunk) that the old arm
never read. Note the encoder split the LUMA var-tx tree to TX_32X32 leaves
here, so the one DctDct leaf in the stream also exercised inheritance (below).
Defect found and fixed during verification (class mixed-unit-tuple)
The vartx leaf tuple (row, col, tw, th) mixes units: (row, col) are MI,
(tw, th) are PIXELS (the rect-leaf path already divides by MI). The first
cut of the covering-leaf lookup compared the px extents as mi, so the one
non-Idtx leaf in the witness stream (DctDct at luma (64,96)) mapped its chroma
unit to the wrong type (Idtx) -- reconstruction-only corruption of exactly that
unit (~1.2k chroma samples/frame, entropy in sync, Y exact). Fixed by dividing
the leaf extents by MI in the predicate (EC_LEAFDBG scratch instrumentation
pinned it; instrument removed after).
Byte-exactness (probe decode_probe; EC_PROBE_OUT raw planes vs
aomdec --rawvideo and ffmpeg -pix_fmt rawvideo; all fresh runs, -y)
| tree | stream | result |
|---|---|---|
scratch = lane-av1-444 1ad7e0fc + this patch |
w128_444.obu (11 non-skip 128-none inter, 444) |
IDENTICAL three-way, sha256 6cd1ded4ffa94ff7538704fe57e4e4ca40853f45eaab0eb5f5ba7dd879c03e8e (589824 B) |
| this tree (main + patch) | w128_420.obu (same recipe, profile 0) |
IDENTICAL three-way, sha256 e1072eb0b6484da8d75cb6f587299ffe029cc4c0b12f7a510f0699ddbb2bbaf9 (294912 B) |
| scratch | the 444 lane's full 60-frame fixture full.obu |
IDENTICAL, sha256 c3f95bca00f0ba5ea9f7071f5645edd910b590efebea2d73398017d10dc272d7 -- the same sha continuation 8 quoted; zero regression |
| scratch | f_nolf.obu, f444_64.obu, sq444.obu |
decode, no refusal |
| scratch | w128c_444.obu (lag-in-frames=3: ARF exists; 7 non-skip 128-none inter frames, EC_MODE_VAL mode=23/24 = real COMPOUND_REFERENCE picks, ref1=4/7) |
IDENTICAL vs aomdec, sha256 bdc3da9f1c8ec75cd7315606b0d260da955996ae86fbd85bb7d3c33e9e0cedd8 -- the compound arm's copy of the patch is exercised and exact |
| this tree | new census gate (above) | ok (11 none-roots, 88 units, pixel-exact) |
The committed diff is main-only; the 444 witness necessarily rides the scratch
merge with the 444 lane because this tree still refuses non-4:2:0 sequences by
name (that refusal lift is lane-av1-444's, in review). The two arms' pre-patch
text was byte-identical across both trees (asserted by the patch script,
$HOME/.cache/av1444128/patch_128.py), so the same patch applied to both.
Still refused or unproven (named gaps, unchanged by this lane)
| shape | disposition |
|---|---|
| INTRA 128x128 chroma at ss 0/0 (one unit per chunk, libaom codes four) | exists only on lane-av1-444's tree (main refuses 444); same class one arm over -- flagged for the 444 lane's next continuation |
read_inter_chroma_lossless indexes chroma units at ox / 2 (4:2:0 mi math) |
444-lossless inter chroma unported upstream; offsets passed in are now generalized, internals are the 444 lane's |
128x128 block overhanging the frame edge: the mu walk does not clip unit origins past mi_cols/mi_rows (libaom max_block_wide/high) |
pre-existing at 4:2:0 (unexercised by every byte-exact fixture); left untouched so the 4:2:0 degenerate case stays byte-identical |
| a committed suite test for the 444 twin | impossible on this tree (444 refused); recipe + scratch-tree witness above are ready for the post-merge tree |
Build
cargo build --release -p ec-av1 --example decode_probe: 0 warnings (release
target recompiled after touching decode.rs; grep -ci warning = 0).
Full suite
Handed to Main per the batch standing order (full suites run on the server, not
locally; the locally started run was stopped at ~10 min). Main staged the clean
worktree at commit 5bc108bc to server-3 (user@host-b, unit
av1444128-suite) with EC_AV1_REQUIRE_AOMENC=1 EC_AV1_REQUIRE_FFMPEG=1,
command cargo test -p ec-av1 -- --test-threads=1. The literal final
test result: line is appended to this section (and the commit amended) when
the run lands.
PENDING (server-3 run in flight)
LANDED (server-3, payload 5bc108bc, code bytes identical to 6a670aa0):
test result: FAILED. 603 passed; 4 failed; 60 ignored; 0 measured; 0 filtered out; finished in 23908.50s
All four failures are server-staging absences (Main's triage of the bodies: the
tarball excludes lanes/, and only the oracle aomenc was installed), not lane
regressions -- this lane's new census gate passed:
intra::tests::rect_predictors_match_c_dump-- missinglanes/intrarect_dump.c(tarball excludeslanes/)stream::tests::a_real_affine_global_motion_stream_decodes_pixel_exact-- no aomenc at~/.cache/aom-affine/build/aomencon that host (only the oracle aomenc was installed); the same test is also the 444 lane's known live-aomenc infra race (continuation 8), green in isolated re-runsstream::tests::a_real_aomenc_stream_with_film_grain_decodes_pixel_exact-- NotFound (fixture or tool path), not a pixel diffwedge::tests::wedge_codebook_matches_libaom_dump-- missinglanes/wedge_libaom.expected.txt
Main is filling the missing paths for the next suite on that host.
MERGE-SIDE FOLLOW-UPS (2026-09-24)
- Merge
ca84fddd(--no-ff, parents73f3ac64+c125b893), zero conflicts; create list is exactly this report. Proof of resolution:git diff lane-av1-444-128 -- crates/on the merged tree is EMPTY -- the merged crate bytes are the reviewed lane revision. - Reviewer PASS 0.9. The one P3 wording defect is fixed on the lane pre-merge
(
c125b893): the inter-128 census doc comment and assert message now say FOUR units per plane per coded 128-none block (four 64x64 mu chunks at 4:2:0; measured 88/11 = 8 per block = 4 per plane). Thresholdchroma_units >= 8 * 8unchanged. - server-3 suite on this lane's code: 603/4/60 (
test result: FAILED. 603 passed; 4 failed; 60 ignored) -- all four failures are server-staging absences, NOT this diff:rect_predictors_match_c_dump(missing intrarect expected dump, tarball excludeslanes/),a_real_affine_global_motion_stream_decodes_pixel_exact(no affine aomenc on that host),a_real_aomenc_stream_with_film_grain_decodes_pixel_exact(golden6 fixture NotFound),wedge_codebook_matches_libaom_dump(missing wedge expected). Main queues the merged-tree suite; main stays unpushed until it is green. - Accepted, no witness: the 4:2:0 SPLIT-leaf inter-128 tx_type inheritance sub-case is unwitnessed (the 4:4:4 witness 6cd1ded4 / 420 arm e1072eb0 cover the UNSPLIT leaves, the witnessed byte-identical case). Accepted by Main at review; do not invent a witness.
- No fixture copy needed: the lane's gitignored
fixtures/bitstreams/is byte-identical to main's. Lane worktree left in place, branch kept (Main may still need it). Scoped gate:cargo check -p ec-av1 --all-targetson the merged tree, 0 warnings, 0 errors (private target dir). No full suite run here, no push.