forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 214cdf2befd543569feaaaf45888fe80e40318dfFiltered to crates/ec-av1/src/decode.rsClear filter

2026-08-28

feat(av1): read compound DRL + assign compound MVs, still refuse before MCAhmet Kaan Gümüş · 214cdf2
feat(av1): read compound DRL + assign compound MVs, still refuse before MC

find_mv_stack_compound + read_inter_compound_mode now mirrored into
decode_inter_block8's compound arm (task a). A new assign_compound_mv
helper ports libaom decodemv.c's compound read_drl_idx branches and
assign_mv's compound modes (NEAREST_NEARESTMV..NEW_NEWMV) verbatim,
shared by both decode_inter_block and decode_inter_block8 (tasks b/c).
Both paths still refuse right after the MV pair is assigned -- two-
reference motion compensation (COMPOUND_AVERAGE/dist-wtd averaging in
the CONV_BUF domain, not pixel domain) is not wired yet.
feat(av1): read inter_compound_mode past comp_ref, still refuse MCAhmet Kaan Gümüş · cadc399
feat(av1): read inter_compound_mode past comp_ref, still refuse MC

Ports libaom's default_inter_compound_mode_cdf + compound_mode_ctx_map
(entropymode.c / mvref_common.h) and wires read_inter_compound_mode
into decode_inter_block's COMPOUND_REFERENCE arm: once comp_mode/
comp_ref name the reference pair, find_mv_stack_compound now builds
the real compound mvstack (with CompoundTplArgs when tpl_frame is
live) and the block reads its own compound_mode symbol before still
refusing by name -- compound DRL, MV assignment, and two-reference MC
remain unwired. decode_inter_block8's 8x8-leaf arm is untouched (still
refuses at comp_ref). New COMPOUND_MODE_HITS counter (compound_mode_hits())
mirrors COMP_MODE_HITS for a future firing gate.
feat(av1): wire comp_mode/comp_ref reads into both inter-block decodersAhmet Kaan Gümüş · 14ea0a6
feat(av1): wire comp_mode/comp_ref reads into both inter-block decoders

reference_select now threads from the frame header through
decode_inter_frame_tile(_with_cdfs) into decode_inter_block and
decode_inter_block8: when set, each inter block reads comp_mode (spec
5.11.25) first and, on COMPOUND_REFERENCE, reads comp_ref_type/
comp_ref/comp_bwdref via read_compound_ref_frames before refusing the
block by name -- two-reference motion compensation is not wired yet.
This keeps the arithmetic decoder in sync for reference_select streams
that never actually pick compound, and replaces the old blanket
frame-level reference_select refusal with a comp_mode-count-verified
per-block one. skip_mode_present (a separate header bit) gets its own
frame-level refusal since no block-level reader for it exists yet.

Added COMP_MODE_HITS/comp_mode_hits() and a real-aomenc gate
(a_real_aomenc_stream_with_reference_select_reads_comp_mode_correctly)
proving both outcomes: a fully-decoded reference_select stream that
never fired compound, or a refusal that names COMPOUND_REFERENCE with
comp_mode_hits having advanced. Live run: every aomenc attempt in this
recipe hit skip_mode_present or allow_screen_content_tools first (both
separate unimplemented capabilities), so comp_mode itself has not yet
fired live -- next round needs a recipe/attempt-count that clears both
before reaching a bidirectional-reference block.
feat(av1): port comp_mode + compound ref-pair reads, not yet wiredAhmet Kaan Gümüş · a75a2e1
feat(av1): port comp_mode + compound ref-pair reads, not yet wired

read_comp_mode (spec 5.11.25 comp_mode) and read_compound_ref_frames
(comp_reference_type + uni_comp_ref/comp_ref/comp_bwdref trees) mirror
libaom decodemv.c's read_ref_frames compound arm bit-for-bit. Audited
every libaom pred_common.c compound context function against the
existing single_ref_p1..p6_ctx/uni_comp_ref_p1_ctx helpers: each one
(uni_comp_ref_p/p2, comp_ref_p/p1/p2, comp_bwdref_p/p1) is the same
vote-the-neighbours shape under a different libaom name, so no new
context function was needed.

