forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on dfeffbcebd64426ceeebbf03214c8d6fe57282d6Filtered to crates/ec-vp9/src/inter.rsClear filter

2026-09-18

vp9: decode inter-frame pixels byte-exactly (MC, residual, loop filter, ref slots)Ahmet Kaan Gümüş · 83125b4
vp9: decode inter-frame pixels byte-exactly (MC, residual, loop filter, ref slots)

decode() no longer refuses inter frames. New mc.rs ports libvpx's inter
predictor: umv-border MV clamping, per-block reference border extension
(build_mc_border), the direct path window read, the four 8-tap/bilinear
convolve kernels, compound averaging and average_split_mvs. decode.rs gains
the prediction/residual/reconstruction driver, an 8-slot reference DPB that
stores each frame at its 64-aligned extent after the loop filter, and the
skip/skip_inter loop-filter mask rules.

Byte-exact against a locally built libvpx 1.15 oracle: the 1080p single-tile
inter stream (3/3 frames), both static fixture GOPs (48 frames at 1080p and
2160p), the altref stream (60/60) and a two-tile-column stream (3/3). Loop
filter verified separately by per-superblock mask identity (0 of 510 SBs
differ) and by edge-set containment. A 120-frame 60fps stream decodes
identically through frame 71 and hits an open entropy desync at frame 72,
filed in lanes/vp9pix.report.md with its disposition.

Also fixes a two-entry mv_ref_list overflow in the merged inter syntax path:
the successful second candidate add inside the different-reference loop is a
goto Done in libvpx and must leave the loop; without the break a later
candidate wrote past the list (the altref fixture panicked at frame 14).

Refusals kept/added by name: intra-only, other profiles, other subsamplings,
a reference whose coded size differs from the current frame, odd dimensions.

2026-09-17

Merge lane-vp9-inter: VP9 inter syntax next to tile-row byte-exactnessAhmet Kaan Gümüş · 9f13c77
Merge lane-vp9-inter: VP9 inter syntax next to tile-row byte-exactness

Both sides descend from 43c9c913 and both touched the tile/context setup, so
decode.rs and modes.rs conflicted. Resolved by combining:

- decode.rs keeps the tile-row work's signatures: decode_block and
  decode_partition no longer carry tile_row_start, so the inter lane's
  read_inter_block_info and its own tile walk thread tile_col_start alone,
  and decode_block's keyframe call passes the whole FrameContext (&self.ctx)
  as the tile-row revision does. The inter parse path is semantically
  unchanged: it allocates a fresh MiState per tile, so a frame-scoped
  above-availability gate sees no decoded cell above that tile's own
  row_lo, exactly what the dropped tile_row_start gate saw.
- modes.rs keeps the tile-row frame-scoped MiState::above_mi (mi_row != 0)
  AND the inter lane's new MiState::at() helper.
- The inter walk's tile loop drops the tile_row_start argument it passed to
  decode_partition; inter.rs's InterBlockCtx loses its tile_row_start field.

Folded in (verifier policy finding): scratch_interdump.rs FAILS when
INTER_IVF is explicitly set to a file that does not exist; the loud SKIP is
kept only for the unset default.

Evidence on the merged tree: cargo test -p ec-vp9 green (18 suites, 27
passed, keyframe_exact 4/4 incl. inter_is_named_unsupported); cargo check
--all-targets adds no warning beyond the 5 baseline ones; inter gate
1213/1851 blocks; tr/tr2/w1366/h242 sweeps each "RESULT 3 of 3 frames
byte-exact"; explicit-missing-fixture run fails as required.
vp9kf: VP9 inter-frame syntax parses block-for-block identical to libvpxAhmet Kaan Gümüş · 834983e
vp9kf: VP9 inter-frame syntax parses block-for-block identical to libvpx

Slice 1 of inter-frame support: an inter frame is now parsed end to end
(compressed header, mode info, MVs, references) and every block matches
libvpx 1.15's own instrumented decoder on the test stream - frame 1
1213/1213, frame 2 1851/1851 on row/col/bsize/tx/mode/skip/seg/ref0/ref1/
interp/MV - with the frame-1 compressed header bit-identical (1200/1200
bools) and frame 2 likewise.

Causes closed while getting there, each ported from libvpx with its line:
update_mv_probs is MV_UPDATE_PROB + seven literal bits + (lit<<1)|1, NOT
diff_update_prob; keyframe partition probs are a const selected by
get_partition_probs and must never be stored in a FrameContext (stored
contexts are new(false), the active keyframe copy new(true) + a
reset_inter_partition before the save); vp9_switchable_interp_tree is
{0,2,-1,-2} (libvpx's EIGHTTAP/EIGHTTAP_SMOOTH/EIGHTTAP_SHARP #defines,
not the spec's naming order); mv_ref_blocks' POSITION is {row,col} and one
accessor added .0 to the column; clamp_mv_ref's edge arithmetic is signed
(usize underflowed on a frame's partial last row) and clamps the COLUMN
with the left/right edges and the ROW with the top/bottom ones; and the
mode-derived candidate-count override sits AFTER libvpx's Done: label, so
an early exit skips it - reproduced bug-for-bug.

This slice is SYNTAX ONLY: decode() still refuses inter frames by name and
no inter pixel is produced. The keyframe path still decodes to pixels and
keyframe_exact is green.

Verified by an independent reviewer in three passes (structural claims
re-derived from libvpx source, the identity comparison re-implemented
independently, a dropped-field audit of the two stale fields, and
delta re-verification of the clamp/error-propagation/gate fixes).