forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to crates/ec-vp8/examples/dump_frame.rsClear filter

2026-09-12

ec-vp8: fix M2 token walk — ONE path missed sign/EOB; frame-0 byte-exact on all kf fixturesAhmet Kaan Gümüş · dd7b5a6
ec-vp8: fix M2 token walk — ONE path missed sign/EOB; frame-0 byte-exact on all kf fixtures

get_coeffs' ONE-token path (p[2] branch) had the sign read,
coefficient write, and EOB-after-nonzero check nested inside the
magnitude branch only. The reference walk (libvpx detokenize.c
GetCoeffs / RFC 6386 section 13.2) shares that tail between the ONE
and magnitude paths. A ONE token therefore skipped the sign read and
EOB check and re-entered the walk at the ZERO node — read counts
stayed in lockstep (so stream positions matched) while the decoded
stream diverged from the first ONE token, which is why the lossless
single-MB fixture passed and busy fixtures split ~28 reads into
block 0.

Evidence:
- EC_VP8_TRACE G-lines (n, band, ctx, prob, bit) vs
  scripts/vp8ref_model.py on kf-160x96-q20.ivf: 19131 decisions, 0
  diffs (model also fixed: persistent per-partition decoders, G
  tracing with consulted prob + decoded bit).
- examples/dump_frame frame 0 vs 'ffmpeg -frames:v 1': byte-exact on
  all 7 kf fixtures + mparts-160x96 kf0.
- cargo test -p ec-vp8: unit 49 + header_parse 4 + webp green;
  keyframe_exact 1/3 (the 2 red cases decode every frame of each
  fixture and complete when M3 inter frames land).