edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-r14 round 2 — 64-axis rectangular INTER residual coding
Per-segment table (ReelB 2160p HDR10, -c:v copy -an -f obu, 2 s each)
| segment | refusal BEFORE this round (at merged main) | refusal AFTER this round | counters |
|---|---|---|---|
-ss 300 -t 2 (seg300.obu, 206 frame headers) |
an intra-coded HORZ/VERT strip needs rectangular intra prediction this decoder does not code yet | unchanged (same string, same site decode.rs:17325) |
rect_inter tu=28 txsplit=18 |
-ss 3000 -t 2 (seg3000.obu, 288 frame headers) |
a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding — shape 32x64 at mi(0,32) | a split transform on a 1:4 inter strip with a 64-px axis | 22 SB-level 32x64 strips decoded, tu=21, txsplit=4 |
-ss 4500 -t 2 (seg4500.obu, 213 frame headers) |
a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding — shape 16x64 at mi(0,0) | a split transform on a 1:4 inter strip with a 64-px axis | txsplit=1 |
kf300.obu (the r1 blocker): the git merge main of this round already advanced it past
"a non-skip rectangular ... needs rectangular residual coding" to the intra-rect-strip refusal —
lane-inter4's merge lifted it, the charter's premise was stale. It is not one key frame:
decode_probe parses 206 frame headers in it. (ffmpeg -i kf300.obu -bsf:v trace_headers
prints nothing at all for a bare .obu — no container, so the bitstream filter is never
attached; the header count from our own parser is the measurement used instead.)
What changed
crates/ec-av1/src/decode.rs:10891 rect_inter_residual_supported— accepts(64,32) (32,64) (64,16) (16,64).crates/ec-av1/src/decode.rs:10903 rect_inter_luma_set—TxbSet::Luma64for 64x32/32x64,TxbSet::LumaRect32x16for 64x16/16x64 (av1_get_adjusted_tx_size; both sets carrytx_type: None, correct becausetx_size_sqr_up == TX_64X64makes the ext-tx set DCT_ONLY, so notx_typesymbol is coded and the intra/inter table split is moot).crates/ec-av1/src/decode.rs:10921 rect_inter_chroma_set— 32x16/16x32 →ChromaRect32x16, 32x8/8x32 →Chroma16(same sets the INTRA superblock-strip path already uses).crates/ec-av1/src/decode.rs rect_scan—SCAN_32X8/SCAN_8X32arms.crates/ec-av1/src/decode.rs read_inter_plane_rect— the load-bearing change: a 64-length axis codes only its low 32 coefficients, so the unit read is themin(w,32) x min(h,32)corner, zero-extended into the truew x hgrid beforedequant_and_inverse_typed_wh. A square 32x32 corner goes through the SQUARE reader withrect_shape = Some((w, h)), becauseav1_nz_map_ctx_offsetis indexed by the real un-adjusted shape (class from lane-sbpart r8).crates/ec-av1/src/decode.rs read_block_tx_size_rect— NEW named refusal"a split transform on a 1:4 inter strip with a 64-px axis":sub_tx_size_mapis square for every shape this decoder splits (TX_32X16→TX_16X16, TX_64X32→TX_32X32) except TX_64X16→TX_32X16 and TX_16X64→TX_16X32, where the existing square recursion would code the wrong tree.crates/ec-av1/src/decode.rs+stream.rs:60—rect64_inter_tu_hits()counter (luma 64-axis TUs).crates/ec-av1/src/refusal_inventory.rs— the new refusal registered.crates/ec-av1/src/stream.rsgatea_real_aomenc_inter_sequence_with_a_superblock_level_rect_partition_decodes_pixel_exactnow hard-assertsrect64_tus > 0(the residual half of the arm; before, the gate proved only the partition symbol because every strip it accepted wasskip).
Merge commit 399278b resolved the single conflict (cdf_state.rs TxbSet match) by keeping BOTH
sides' arms (lane's 16x4 intra 1:4, main's 16x8 inter rect).
Gates
EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib -- --test-threads=1 superblock_level_rect_partition
EVIDENCE: gate stderr | real aomenc 192x128x6, --enable-rect-partitions=1 --min-partition-size=32 --max-partition-size=64 --sb-size=64, 16 attempts, every decoded frame compared Y+U+V vs ffmpeg | 8-bit: 2 named refusals, 4 pixel-exact attempts carrying the arm, 64x32 strips=4, 32x64 strips=4, 64-axis residual TUs=2, 10 out of scope (0 mismatched) — test result: ok
EVIDENCE: same gate run with for bit_depth in [8u32, 10u32] | identical recipe at --bit-depth=10 | 10-bit: 2 pixel-exact attempts carrying the arm, 64x32=2, 32x64=2, 64-axis residual TUs=2 — the capability is pixel-exact at 10 bits too
EVIDENCE: cargo run --example decode_probe -- seg3000.obu before/after, EC_AV1_RECT_DUMP=1 | 2 s of the real film at 50:00 | EC_RECT_REFUSE ... w=32 h=64 → no EC_RECT_REFUSE line at all; 22 SB-level 32x64 strips now decode
Merge-verification gates (on 399278b): 16_level_1to4 superblock_level_ 32x32_level_1to4 inter_sequence refusal_inventory gate_coverage → 38 passed, 0 failed, 4 ignored.
Full suite: $HOME/.cache/r14-suite-r2.log, run on the tip after the second git merge main
(main b51719f) — totals appended below.
Verifier notes folded in (round 2)
lanes/r14-r1.report.md:18corrected: the "104 / 172" pair isdecode_probe's rect4_32 counter line, not rect4_16; the true rect4_16 numbers onkf300.obuare 96, 148, 122, 311, 63."a 16x16-level partition value outside PARTITION_NONE..PARTITION_VERT_4"was unreachable (all 10 symbols of that CDF are handled above the check) — removed fromdecode.rs(now adebug_assert_eq!(part16, PARTITION_SPLIT)) and fromrefusal_inventory.rs.- The rectangular-residual wall lives in
decode_inter_block, reached only fromdecode_inter_frame_tile, so it fires on an inter frame: the key frame ofkf300.obudecodes through. Not measured this round: the decode-order index of the stopping frame and a 16-bit byte-equality compare of every frame before it.decode_probereports only the refusal, and adding the per-framecmpladder did not fit this round's budget — deferred(adecode_probemode that dumps every decoded frame before the refusal and diffs it againstffmpeg -pix_fmt yuv420p10le).
Residue
- deferred(needs a rect-aware var-tx recursion + rect leaf reconstruction, ~2 call sites):
a split transform on a 1:4 inter strip with a 64-px axis. This is the film's next blocker in BOTH mid-film segments.sub_tx_size_map[TX_64X16] = TX_32X16is rectangular, so the leaf tuple(row, col, tx_px)and the two square leaf loops (decode.rs~16174 and ~17150) have to carry(row, col, tw, th). Out of this round's ≤150-line scope. - deferred(unrelated shape, needs its own bisect): enabling the 10-bit arm of the SB rect gate
exposes a pre-existing mismatch at attempt 14 (cq 61, horizontal split, motion step 12) that
decodes zero rect strips and zero 64-axis residual units — provably not this round's code
path. The gate stays
[8u32]with that measured reason written at the loop instead of the stale "non-skip residual is refused" one. - accepted:
seg300still stops at the intra-rect-strip refusal (lane-intrarect's wall, named and inventoried).
Suite
systemd-run --user --unit=r14-suite-r2 ... cargo test -p ec-av1 --lib -j3 on tip c604580
(after git merge main @ b51719f) -> 365 passed; 0 failed; 31 ignored, 623.58s,
log $HOME/.cache/r14-suite-r2.log.