Not yet called from decode_inter_block/decode_inter_block8 -- the
frame-level reference_select refusal in stream.rs still gates every
caller, so this is dead code today (#[allow(dead_code)]), kept
compiling and reviewable for the round that wires it into the block
decode path and adds the inter_compound_mode/DRL/MV/MC chain.
WIP(av1): compound mvstack candidate machinery, not yet wiredAhmet Kaan Gümüş · 368413c
WIP(av1): compound mvstack candidate machinery, not yet wired

find_mv_stack_compound: parallel entry point to find_mv_stack_with_sign_bias
for a block predicted against a reference-frame pair (spec 7.10.2's
is_compound path). Adds:
- MiInfo.mv1 (the compound second MV, paired with r3's ref_frame1)
- scan_row_compound/scan_col_compound/scan_top_right_compound/
  scan_corner_compound: exact-pair-matched twins of the single-ref scans
- process_compound_ref_mv_candidate + CompoundRefLists +
  combine_compound_candidates: the compound extension/topping pass
  (mvref_common.c's process_compound_ref_mv_candidate + the combine step)
- CompoundTplArgs: compound temporal-MV fold-in, reusing motion_field's
  existing single-ref add_tpl_ref_mv once per side of the pair
- new_mv_ctx/ref_mv_ctx reuse the existing (nearest_match, ref_match_count)
  switch, which libaom's own mode_context switch is ref-count-agnostic about

Documented deviations: tpl compound candidates drop (not zero-fill) a
missing side; the extension combine step dedups by weight-bump instead of
libaom's real is_dup skip-on-first-match. Both noted in find_mv_stack_compound's
doc for a later round to tighten if a live compound gate's drl_ctx disagrees.

Every existing single-reference caller (find_mv_stack/
find_mv_stack_with_sign_bias and their 23 pre-existing tests) is untouched;
this is purely additive, unwired code, same pattern as r1/r3. 6 new tests,
cargo test --release -p ec-av1 --lib: 205 passed / 0 failed / 16 ignored.
WIP(av1): carry a compound second reference through MiInfo/NeighboursAhmet Kaan Gümüş · cfa1e23
WIP(av1): carry a compound second reference through MiInfo/Neighbours

Step 1 of the compound-decode chain (lane-av1comp): MiInfo grows
ref_frame1: Option<i8> (spec RefFrames[1]) and decode.rs's Neighbours
grows above_ref1/left_ref1 alongside above_ref/left_ref, mirroring the
existing i8 single-ref tracking. Every one of the 24 MiInfo literal
sites across decode.rs/encode.rs/mvstack.rs/tile.rs sets it to None --
no decode or encode path here ever produces a compound block yet, so
this is pure plumbing: find_mv_stack's scan still matches candidates
on ref_frame alone, and reference_mode_ctx/comp_reference_type_ctx
(landed r1, 1fcb059) still have no caller.

Next: read_ref_frames replacing stream.rs:181-195's reference_select
refusal (decodemv.c:966-990/1000+, is_comp_ref_allowed blockd.h:65-67),
then inter_compound_mode CDF/tree + compound DRL, then mvstack's dual-
ref candidate scan (process_compound_ref_mv_candidate,
mvref_common.c:435-455/696-762 -- the largest remaining piece), then
the COMPOUND_AVERAGE/dist_wtd_comp_avg MC blend. See the lane-av1comp
ledger entries for the full ordered plan.
wip(av1): temporal MV projection math (spec 7.9/7.10.2.8), not yet wiredAhmet Kaan Gümüş · 916263c
wip(av1): temporal MV projection math (spec 7.9/7.10.2.8), not yet wired

New crate::motion_field module: MotionField (per-frame saved 8x8 MV grid
+ order-hint bookkeeping), setup_motion_field (av1_setup_motion_field's
LAST/BWDREF/ALTREF2/ALTREF/LAST2 selection + motion_field_projection's
distance-scaled projection into a TplField), and add_tpl_ref_mv (the
per-query-block second projection). All ported from libaom
av1/common/mvref_common.c, unit-tested against hand-checked distance/
projection arithmetic.

mvstack::find_mv_stack_with_sign_bias gains an Option<TplArgs> parameter:
when Some, folds temporal candidates into the stack at libaom's real
insertion point (after the row/col/top-right REF_CAT_LEVEL boost, before
the corner probe) and derives zero_mv_ctx (GLOBALMV_OFFSET) from them;
None (every existing caller today) reproduces the prior always-0 exact
behaviour bit for bit -- all 13 existing mvstack unit tests still pass
unmodified.

NOT DONE: decode_inter_block's only call site still passes tpl: None
(see its own TODO), and nothing in decode_inter_frame_tile_with_cdfs or
stream::decode_stream builds a per-DPB-slot MotionField or calls
setup_motion_field -- so decode::tmv_hits() reads 0 against any real
stream, and no temporal-MV gate exists yet. See ledger DELTA for the
precise remaining wiring.
feat(av1): pixel-exact single-ref decode for LAST2/LAST3/BWDREF/ALTREF2/ALTREFAhmet Kaan Gümüş · 1719c8e
feat(av1): pixel-exact single-ref decode for LAST2/LAST3/BWDREF/ALTREF2/ALTREF

Adds per-reference hit counters (decode::ref_hits) so a gate can prove the
SPECIFIC reference it targets fired, not just non_last_ref_hits. Adds 5
targeted real-aomenc gates (dropping the golden gate's own
--max-reference-frames=3/--reduced-reference-set=1 narrowing, which
suppresses exactly these references; backward refs additionally need
--auto-alt-ref=1/--lag-in-frames for aomenc to code them at all). All 5
decode pixel-exact against ffmpeg across 3 repeated runs (15/15), proving
the WIP's sign_bias threading for BWDREF/ALTREF2/ALTREF is correct.

Also cherry-picks b650420 (--enable-ref-frame-mvs=0 swept into every
recipe) and a668c49 (film-grain gate pinned below the same fix) from
main, which this branch had forked before -- fixes the 3 real-aomenc
gates that were failing on the WIP alone.
fix(av1): port libaom's exact single-ref MV stack extensionAhmet Kaan Gümüş · 81de048
fix(av1): port libaom's exact single-ref MV stack extension

Replace the hand-written GOLDEN-fix extension pass (mvref_common.c
reduction guessed by hand: gated on the 8-entry stack cap, flat
unconditional weight=2 adds) with an exact port of
process_single_ref_mv_candidate + setup_ref_mv_list's single-reference
extension: real gate is MAX_MV_REF_CANDIDATES (2, not 8), real reach
is the query block's own bw4/bh4 (not a flat 16), dedup/weight/
sign-bias now match libaom's function precisely.

Fixes the 3 real-clip encoder regressions the hand-written pass
caused (stack contents diverged from what a real decoder derives,
desyncing DRL/MV coding). All 3 pinned/hand-built golden tests still
green; full ec-av1 suite green (179 passed); forwarding gate 20/20
clean, 0 mismatches. Golden gate fires=0/20 live (aomenc's fixed
seeds never select GOLDEN_FRAME in this environment) -- GOLDEN arm
stays unmasked since the pinned fixtures and forwarding gate already
prove it correct; re-masking per the fires=0 contingency would break
those pinned tests, a direct conflict flagged rather than resolved
silently.
fix(av1): re-mask GOLDEN_FRAME behind the LAST_FRAME refusal arm, pin round-9 residualAhmet Kaan Gümüş · 2e169ef
fix(av1): re-mask GOLDEN_FRAME behind the LAST_FRAME refusal arm, pin round-9 residual

Round 9's own forwarding gate still shows GOLDEN_FRAME motion compensation
mismatching a real aomenc stream once the film-grain refusal is in place
(1/20, frame 3 luma, apply_grain=false). Collapse the GOLDEN_FRAME arm back
into the single LAST_FRAME/_ refusal match so it refuses by name again, and
add an #[ignore]d pinned_golden7_stream_decodes_pixel_exact test (same shape
as golden4's) against the pinned repro fixture for round 10. Also drops the
debug-only probe_env_stream test.
fix(av1): gate switchable_interp neighbour ctx by ref_frame, keep GOLDEN_FRAME maskedAhmet Kaan Gümüş · 71a371f
fix(av1): gate switchable_interp neighbour ctx by ref_frame, keep GOLDEN_FRAME masked

resolve_interp_filter fed a block's above/left filter context straight
from Neighbours regardless of which reference frame each neighbour
coded -- a different-ref neighbour's filter choice was corrupting the
symbol read for this block's own filter, instead of reading as unset
([3,3], the same sentinel intra neighbours already produce). Gate both
above_filter and left_filter on above_ref/left_ref matching this
block's ref_frame.

Round 8's GOLDEN_FRAME unmask attempt with this ctx fix still produces
a real mismatch: a golden gate run 20x reproduces a frame-0 (intra
keyframe) luma diff against ffmpeg whenever GOLDEN_FRAME actually
fires later in the same stream (seeds 57, 59, both live-reproduced).
The ctx fix itself is not the cause -- decode_inter_block8 never
resolves switchable_interp context at all (it refuses non-LAST_FRAME
before reaching any filter code), so this bug is golden-adjacent
elsewhere, unproven past that. GOLDEN_FRAME stays a named refusal;
added the same EC_AV1_GATE_DUMP pin-on-mismatch pattern the CDF
forwarding gate already has to the golden gate test, and captured the
reproducing stream for the next round.

2026-08-27

fix(av1): clear apply_deblock for the GOLDEN residue, isolate to MCAhmet Kaan Gümüş · c672fef
fix(av1): clear apply_deblock for the GOLDEN residue, isolate to MC

Bisected the pinned 3-pixel GOLDEN-live residue against a patched
aomdec's pre/post-loop-filter frame dumps: our own decoder's luma is
already wrong at those exact 3 pixels before apply_deblock runs, byte-
identical to the loop filter's post-filter mismatch -- the wide
deblock kernel (round 6's suspect) is cleared. All 3 pixels sit inside
one skip=1 32x32 GOLDEN_FRAME NEWMV block, mv=(-7,-7) 1/8-pel (both
axes fraction 2/16), REGULAR/REGULAR resolved filter -- pure MC output,
no residual. The golden reference bytes that block reads are already
proven bit-exact (frames 0-2 match ffmpeg), so the defect is inside
mc::predict_with_filters's 2D convolution or filter-symbol resolution
for this exact combination, not yet isolated further this round.
Re-masked with an updated round-7 comment recording the bisect.
fix(av1): re-derive the GOLDEN_FRAME loop-filter residue, re-mask with a pinAhmet Kaan Gümüş · d02f017
fix(av1): re-derive the GOLDEN_FRAME loop-filter residue, re-mask with a pin

Un-masked decode_inter_block's GOLDEN_FRAME arm this round and re-ran the
forwarding + golden-reference gates: two real aomenc streams mismatched
(30-run forwarding gate: 4/30 real failures, all a real aomenc GOLDEN
stream, not the documented flake). Pinned one (seed 43, frame 3 luma) as
stream::tests::pinned_golden4_stream_decodes_pixel_exact (#[ignore]d) and
traced it: 3 of 4096 luma pixels off by exactly +-1, all inside the loop
filter's edge window at a GOLDEN_FRAME/LAST_FRAME block boundary. Hand-
checked lf_level's ref_deltas/mode_deltas arithmetic against spec 7.14.4
at that edge -- it matches the default table exactly, so the residue is
still open: a narrow deblock-kernel rounding defect, or a golden-side
pixel one filter tap upstream. Re-narrowed the mask (decode_inter_block's
GOLDEN_FRAME arm refuses by name again) and reverted
a_hand_built_golden_reference_refuses_by_name to its refusal-asserting
form -- no fix proven this round, but the pinned fixture and the
narrowed-down suspect (deblock edge, not lf_level's own math) carry
forward.
fix(av1): GLOBALMV loop-filter mode delta; mask GOLDEN behind its stacked defectAhmet Kaan Gümüş · ef03524
fix(av1): GLOBALMV loop-filter mode delta; mask GOLDEN behind its stacked defect

lane-av1golden2 round 5. The round-4 GOLDEN flip's hand-built fixture
proved the symbol path and a whole-pel skip copy -- the first real aomenc
GOLDEN streams through the live arm mismatched. Symbol-trace vs a patched
aomdec isolated one cause on the LAST_FRAME-reachable side: lf_level
applied mode_deltas[1] to every inter block, but spec 7.14.4's mode_lf_lut
maps GLOBALMV to mode_deltas[0]. Fixed by packing the GLOBALMV bit into
ref_grid's sign; that moved the forwarding gate's failure from seed 42
frame 1 to seed 48 frame 3 -- at least one more stacked defect on the
GOLDEN-live path, so the GOLDEN arm narrows back to a named refusal
(threading kept, unread) and the hand-built fixture now asserts the mask
by name instead of pixel exactness. A rare (~1/10..1/30) all-LAST
mismatch on the forwarding gate remains reachable even with the mask --
present with semantics identical to the previously pushed baseline --
pinned as this lane's next round.
feat(av1): flip the GOLDEN_FRAME refusal, proven by a hand-built OBU fixtureAhmet Kaan Gümüş · 5fb6ee3
feat(av1): flip the GOLDEN_FRAME refusal, proven by a hand-built OBU fixture

120+ real aomenc attempts never produced a decodable stream that fired
GOLDEN_FRAME before hitting an unrelated refusal first. A hand-built
3-frame stream (real key frame; a hand-coded intra "different content"
frame refreshing LAST_FRAME's slot; a hand-coded frame whose lone block
codes single_ref out to GOLDEN_FRAME and a skip zero-MV NEARESTMV) drives
decode_stream directly and is cross-checked against ffmpeg's own decode
of the identical wire bytes, 4 consecutive runs. decode_inter_block now
threads GOLDEN_FRAME to the golden_y/u/v planes already passed to it
instead of refusing every non-LAST_FRAME reference; LAST2/LAST3/BWDREF/
ALTREF2/ALTREF still refuse, unproven. intra_inter_ctx made pub(crate)
so the fixture can compute the exact context the decoder does.
guard(av1): GOLDEN decode stays refused until a stream proves it liveAhmet Kaan Gümüş · ed5f4c7
guard(av1): GOLDEN decode stays refused until a stream proves it live

The full single-non-LAST implementation stays (reference tree, MC
threading, mvstack filter, deblock ref deltas), but decode_stream
refuses GOLDEN narrowly again: 120 recipe attempts never produced a
decodable stream that actually fires the path, and an accepted-but-
unproven decode is the silent-miscode shape this repo does not ship.
The gate documents the refusal and the firing hunt continues.
feat(av1): decode a single non-LAST_FRAME reference (GOLDEN_FRAME)Ahmet Kaan Gümüş · 8a443b2
feat(av1): decode a single non-LAST_FRAME reference (GOLDEN_FRAME)

Round 2 continuation: read_single_ref threads the full single_ref_p1..p6
spec tree (context from the block's real above/left reference via
Neighbours::above_ref/left_ref, not a bare is_inter bool), decode_inter_block
threads a GOLDEN_FRAME picture down to motion compensation when the frame
header's ref_frame_idx[3] names a live DPB slot, and the deblock filter's
ref_frame_for_lf now indexes loop_filter_ref_deltas by the block's actual
reference instead of assuming LAST_FRAME for every inter block.

decode_stream widens its global-motion IDENTITY refusal to cover both
LAST_FRAME and GOLDEN_FRAME's own entries, and adds a reference_select
refusal (comp_mode/compound prediction stays out of scope; skip_mode is a
spec-guaranteed consequence of that same refusal, not a separate check).

mvstack's find_mv_stack candidate filtering and decode_inter_block8's
straddling-8x8 leaf path were already ref_frame-generic/LAST-only
respectively and needed no changes.

Gate: a_real_aomenc_inter_sequence_with_a_golden_reference_decodes_pixel_exact
(stream.rs) -- an 8-frame real-aomenc sequence with order-hint left on (the
one flag the sibling CDF-forwarding test disables specifically to suppress
GOLDEN_FRAME), asserting pixel-exact decode against ffmpeg whenever
decode::non_last_ref_hits() actually advances. Across the attempt budgets
tried this round, aomenc's RD never produced a stream that both fully
decoded under this crate's existing round-2 refusals AND picked
GOLDEN_FRAME -- the test SKIPs loudly rather than claim untested coverage,
same pattern as its cdf-forwarding sibling.

cargo test -p ec-av1 --release: 177 passed, 0 failed, 12 ignored.
fix(av1): use the drl-selected stack entry as NEWMV's base predictorAhmet Kaan Gümüş · f5ee53b
fix(av1): use the drl-selected stack entry as NEWMV's base predictor

decode_inter_block's NEWMV arm read the drl_mode bit (when the stack has
more than one entry) but discarded it and always based the predicted MV
on stack.entries[0] -- spec 5.11.24's read_drl_idx picks RefMvIdx via up
to two drl_mode reads, and 7.10.2.10's assign_mv bases NEWMV's PredMv on
entries[RefMvIdx], not always entry 0. Ported the same idx-selection loop
NEARMV already had (mirrored in both NEWMV arms: decode_inter_block and
the leaf8 decoder). Confirmed against a patched aomdec (read_drl_idx
trace) that libaom reads the identical number of drl bits per NEWMV
stack size -- the desync was purely which entry we fed to read_mv.

Verified against the round's pinned 4-frame stream (seed 44): frames 0-2
now decode pixel-exact against ffmpeg/aomdec (frame idx2 was the
decisive divergent case -- mi_row=4,mi_col=8 NEWMV column now matches).

Frame 3 (and the pre-existing a_real_aomenc_inter_sequence_with_cdf_
forwarding flake) still mismatches -- traced to a second, real defect:
mvstack.rs's IMMEDIATE_WEIGHT=2-per-cell approximation is only tied
between above/left neighbours for the fixed bw4==bh4==8 caller the
module doc assumes (tile.rs); decode.rs calls find_mv_stack with the
leaf's real (smaller/mixed) block size, where libaom's real weight
formula (`len * max(2, inc)`, scan_row_mbmi/scan_col_mbmi,
mvref_common.c) is *not* tied -- confirmed live against a patched
libaom at mi_row=4,mi_col=8/frame 3: real weights 660 vs 668 (raw 20 vs
28), ours ties both at 8, giving the wrong stack order and hence the
wrong DRL-selected entry despite an identical drl_mode bit value. This
is the module doc's own predicted gap ("A caller with mixed block sizes
would need the real weight formula; none exists today") now confirmed
reachable and needs a dedicated port of the real weight formula --
follow-up lane, not attempted here (budget).
fix(av1): give intra prediction its real neighbour reach, twenty call sitesAhmet Kaan Gümüş · 0c4687e
fix(av1): give intra prediction its real neighbour reach, twenty call sites

Twenty decode call sites passed Reach::none() where the block's actual
top-right/bottom-left availability belonged, so directional prediction
fell back to replicated corner samples wherever the true neighbours
existed. Found by three-checkpoint bisect (pre-deblock/between-passes/
post-deblock) against an instrumented aomdec: the deblock-corner
hypothesis died there -- the divergence entered with prediction's edge
array after all. The directional-chroma gate now fires and passes 4/4;
the full suite is green. The rare cross-frame chroma ±1 flake remains
(1/10 runs) -- a separate open defect, not masked here.
feat(av1): implement the intra edge filter/upsample (spec 7.11.2.7-2.9)Ahmet Kaan Gümüş · 645882d
feat(av1): implement the intra edge filter/upsample (spec 7.11.2.7-2.9)

r5 left directional()'s edge filter/upsample as an unimplemented corner-cut
and left the two new predict() bool params half-plumbed (encode.rs call
sites done, stream.rs/decode.rs test-module sites missing). This round:

- finished the plumbing: decode.rs threads the sequence header's
  enable_intra_edge_filter through a thread-local (ENABLE_EDGE_FILTER,
  set once per decode_key_frame_tile_with_cdfs call, not per-block --
  documented why a thread-local beats touching two dozen call sites)
  down to PlaneBuf::reconstruct's predict() call; stream.rs sets it from
  the parsed seq header; encode.rs sites already passed false (our
  encoder never turns it on, so round-trips stay bit-green regardless).
- filter_intra_edge (5-tap kernel, 3 strength buckets via
  intra_edge_filter_strength's two smooth/non-smooth threshold tables),
  the filter_corner blend, and upsample_intra_edge (av1_upsample_intra_edge_c)
  were transcribed against libaom's reconintra.c and wired into
  directional()'s z1/z2/z3 walk (base/shift math doubled for the
  upsampled-density case). All present, none stubbed.
- flipped the gate's --enable-intra-edge-filter=0 to =1 so
  a_real_aomenc_stream_with_directional_chroma_decodes_pixel_exact
  actually exercises the new path instead of the disabled one.

The gate still fails, but NOT from this filter: patched-aomdec
cross-checks (EC_UDUMP dqcoeff/pred/recon dumps, /tmp/libaom-src's
decodeframe.c, not committed) prove the failing TU (chroma cpx=0/cpy=0,
DC_PRED, tx_type DctDct, skip=1 both sides) reconstructs bit-identically
pre-loop-filter in both decoders -- flat 128 either way, edge filter
inapplicable there (no real neighbours, corner-filter's 2n>=24 gate
doesn't fire at n=8). A PREDEBLOCK/POSTDEBLOCK trace (also not committed)
localizes the actual divergence to apply_deblock: our decoder introduces
a value our own pre-filter data does not justify at the row6-9/col6-9
TU-corner intersection, where both a horizontal and a vertical deblock
edge are filtered back to back. r4/r5's "intra edge filter gap" and
"tx_type path" suspects are both now falsified for this failure; the
next round's target is deblock_plane's edge-intersection order/read-back
(vertical-then-horizontal at a corner where an already-filtered vertical
sample feeds the horizontal filter's taps).

Suite: 174 passed, 1 failed (the known gate above) -- no regression from
r5's own checkpoint of the same numbers; the cdffwd flake did not fire
this run.
wip(av1): chroma tx_type derivation from Intra_Mode_To_Tx_Type, wires default_tx_typeAhmet Kaan Gümüş · 637d48a
wip(av1): chroma tx_type derivation from Intra_Mode_To_Tx_Type, wires default_tx_type

read_coeffs already carried a default_tx_type parameter from a prior round;
both call sites (read_plane's intra path and read_inter_plane's inter path)
didn't pass it yet, so the tree didn't compile. Wires them:

- read_plane (intra): plane_idx==0 or side>=32 -> DctDct (av1_get_tx_type,
  blockd.h: 64-and-up is unconditional, 32x32 chroma survives
  intra_mode_to_tx_type only to be re-forced by EXT_TX_SET_DCTONLY gating
  in av1_get_ext_tx_set_type); otherwise chroma takes
  default_intra_tx_type(predict_mode), a from-libaom transcription of
  intra_mode_to_tx_type's static table (D45_PRED is DCT_DCT, not an ADST
  mode -- transcribed exactly, no set-membership fallback needed since
  every entry the table can produce (DCT_DCT/ADST_DCT/DCT_ADST/ADST_ADST)
  is already inside both TX_SET_INTRA_1 and _2).
- read_inter_plane: always DctDct -- Intra_Mode_To_Tx_Type only applies to
  an intra block's chroma plane per av1_get_tx_type's own is_inter branch.

Cross-checked against a live patched aomdec (EC_CHROMA_TXTYPE trace in
/tmp/libaom-src/av1/decoder/decodetxb.c, not committed here) on the
lane's own seed-42 aomenc fixture: every uv_mode -> tx_type pair libaom
picked for this stream's chroma matches default_intra_tx_type exactly.

Suite: 174 passed, 1 failed (the new
a_real_aomenc_stream_with_directional_chroma_decodes_pixel_exact) --
NOT the pre-existing cdffwd flake. Confirmed the failure predates and
survives this fix: reverting default_tx_type to always-DctDct made the
mismatch start at pixel row 0 (whole-plane wrong); with this fix it
starts at row 6 and grows outward in a triangular fan, meaning the
tx_type choice is not itself wrong (matches libaom's own choice
byte-for-byte) but something downstream of it -- reconstruction/
directional-prediction propagation -- still diverges. Left failing,
not silenced or adjusted, for the next round to chase with the two
named suspects (intra edge filter gap, this tx_type path) now narrowed
to one.
Merge branch 'lane-av1tx4': TX4 luma decode and the 1D transform classesAhmet Kaan Gümüş · 843a5a8
Merge branch 'lane-av1tx4': TX4 luma decode and the 1D transform classes

Seven rounds: TX4 coefficient tables (transcription cross-verified),
V_DCT/H_DCT scan orders and the class-split eob_pt CDF, the leaf8
scan-table fix, and a gate that fires the class-1 path on real aomenc
bytes and decodes pixel-exact. The tx-class lesson: a transform class
is a cross-cutting dimension -- scan, eob table, and context each
carry it.
feat(av1): gate the V_DCT/H_DCT class-1 path on real aomenc bytesAhmet Kaan Gümüş · 5147651
feat(av1): gate the V_DCT/H_DCT class-1 path on real aomenc bytes

The sub-8 refusal verdict, the fixture recipe, and a tx_class1_hits
counter: a min/max-partition-8 horizontal-stripe stream fires H_DCT
through the class-split eob path and decodes full-frame pixel-exact
vs ffmpeg, 4/4 runs.
fix(av1): TX4/TX8 eob_pt CDF is class-split (V_DCT/H_DCT vs 2D)Ahmet Kaan Gümüş · ea55462
fix(av1): TX4/TX8 eob_pt CDF is class-split (V_DCT/H_DCT vs 2D)

libaom's av1_default_eob_multi{16,64}_cdfs carry a [2] dimension this
decoder never read: TX_CLASS_2D vs TX_CLASS_HORIZ/VERT. Read order
(all_zero -> tx_type -> eob) verified against decodetxb.c's
read_coeffs_txb; the class-1 tables transcribed from token_cdfs.h and
checked value-for-value. Wired only where TX_SET_INTRA_1 (the 7-type
set carrying V_DCT/H_DCT) is reachable: Luma4/Luma4Set1/Luma8/Luma8Set1.

Verified: full ec-av1 suite green (172 passed), and a synthetic
8x8-partition intra stream now exercises H_DCT (tx_type=3) through
read_eob's class1 branch without desyncing before an unrelated,
pre-existing refusal later in the same frame (small-partition support
is a separate gap, not this one).

Removed the scratch probe_tx4.rs example used to drive this check.
fix(av1): V_DCT/H_DCT coefficient scan order + TX4 leaf8 scan table mixupAhmet Kaan Gümüş · 700543b
fix(av1): V_DCT/H_DCT coefficient scan order + TX4 leaf8 scan table mixup

Two real desync causes past r3's tx-class context-derivation fix:

1. read_coeffs always read coefficients in the default zigzag scan
   regardless of tx_type. libaom's V_DCT/H_DCT classes use Mrow_Scan/
   Mcol_Scan instead (scan.c av1_scan_orders index 10/11) -- decoded
   here as class_scan_table: V_DCT's class-scan is our grid's own
   natural row-major order (0..N), H_DCT's is that walk transposed.
   base_ctx/br_ctx's row/col-offset formulas (r3's fix) were already
   correct; only the scan order feeding position/row/col into them
   was wrong.

2. decode_leaf8's TX4 split loop (an 8x8 leaf's tx_depth=1 case) read
   its four 4x4 luma transform units with `scans.0` -- the leaf's own
   *8x8* scan table (64 entries) -- instead of `scans.1` (the 4x4
   table), so `pos` values up to 63 got written into a 16-cell grid.
   Pre-existing bug, only reachable/visible once (1) stopped eating
   the stream earlier.

5-scale probe (examples/probe_tx4.rs, /tmp/tx4work/s*.obu) moved
past every prior refusal point to new, later ones (scale 1.5 now
refuses on "a directional chroma mode (round 2)" instead of an
angle_delta/partition desync) -- real progress, not yet clean;
next round needs the same trace-correlation to chase the remaining
divergence(s). Suite green 172/172.
feat(av1): interpolation filters beyond REGULAR, incl. per-block SWITCHABLEAhmet Kaan Gümüş · 10f24e6
feat(av1): interpolation filters beyond REGULAR, incl. per-block SWITCHABLE

The ~13% decodes-but-wrong inter flake was a whole missing filter
family: motion compensation always used the REGULAR subpel tables,
while real encoders pick SMOOTH/SHARP per frame -- or SWITCHABLE,
reading a per-block filter symbol pair this decoder never read (the
silently-unread class again; our own encoder writes one fixed filter).
All four table sets land in mc.rs with an aomdec-pinned unit test, the
switchable_interp CDFs and neighbour context follow libaom's
read_mb_interp_filter, and the filter threads from the frame header
through both inter block paths. The forwarding gate ran 10/10 with
zero pixel mismatches and no vacuous skips.
feat(av1): the seven-type TX_SET_INTRA_1 tx_type row, V_DCT/H_DCT, gate firesAhmet Kaan Gümüş · 2411791
feat(av1): the seven-type TX_SET_INTRA_1 tx_type row, V_DCT/H_DCT, gate fires

A reduced_tx_set=0 frame's 8x8-and-under intra transforms read tx_type
from the seven-symbol TX_SET_INTRA_1, not the five-symbol reduced row
our tables carried (the row-held-constant class, on the tx-set
dimension -- our own encoder always writes reduced_tx_set=1, the same
writer-never-needs-it trap as mv_hp). New set-1 CDF row, the set-1
symbol order from av1_ext_tx_inv, and the V_DCT/H_DCT inverse
transforms (one-axis DCT, identity on the other). The tx-select gate
now actually FIRES: mandelbrot content at min-partition 16 splits
16x16 blocks into TX8 TUs that read the set-1 rows and decode
pixel-exact vs ffmpeg, 4/4 runs, no skips. Resolved 4x4 luma stays a
named refusal (no TX4 coefficient tables yet).
wip(av1): finish the txb_skip 7-context rewire; find TX16 tx_type mismatchAhmet Kaan Gümüş · dcf1147
wip(av1): finish the txb_skip 7-context rewire; find TX16 tx_type mismatch

Adds the luma_skip_ctx debug trace and a partition_w16 trace print (both
gated behind EC_AV1_TRACE) used to bisect the pinned mb.obu stream against
a fprintf-instrumented aomdec build. The 7-context txb_skip rewire itself
(cdf.rs/cdf_state.rs/decode.rs, prior round) compiles and the whole ec-av1
suite is green, but the pinned stream still desyncs: tracing symbol-by-
symbol against real aomdec's EC_TXBCTX/EC_TXBSKIP/EC_TXTYPE_VAL output
shows the two decoders already disagree on a NON-split 16x16 block's own
tx_type (mi_row=4,mi_col=0 in the second superblock quadrant: real reads
tx_type=3 off a reduced 5-symbol intra set, txs_ctx=2/tx_set_type=2/eset=2;
ours reads tx_type=2) -- upstream of the txb_skip multi-TU logic this round
targeted, and not fixed by it. tx_size_context/get_txb_ctx_general/
SKIP_CONTEXTS were all checked byte-for-byte against libaom's
av1/common/txb_common.h and match.

The gate (a_real_aomenc_intra_stream_with_tx_select_decodes_pixel_exact,
stream.rs) is not wired to this recipe: it still passes today only via its
own soft-skip path (every attempt either refuses or never resolves a split
tx_depth), so wiring it now would just turn a silent skip into the same
real failure traced above. Left unwired until the tx_type mismatch is
fixed.
feat(av1): read tx_depth under TxMode::Select on key framesAhmet Kaan Gümüş · ab94637
feat(av1): read tx_depth under TxMode::Select on key frames

Threads a tx_select flag through decode_key_frame_tile's block walk so an
intra frame using TxMode::Select reads the tx_depth symbol (cat0..3 CDFs,
tx_size_context) instead of assuming TxMode::Largest, resolving to a
per-TU split-luma decode path when the block's transform is smaller than
its own side. A resolved 4x4 luma transform still refuses by name (no 4x4
coefficient tables yet). Narrows the old whole-stream TxMode::Select
refusal to inter frames only, since decode_inter_frame's block loop does
not thread tx_select yet.

Adds tx_depth_hits() (before/after counter, same pattern as
filter_intra_hits/deblock_hits) and a real-aomenc gate test proving a
split transform actually decodes pixel-exact against ffmpeg -- currently
SKIPs (no fixture recipe found in this session reliably lands a stream
that both avoids this decoder's other named round-2 gaps and resolves a
tx_depth split without exhausting to 4x4); it never fails, so the suite
stays green while that fixture search continues.

Investigated a reported suite regression on this branch first: it does
not reproduce against this diff -- the cdf-forwarding inter-sequence gate
(a_real_aomenc_inter_sequence_with_cdf_forwarding_decodes_pixel_exact)
fails at the same ~17% rate with this diff fully reverted, confirmed over
30 stashed runs on HEAD. Pre-existing flake, not a regression.
wip(av1): Neighbours groundwork for TxMode::Select's per-TU luma contextAhmet Kaan Gümüş · 1ee1fd3
wip(av1): Neighbours groundwork for TxMode::Select's per-TU luma context

record_mi_luma/record_split_luma split the existing whole-block record()/
record_mi() into a per-transform-unit luma coefficient-context write plus
a once-per-block mode/side/chroma write, which a depth-selected luma
transform (smaller than its own coded block) needs and the current
always-full-size path does not yet exercise. Unused for now (dead_code
warnings, same as the pre-existing skip_at) -- the tx_size symbol read,
CDF tables, decode_block/decode_leaf8 wiring, and the stream.rs refusal
narrowing are still open; see HANDOFF in the ledger.
feat(av1): read the mv_hp/class0_hp bits real hp streams carryAhmet Kaan Gümüş · e192a62
feat(av1): read the mv_hp/class0_hp bits real hp streams carry

The dropped-as-dead half-pel MV CDFs (our own writer never sets
allow_high_precision_mv) were silently unread on foreign streams whose
headers set the flag -- every later symbol shifted one bit, the same
silently-unread-symbol shape as use_filter_intra. Tables restored,
reads gated on the frame header's flag, plumbed through the inter tile
path. On the pinned forwarding stream frame 3's desync drops from
2618 wrong luma pixels (worst 35) to 541 (all within 1, chroma exact)
-- entropy now aligned, a luma-only reconstruction residue remains.
test(av1): trace inter-block mv/skip; restructure the cdf-forwarding gate as a seed loopAhmet Kaan Gümüş · 82a96d2
test(av1): trace inter-block mv/skip; restructure the cdf-forwarding gate as a seed loop

decode_inter_block now prints its skip/mv/is_new_mv decision under
EC_AV1_TRACE, matching the key-frame path's existing tracing -- needed to
diff against an instrumented aomdec when chasing the cdf-forwarding
mismatch (still open: pinned streams show frame N+1's second same-context
partition_w32 read choosing a different split than aomdec once frame N's
forwarded, count-reset table has adapted through one prior read at that
context, implying the forwarded state itself already differs going into
the frame -- root cause not yet found).

The cdf-forwarding gate now retries several aomenc seeds (RD is
non-deterministic run to run) and requires the first stream that decodes
to be pixel-exact, rather than depending on one fixed seed's RD choice.
fix(av1): reset every CDF's symbol counter before saving it forwardAhmet Kaan Gümüş · 6404564
fix(av1): reset every CDF's symbol counter before saving it forward

Spec 7.20 save_cdfs (libaom av1_reset_cdf_symbol_counters, entropy.c)
zeroes each table's adaptation-rate counter before storing the tile's
end-of-tile state into a reference slot for cross-frame forwarding --
the probabilities carry forward, the counts do not. This decoder was
forwarding the raw counts, so every table an inter frame resumed from
adapted faster than the real decoder's for the rest of that frame: too
small a drift to flip a symbol after one hop, but compounding across
two into a genuine desync (a pinned aomenc stream showed frame 0/1
pixel-exact, then ~60% of frame 2's luma wrong by +-1 once the drift
caught up).

crates/ec-av1/src/cdf_state.rs adds Cdfs::reset_counts (and the
MvComponentCdfs half it delegates to), zeroing the last entry of every
adapting array without touching its probabilities.
crates/ec-av1/src/stream.rs calls it on the saved (non-
disable_frame_end_update_cdf) branch only, matching libaom's REFRESH_
FRAME_CONTEXT_BACKWARD path; the disable_frame_end_update_cdf branch
already stores the untouched loaded state, which needs no reset.

The forwarding-gate test is still flaky, but no longer on this bug: a
20-run sample after the fix shows zero pixel-mismatch failures (the
class this commit targets); every failure left is a variant of the
same pre-existing, already-documented round-2 refusal (aomenc's RD
search occasionally choosing a reference other than LAST_FRAME or a
partition/tx-type this decoder does not model), unaffected by CDF
state. Full `cargo test -p ec-av1 --release` here: 170 passed, 1
failed (that same refusal), 12 ignored.
feat(av1): GLOBALMV under identity warp; the real inter gap was CDF forwardingAhmet Kaan Gümüş · 74ed1bd
feat(av1): GLOBALMV under identity warp; the real inter gap was CDF forwarding

The 'partition type' refusal on real inter streams was misattributed:
the tile's first partition symbol came back out-of-alphabet because a
real encoder's inter frame loads its initial CDF state from the
previous frame's adapted tables (primary_ref_frame + load_cdfs, spec
7.20) and this decoder starts every frame from the spec defaults. The
deblocked inter-sequence gate now encodes with error-resilient frames
(primary_ref_frame = NONE, a shape real low-latency encodes use) and
decodes pixel-exact. GLOBALMV decodes as the zero vector under the
IDENTITY warp model, with a named refusal for any other model.
feat(av1): implement the spec 7.14 in-loop deblocking filterAhmet Kaan Gümüş · 66b41fc
feat(av1): implement the spec 7.14 in-loop deblocking filter

Fixes the two decode_key_frame_tile/decode_inter_frame_tile call sites in
stream.rs (a prior round added the LoopFilterParams parameter without
threading it through), then ports libaom's edge-level decision
(av1_loopfilter.c) and pixel kernels (aom_dsp/loopfilter.c: filter4/6/8/14)
restricted to this decoder's own invariants -- uniform level only (no
segmentation/delta_lf, already refused upstream), and transform size always
equal to block size, which collapses the PU-edge/TU-edge distinction and the
both-sides-skipped suppression away entirely.

Applied after tile reconstruction and before apply_cdef in both frame
paths. Our own encoder never sets a nonzero loop_filter.level, so every
existing round-trip is unaffected (verified: encode.rs never touches
LoopFilterParams, suite green at 170/0/12).

New gate: a_real_aomenc_intra_stream_with_deblocking_decodes_pixel_exact
(pixel-exact vs ffmpeg, deblocking on, CDEF off, deblock_hits() counter
proves the filter fired) and its inter-sequence counterpart, which SKIPs on
this box -- the same real-aomenc stream hits a pre-existing partition-type
gap this lane's decoder doesn't cover (lane-av1-rect territory per
decode.rs's own module doc), not a deblocking defect.
fix(av1): filter-intra was already correct -- gate against a real aomenc streamAhmet Kaan Gümüş · 2adf290
fix(av1): filter-intra was already correct -- gate against a real aomenc stream

The straddling-boundary mismatch against ffmpeg's decode was never the
filter-intra predictor: it's a real AV1 deblocking-filter artifact, and
this decoder has no in-loop deblocking at all. `--loopfilter-control=0`
on the aomenc fixture makes the two decodes byte-exact with zero source
changes to intra.rs/decode.rs's prediction math.

Adds a permanent gate (crates/ec-av1/src/stream.rs) that shells out to a
real standalone aomenc build (ffmpeg's own libaom-av1 wrapper on this box
doesn't expose enable-tx-size-search/loopfilter-control through
-aom-params), asserts the use_filter_intra symbol actually fired via a new
process-global counter (decode::filter_intra_hits), and checks pixel-exact
luma/U/V against ffmpeg's own decode of the identical bytes. The
encoder's screen-content-tools decision is a real internal PSNR trial,
occasionally flips even with palette/intrabc off; the test skips (not
fails) the still-unsupported-gap runs the same way the existing CDEF gate
test does.
feat(av1): filter-intra predictor (spec 7.11.2.3), refusal liftedAhmet Kaan Gümüş · f90ea1e
feat(av1): filter-intra predictor (spec 7.11.2.3), refusal lifted

Recursive filter intra: 4x2 sub-blocks, the 7-tap av1_filter_intra_taps
table, five modes. use_filter_intra==1 blocks now predict instead of
erroring. Existing suite green; the real-stream gate that proves the
path against ffmpeg lands next.
Merge branch 'lane-av1inter8': inter frames at 8x8-leaf straddle sizesAhmet Kaan Gümüş · b3bcc7e
Merge branch 'lane-av1inter8': inter frames at 8x8-leaf straddle sizes

Extends the mod-32==8 straddle path to inter frames end-to-end
(encoder, tile writer, decoder), and fixes the subpel filter selection
mc.rs shared with every consumer: blocks 4 wide or tall take the 4-tap
table. The 640x360 inter sequence round-trips through ffmpeg
pixel-exact.
feat(av1): finish CDEF in-loop filter (spec 7.15), close r1's borrow errorAhmet Kaan Gümüş · 8425e46
feat(av1): finish CDEF in-loop filter (spec 7.15), close r1's borrow error

r1 left decode.rs with a full CDEF port (direction search, primary/
secondary taps, damping, chroma) but an E0502 borrow (closures captured
`y.width`/`y.true_*` while `y` was mutably borrowed by the filter call) and
several test call sites at the old decode_key_frame_tile/decode_inter_frame_tile
arity. Fixed the borrow by copying the plane's stride/extent into locals
before the closures, and threaded &CdefParams::default() through every
in-crate test caller.

Verified two real correctness bugs against libaom's cdef_block.c/cdef.c
while porting:
- is_skip_txfm only read one of the four 4x4 mi cells an 8x8 CDEF unit
  covers; libaom's is_8x8_block_skip requires all four skip (a sub-8x8
  partition can straddle the unit with mixed skip flags).
- av1_cdef_filter_fb zeroes the shared `dir` per plane when *that plane's
  own* frame-level primary strength is 0 (`pri_strength ? dir : 0`),
  independent of the per-block adjusted strength and of the other plane;
  the port was passing the same nonzero dir to both.

New hard test (a_real_libaom_gradients_stream_with_cdef_decodes_pixel_exact)
encodes a real libaom-av1 stream with CDEF left on (no -enable-cdef 0) and
asserts pixel-exact against ffmpeg's own decode -- passed first run after
the two fixes above. Full cargo test -p ec-av1 --release: 166 passed, 0
failed, 12 ignored.
feat(av1): extend the 8x8-leaf straddle path to inter framesAhmet Kaan Gümüş · cc290f5
feat(av1): extend the 8x8-leaf straddle path to inter frames

Mirrors lane-av1-rect's key-frame 16x16-straddles-one-axis -> up-to-two
8x8-leaf path (code_square side==8, tile.rs write_leaf8) on the inter
side: code_square_inter takes a `side` param (8 or 16) and picks
Luma8Inter/Chroma4 or Luma16Inter/Chroma8 accordingly; the encoder's
inter loop builds `eight` leaves per straddling 16x16 the same way the
key-frame search does, each leaf's own NEARESTMV mv-stack window at
2x2-mi; the tile writer (write_inter_frame_leaf8) and decoder
(decode_inter_block8) mirror that leaf-by-leaf, with the same
prev_leaf skip/intra-inter context override write_leaf8 uses for mode
context (Neighbours' above/left arrays only resolve to SUB=16
granularity). New TxbSet::Luma8Inter/INTER_TX_TYPE_SET3_8 CDF
(libaom default_inter_ext_tx_cdf[EXT_TX_SET_DCT_IDTX][TX_8X8] = 4167,
distinct default+adaptation state from the 16x16/32x32 rows already
carried).

Encoder-side round-trips clean (both-axis-cut still refuses correctly);
a real multi-frame decode round-trip through ffmpeg desyncs starting
at the third coded frame (the second inter frame, U plane) -- logged
as an open dead-end for the next round, not chased further this round.
fix(av1): read the unread use_filter_intra flag; audit the same blindness classAhmet Kaan Gümüş · beeeec5
fix(av1): read the unread use_filter_intra flag; audit the same blindness class

lane-av1real r10 added the FILTER_INTRA/FILTER_INTRA_MODE CDF tables and
Cdfs fields but stopped mid-wiring; this finishes threading
enable_filter_intra (from the sequence header) through decode_key_frame_tile
-> decode_block/decode_leaf8 -> read_intra_mode, which now reads
use_filter_intra after DC_PRED at <=32x32 (spec 5.11.14,
av1_filter_intra_allowed) and refuses use_filter_intra==1 blocks (this
decoder does not implement the 5.11.14 recursive predictor) rather than
silently miscoding.

The pinned CfL stream's actual bug was exactly this: its block reads
use_filter_intra=0, so the flag's own bits were never consumed before,
desyncing every later symbol read self-consistently -- both the Python
cross-checks and debug aomdec traces shared that blindness. With the flag
read, the pin decodes pixel-exact (luma/U/V) against ffmpeg, and the
previously-#[ignore]d a_real_libaom_cfl_stream_decodes_pixel_exact test now
passes green with no split needed.

Blindness-audit sweep of read_intra_frame_mode_info (libaom decodemv.c)
found three more per-block/per-superblock symbols this crate silently never
reads while accepting the header fields that would gate them:
allow_screen_content_tools (intrabc/palette_mode_info), delta.q_present/
delta.lf_present (per-SB delta_q/delta_lf), and segmentation.enabled
(per-block segment_id) -- named refusals added in decode_stream next to the
existing CDEF/TxMode::Select refusals.

Full ec-av1 suite: 165 passed, 0 failed, 12 ignored.
debug(av1): r8 clears tile-offset and mode_info as the pinned CfL stream's bugAhmet Kaan Gümüş · fc77857
debug(av1): r8 clears tile-offset and mode_info as the pinned CfL stream's bug

Independent from-spec OBU/frame-header parse in Python derives the tile
group's start at byte 23 (obu_header -> leb128 -> full sequence_header ->
full uncompressed_header bit-by-bit); EC_AV1_TRACE's new key_tile_bytes
line proves decode_stream's obu_offset + tile.offset feeds decode_key_frame_tile
that same byte 23, and r7's python literal agrees -- three-way match.

Extended EC_AV1_TRACE to partition/skip/y_mode/uv_mode (decode.rs
read_intra_mode + both partition sites) and cross-checked against an
independent Python MSAC decoder whose partition_w32/kf_y_mode/uv_mode_cfl
CDF literals this round re-verified byte-for-byte against
/tmp/libaom-src/av1/common/entropymode.c (not inherited from a prior
round): partition=NONE, skip=0, y_mode=DC_PRED, uv_mode=DC_PRED, matching
ours exactly. Both r8 hypotheses from r7's handoff are falsified -- the
bitstream genuinely codes DC_PRED with a near-zero residual for this
block, and our decode of that is bit-exact. ffmpeg's real output (a
smooth diagonal gradient) cannot come from that symbol sequence under any
correct DC_PRED reconstruction, so the desync is downstream of symbol
decode entirely: intra prediction or the inverse-transform/dequant path.
Traces kept (not fixed yet); ignore reason on the pinned CFL test points
r9 at crate::intra::predict and dequant_and_inverse_typed.
debug(av1): symbol-level trace clears the coefficient decode, narrows the CfL desync upstreamAhmet Kaan Gümüş · 924ba44
debug(av1): symbol-level trace clears the coefficient decode, narrows the CfL desync upstream

