edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-rectx r3 — the rect leaf was bit-exact; the block AFTER it was not
Branch lane-rectx, on top of main 3808cf8 (git merge-base --is-ancestor main HEAD = OK,
no rebase needed). Prior state: r1/r2 landed non-skip TX_16X8/TX_8X16 rect-leaf coefficient
decode (decode_leaf_rect's lane-rectx arm, read_coeffs_rect, TxbSet::LumaRect16x8{,Set1}
/ChromaRect8x4, EOB_PT_128_LUMA/EOB_PT_32_CHROMA, SCAN_8X4/SCAN_4X8) UNPROVEN, with
the lane's own gate red.
What this round proved
- The r2 coefficient path is right. Against the instrumented oracle
(
~/.cache/aom-oracle/build/aomdec,EC_TRACE_COEFF=1) on a real aomenc stream, a non-skipTX_16X8luma leaf plus both itsTX_8X4chroma halves decode with an IDENTICAL msac range at every element (all_zero37445,tx_type55512,eob=1 41024,base_eobpos 0 level 1 64544, DC sign 37072, chromaall_zero=1 40760 / 47390). Scans, eob CDF alphabet, txb sets, nz-map/br contexts and the DC-sign context at this size are all confirmed by that ladder, not by argument. SCAN_8X4/SCAN_4X8re-checked against the realscan.c(not a memory of it):~/.cache/aom-oracle/src/av1/common/scan.cdefault_scan_4x8== ourSCAN_8X4anddefault_scan_8x4== ourSCAN_4X8, verbatim, which is whatdecode.rs::tests::the_rect_scan_tables_match_libaom...already pins (asymmetric pair, a swap fails it).- Root cause of the desync (FIXED): the
use_filter_intraflag was never read at 16x8/8x16.av1_filter_intra_allowed_bsizeis "both sides <= 32", so libaom reads the flag for every DC_PRED 16x8/8x16 block;filter_intra_size_class_rectreturnedNonethere, so we dropped one symbol per DC_PRED strip and desynced the tile from that block on — silently, with a full-frame pixel mismatch and no error. Ladder evidence: leaf mi=(2,4), we and the oracle both decodemode=0 uv_mode=9 skip=0, but our post-mode range is 34808 where the oracle's is 40668 (value-equal narrowing drift). After the fix our range at that point is 40668 and the next transform block'sall_zeroreads 40269 — bit-identical to the oracle.
Files changed
crates/ec-av1/src/cdf.rs:415—FILTER_INTRA6 -> 8 rows, addingdefault_filter_intra_cdfsindex 5 (BLOCK_16X8, 9394) and 4 (BLOCK_8X16, 12551).crates/ec-av1/src/cdf_state.rs:467— the field's type/doc follow.crates/ec-av1/src/decode.rsfilter_intra_size_class_rect—(16,8) => Some(6),(8,16) => Some(7); the actual fix.crates/ec-av1/src/decode.rsread_coeffs_rect— three env-gated trace prints (tag=all_zero_rectwith the pre-symbol range,tag=sign_rect) under the existingEC_TRACE_COEFF, plus the entry range on theEC_AV1_RECTX_TRACEline; these are what made the cross-decoder bisection possible and are kept for the successor.crates/ec-av1/src/decode.rstests — newa_rect_strip_below_16x16_reads_its_own_filter_intra_cdf_row.crates/ec-av1/src/stream.rssweep_rectx_recipes(scratch,#[ignore]) — also sweeps--reduced-tx-type-set=1, and only dumps the 8x8 mismatch map when there IS a mismatch.
Checks
cargo test -p ec-av1 --lib -- filter_intra scan_-> 8 passed, 0 failed (includes the new pin and the existinga_real_aomenc_filter_intra_stream_decodes_pixel_exact).EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib-> see TOTALS below.- EVIDENCE: /tmp/claude-1000/.../scratchpad/{s.obu,aom.log,ours.log} | ffmpeg mandelbrot 64x64
start_x=-0.6 -> aomenc cq16 --enable-rect-partitions=1 --min-partition-size=8
--max-partition-size=32; instrumented aomdec
EC_TRACE_COEFF=1vsexamples/decode_probeEC_TRACE_COEFF=1| first divergence moved from the transform block after leaf mi=(2,4) (ours 34467 vs oracle 40269) to none at that point (both 40269) after the fix.
Open residue
- fix-now (next round, out of this round's tool budget): the rect leaf's
kf_y_modecontext is read from the coarse 16x16 neighbour grid. Second, independent defect, found by the same ladder onrgbtestsrc=size=64x64cq=50--reduced-tx-type-set=1: at leaf mi=(4,12) (decode_leaf_rect, bw=16 bh=8, outer_at=(1,3)) we and the oracle ENTER the block at the same range 59792, and then we decodemode=0where the oracle decodesmode=2(H_PRED) — a wrong CDF row, not a wrong value.Neighbours::above_mode/left_mode(decode.rs:1806) are per-16x16-cell; libaom takesabove_mi/left_mifrom the real mi grid, so when the cell above was split into 8x8 leaves our slot holds the last-written leaf's mode (bottom-RIGHT) instead of the true above neighbour (bottom-LEFT at mi col 12). Known class: "context read from one cell". The fix is a per-mi mode grid alongside the existing per-miskip_grid/lf_grid— 13fill_skip_grid*call sites would gain a mode write. It affects every intra path, not just rect leaves. - deferred(the mode-grid fix above): the lane gate
a_real_aomenc_stream_with_a_coded_rect_strip_below_16x16_decodes_pixel_exactis still RED, and its two refusals are NOT lifted. Its current recipe fails on a third, unrelated blocker ("a HORZ_A/HORZ_B/VERT_A partition below 16x16"): a 126-cell sweep (9 lavfi sources x 7 cq x reduced-tx-type-set 0/1,sweep_rectx_recipes) found aomenc writes AB partitions below 16x16 despite--enable-ab-partitions=0in most cells — same aomenc quirk the ledger already records one level up. After the filter_intra fix the sweep has exactly ONE cell that decodes to completion (rgbtestsrc cq=50 rtx=1, 4 rect leaves fired) and it mismatches on the mode-ctx defect above. So there is currently no recipe that can turn the gate green; a green gate needs the mode-grid fix first. - accepted:
read_coeffs_rectstill refusesV_DCT/H_DCT("a non-2D tx class on a rectangular transform"), which is why the gate recipe pins--reduced-tx-type-set=1.
TOTALS: see lanes/rectx-r3.handoff.md.