forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 052d1d3f81ff6b9e7c09b93b58c5e772d825fcb3Filtered to crates/ec-vp8/tests/header_parse.rsClear filter

2026-09-12

ec-vp8: two partition-0 desync bugs fixed (M2 debugging state)Ahmet Kaan Gümüş · d9a9866
ec-vp8: two partition-0 desync bugs fixed (M2 debugging state)

BUG 1 (found by decision-trace diff vs a python dixie model): the MV
probability update loop ran on KEY frames - dixie/libvpx parse it only
for interframes. On key frames the 38 extra bool reads desynced the
whole partition-0 parse. Moved inside the !is_keyframe branch.

BUG 2: decode_keyframe created a FRESH bool decoder over partition 0
for the per-MB mode records - re-reading the partition from its start.
FrameHeader::parse now returns its partition-0 decoder so the mode
records CONTINUE from where the header stopped (dixie decode_frame
shares one decoder).

Result: single-MB 16x16 black q0 fixture now decodes BYTE-EXACT vs
ffmpeg (chroma and luma). Multi-MB fixtures still diverge: decision
traces (python dixie model scripts side /tmp/vp8ref.py vs EC_VP8_TRACE)
match to decision 2562 and split at 2563 inside the token walk of
MB(0,1) block 0 (ref consults prob 11, rust prob 4 at the same stream
position) - a coefficient-context/bookkeeping difference in the multi-MB
token pass that is now precisely localized for the next session.
Debug tooling retained: EC_VP8_TRACE decision trace, EC_VP8_DEBUG
per-MB coeff dump, examples/dbg_first.rs.
ec-vp8 M1: bool arithmetic decoder, frame tag + full first-partition header parsing, RFC-transcribed tablesAhmet Kaan Gümüş · 5233d88
ec-vp8 M1: bool arithmetic decoder, frame tag + full first-partition header parsing, RFC-transcribed tables

- bool.rs: RFC 6386 section 7.3 decoder (read_bool/literal/signed_literal/
  maybe_signed/prob7/tree incl. the EOB-skipping token-tree form), plus a
  test-only reference bool encoder; round-trip tests at probability
  extremes, long LCG streams, literals to 19 bits, tree paths.
- frame.rs: 3-byte LE frame tag, key-frame start code + dimensions/scaling,
  MB geometry.
- header.rs: complete partition-1 header in dixie field order — colour
  space/clamping, segmentation (with cross-frame state), loop filter
  type/level/sharpness/deltas, token partition size table, quant indices,
  reference refresh/copies/sign-bias, coefficient probability updates,
  mb_no_skip_coeff, inter prob_intra/last/gf + ymode/uv/MV probability
  updates. PersistedState carries entropy/segmentation/filter deltas
  across frames and resets at key frames.
- tables.rs: GENERATED verbatim from the RFC text by
  scripts/extract_vp8_tables.py (element counts asserted): default + update
  coefficient probs, kf_bmode_prob, coeff_bands, dequant lookups, Pcat1-6
  (sentinel kept), default + update MV probs.
- scripts/gen_vp8_fixtures.sh: libvpx-encoded IVF witnesses (6 sizes/q,
  60-frame GOP, 8-token-partition vector via local vpxenc, WebP still).
- Witness: real vpxenc/ffmpeg-produced streams parse with exact tiling of
  partition sizes, correct dims (incl. 76x52 non-MB-aligned), 8 partitions;
  VP8-in-WebP still decodes its header. 12 tests green, zero warnings.