lane-av1real r7: added an EC_AV1_TRACE-gated trace to read_coeffs/read_eob
and cross-checked the pinned CfL stream's entire Luma32 base/base_eob/br
sequence against an independent Python decoder (real libaom default CDFs
extracted from token_cdfs.h, get_nz_mag/get_nz_map_ctx_from_stats/get_br_ctx
ported from txb_common.h, not from this crate's own code). Every symbol
(ctx, value) matches ours bit-for-bit: eob_pt=5, eob_extra=1, eob=15,
base_eob ctx=1→1, then base ctx sequence 21/21/21/21/6/6/6/7/7/6/6/1/2/0
with values 0,0,0,0,0,0,0,0,2,0,0,0,2,2 -- three nonzero levels (all
magnitude 2) at pos 0/1/2, dc_sign ctx=0→negative. The coefficient decode
and its context arithmetic are proven correct for this stream.

The mismatch is downstream: dequant_and_inverse_typed on those exact levels
(base_q_idx=60) produces a near-flat residual (row0 barely varies, rows
1-31 replicate it, matching what a DCT with energy confined to row 0 should
do) landing luma at a uniform ~126 against ffmpeg's real ~50-and-varying
output -- too large a gap for three magnitude-2 coefficients to ever close,
even correctly transformed. That points to a desync *before* this trace
starts (mode_info: partition/skip/y_mode/uv_mode, or the tile-group byte
offset itself), not to the coefficient syntax this round instrumented.
r8 should trace mode_info symbols the same way and cross-check tile-group
start offset against the frame/OBU header parse, rather than the
coefficient loop.

Trace code is env-gated (EC_AV1_TRACE) and left in place, off by default,
for r8 to reuse. CfL test stays #[ignore]d with an updated note.
wip(av1): CfL CDFs, alpha reads, and prediction math — r2 checkpointAhmet Kaan Gümüş · e37bffe
wip(av1): CfL CDFs, alpha reads, and prediction math — r2 checkpoint

CfL sign/alpha CDFs converted from AOM_ICDF storage, read_cfl_alphas
wired, cfl.c subsample/average/alpha math ported. The pinned CfL-stream
gate stays ignored: its LUMA decodes near-flat where ffmpeg shows a
gradient, so a bug upstream of the chroma math remains — r3 isolates.
feat(av1): decode ADST_ADST/ADST_DCT/DCT_ADST/IDTX intra transformsAhmet Kaan Gümüş · a170052
feat(av1): decode ADST_ADST/ADST_DCT/DCT_ADST/IDTX intra transforms

Ports av1_iadst4/8/16 and av1_iidentity4/8/16/32 from libaom's own
av1_inv_txfm1d.c (stage-for-stage, not hand-derived), wires TxType
through read_coeffs -> dequant_and_inverse_typed, and lifts the
DCT_DCT-only refusal for TX_SET_INTRA_2's five members. Axis
convention (row=htx_tab, col=vtx_tab) read directly off libaom's
av1_inv_txfm2d.c tables and gated by an asymmetric-input test.

Reference vectors for the 1D ports came from a C probe linked
against libaom's own build/decoder-debug/libaom.a, not memory.
fix(av1dec): decode a real (non-straddle) SPLIT of a 16x16 leaf, fix the whole-64x64-superblock dequant scaleAhmet Kaan Gümüş · 761f32c
fix(av1dec): decode a real (non-straddle) SPLIT of a 16x16 leaf, fix the whole-64x64-superblock dequant scale

decode_stream on real libaom-produced streams hit "partition below 16x16"
on over half of a cpu/crf sweep -- the key-frame tile decoder only handled
SPLIT-to-8x8 when the true frame edge forced it (lane-av1-rect straddle
case), refusing the same split when RD picked it on an interior 16x16.
Reuses the already-tested decode_leaf8 recursion unconditionally instead.

Separately, that fix exposed a live bug in the TX_64X64 zero-pad path:
read_plane built a tx_side x tx_side (32x32) dequant grid and called
dequant_and_inverse/reconstruct with tx_side, both wrong -- dqDenom
(spec 7.12.3) is keyed by the true 64 transform size, not the 32x32
coded corner, and only a quarter of the block was ever reconstructed.
The corner now goes into the top-left of a side x side (64x64) grid,
inverse-transformed and reconstructed at the true size.

gate: cargo test -p ec-av1 --release -- 155 passed, 0 failed, 10 ignored (unchanged from baseline)
feat(av1dec): teach the decoder the 8x8-leaf straddle path, lift the RD guardAhmet Kaan Gümüş · ca24626
feat(av1dec): teach the decoder the 8x8-leaf straddle path, lift the RD guard

decode.rs's key-frame partition walk now mirrors write_leaf8: at a
straddling 16x16 (exactly one axis in-frame at the 16 level), it reads
the gathered split bool, then per in-frame 8x8 leaf reads partition_w8
NONE and decodes mode + Luma8/Chroma4 coefficients (decode_leaf8),
carrying the mi-precise Neighbours split (above_side_mi/left_side_mi,
record_mi/around_mi/partition_ctx_mi) already used for the coefficient
context, and mirroring the r15 above_mode/left_mode writeback rule from
the last leaf.

40x32 and 640x360 key frames decode byte-exact against the encoder's
own reconstruction, and 40x32 agrees with ffmpeg. With the read path
proven, encode.rs's `!has_leaf8` RD-cost guard is lifted: leaf8 can now
win on cost anywhere, not just when forced by an illegal whole block.
Full gate: 155 passed, 0 failed, 10 ignored.
feat(av1dec): public decode_stream OBU walker, bench decode row, NEARMV liftAhmet Kaan Gümüş · 16b0ce0
feat(av1dec): public decode_stream OBU walker, bench decode row, NEARMV lift

decode_stream(&[u8]) walks a raw AV1 stream via ec-av1-syntax's Av1Parser,
extracts each Frame OBU's header + tile payload and dispatches to the
existing decode_key_frame_tile/decode_inter_frame_tile, threading a
single-slot DPB -- the first real entry point that does not need Encoded's
pub(crate) fields. ec-bench's av1 row now times decode_stream instead of
reporting "no decoder present". decode_inter_block also reconstructs NEARMV
(mvstack already carries the second stack candidate), tested by hand-driving
a symbol stream since this crate's own encoder never chooses that mode.