edith_codecs
Clone
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane-tx4x8 round 1 — TX_4X8/TX_8X4 end to end (gate RED, first divergence not yet isolated)
Branch lane-tx4x8 off lane-sub8 b500160. NOT rebased onto main (charter order).
What changed
crates/ec-av1/src/cdf.rs—EOB_PT_32_LUMA{,_Q0,_Q1,_Q3}+_CLASS1siblings, transcribed fromav1_default_eob_multi32_cdfs(token_cdfs.h:792), luma plane, both tx-class rows. Format cross-checked against the already-pinnedEOB_PT_16_LUMA_CLASS1_Q0.crates/ec-av1/src/cdf_state.rs—eob_pt_32_luma{,_class1}state + q-ctxpick+ counter reset;TxbSet::LumaRect4x8/LumaRect4x8Set1. Derivation:get_txsize_entropy_ctx(TX_4X8)=(txsize_sqr_map=TX_4X4 + txsize_sqr_up_map=TX_8X8 + 1) >> 1= TX_8X8, so every coefficient table isLuma8's;read_tx_type's CDF row istxsize_sqr_map[TX_4X8]= TX_4X4, so thetx_typetable isLuma4/Luma4Set1's;eob_ptis the true 32-position table (txsize_log2_minus4[TX_4X8] == 1->eob_flag_cdf32). (classtable-indexed-by-raw-size: three different size keys in one variant.)crates/ec-av1/src/decode.rs—SCAN_4X8/SCAN_8X4(libaomdefault_scan_4x8/8x4),class_scan_table_wh(mrow/mcolat rect sizes). Conversion(p % h) * w + p / hre-proved first by regenerating the committedSCAN_16X8/SCAN_8X16from the same source (heads matched).base_ctx_rect/br_ctx_rectgained aTxClass(the 1D-class arms are shape-independent in libaom'sget_nz_map_ctx_from_stats; no newav1_nz_map_ctx_offset_*table is needed — thew<h -> 11+ctx/w>h -> 16+ctxrule already inbase_ctx_rectIS that table).read_coeffs_rectnow reads a realtx_typesymbol and honoursV_DCT/H_DCT(rect class scan + class contexts +eob_pt_class1). Two capability-claim refusals deleted.decode_leaf_rect8— thePARTITION_HORZ/VERTleaf of an 8x8: twoBLOCK_8X4/4X8sub-blocks, mode reads viaread_intra_mode_sub8, chroma once on the last sub-block at the group's 4x4 unit,dequant_and_inverse_typed_wh(the rect transform primitive, itsabs(rect_type)==1NewInvSqrt2scale andav1_inv_txfm_shift_ls[TX_4X8]row, already existed and needed no change),Reach::of_rect,fill_lf_grid_rect(bw, bh)for the deblock grid,partition_context_lookup[BLOCK_4X8] = {31,30}/[BLOCK_8X4] = {30,31}. Wired at BOTH sub-8x8 partition sites; the leftoverelseis nowunreachable!(partition_w8is a 4-symbol CDF).- counters
tx4x8_coded_hits/tx8x4_coded_hits(leaves with REAL coefficients only). - 4 new table tests (transposed-pair scan gate, class-1 scan pins, eob table shape, shape-specific reach).
crates/ec-av1/src/encode.rs—has_tr_4x8/has_tr_8x4/has_bl_4x8/has_bl_8x4transcribed verbatim;rect_reach_tables(bw, bh)replaces thebw == 16two-way pick.crates/ec-av1/src/refusal_inventory.rs— three refusals removed: the 4x8/8x4 partition refusal and the two recttx_type/tx classcapability claims.crates/ec-av1/src/stream.rs— gatea_real_aomenc_stream_with_a_sub8_rect_leaf_decodes_pixel_exact, three arms (8-bit 16x16, 8-bit 128x16--tile-columns=1, 10-bit 16x16),--enable-rect-partitions=1 --min-partition-size=4 --max-partition-size=8, per-attempt hard assert that BOTHtx4x8_coded_hitsandtx8x4_coded_hitsmoved, named refusals only, no SKIP on error.
Gate: RED
EC_AV1_REQUIRE_AOMENC=1 cargo test -p ec-av1 --lib sub8_rect_leaf
-> luma vs ffmpeg (seed=303 cq=12 depth=8 tiles=[]), mismatch from sample 0 of a 16x16
frame; ours is near-flat (126..142), ffmpeg's is full-range (0..229). The decode does not
error, so this is wrong coefficients/reconstruction (or an entropy divergence inside the
first rect leaf), not a refusal.
EVIDENCE: cargo test output above | 40 attempts x 3 arms, aomenc --enable-rect-partitions=1 --min-partition-size=4 --max-partition-size=8 --enable-filter-intra=0 on testsrc2+noise 16x16 | first firing attempt (seed 303) mismatches luma at index 0; 291 other lib tests unaffected at the time of the run.
EVIDENCE: probe sweep with examples/decode_probe + EC_AV1_TRACE=1 | 12 seeds x 16x16, 12 x 32x32, --enable-filter-intra=0 | 16x16: 12/12 decode without any refusal, 3/12 code BOTH orientations, 9/12 at least one; 32x32: 1/12 (11 die on 16x16-LEVEL rect refusals owned by other lanes) — this is why the gate uses 16x16/128x16 fixtures.
Recipe findings (cite before reusing)
--max-partition-size=8does NOT stop aomenc coding a 16x16 block as two 16x8 strips: at 64x64, 39/40 attempts refuse on 16x16-level rect gaps ("a HORZ/VERT intra strip with a split transform", "a coded (non-skip) HORZ/VERT rect strip below 16x16", "a HORZ_A/HORZ_B/VERT_A partition below 16x16"). Only a 16-pixel frame dimension isolates the 8x8 level.- With
--enable-filter-intra=1, most attempts die on the pre-existing square-only filter-intra refusal, whichdecode_leaf_rect8re-raises by name for a 4x8 leaf. - A probe sweep whose binary path was wrong reported "OK, 0 hits" for every cell
(class
stale-output-faked-measurement): alwaysls -lthe probe binary in the lane's ownCARGO_TARGET_DIRfirst. The first sweep in this round was invalid for exactly that reason.
Residue
- fix-now (next round): the pixel mismatch. Nothing in the ladder below was disproved this
round, ranked by suspicion:
- an entropy divergence at the FIRST rect leaf (range ladder vs instrumented aomdec,
EC_TRACE_COEFF, on the pinned seed-303 stream) — ours decoding a near-flat frame is consistent with aneob/all_zeroread off the wrong table; TxbSet::LumaRect4x8's three-way table split (coeff tables TX_8X8 / tx_type row TX_4X4 / eob 32) — verify each againstread_coeffs_txblive, not against my derivation;dequant_wh/ the rect transform at (4,8) — never exercised below 16x8 before this lane;Reach::of_rectat 4x8/8x4 (localized errors only — would not explain sample 0).
- an entropy divergence at the FIRST rect leaf (range ladder vs instrumented aomdec,
- deferred:
--tile-columns=1arm result — not separable while arm 1 is red — unblocked by the fix above. - deferred: filter intra on a 4x8/8x4 leaf —
predict_filter_intrais square-only — unblocked by a rect filter-intra predictor (same refusal the 16x16-level strips carry).