Commit Graph
4 Commits
Author SHA1 Message Date
Brandon ThomasandClaude Opus 5.5 b3a09fab64 M4.9: H.264 draft mode (no deblocking of non-reference pictures, off by default)
Decoder::set_draft: non-reference pictures skip the deblocking filter and are
flagged Picture::draft; all other pictures stay bit-exact (conformance test,
single- and frame-threaded). Conformance fixtures now also decode with 3
threads. Decoder::threads / default_threads for perf.stats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 23:06:54 -04:00
Brandon ThomasandClaude Opus 5.5 20f0d08311 M2 tests: synthetic I_PCM/long-term/MMCO/gap streams, avcC, robustness, stats
- hand-built CAVLC and CABAC bitstreams (test-only CABAC encoder) with I_PCM
  and P_Skip macroblocks exercising long-term references, MMCO 1-6,
  frame_num gaps and reference list modification (idc 0 and 2); expected
  output is known exactly and cross-checked with ffmpeg when available
- avcC configuration + length-prefixed samples with pts round trip
- corrupted / truncated / garbage input never panics or deadlocks
  (single- and multi-threaded)
- Decoder::stats() coverage counters and an ignored coverage report test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:44:39 -04:00
Brandon ThomasandClaude Opus 5.5 374569e65e M2 perf: frame-threaded H.264 decoding and hot-path optimisation
- frame-level parallelism: the calling thread handles headers, POC, DPB and
  reference lists; each picture decodes as a job on a rayon pool (feature
  'threads') and publishes deblocked macroblock rows into a shared Frame;
  motion compensation and co-located lookups block per row on references
  still being decoded (safe Rust, OnceLock per MB row); outputs are handed
  out once their job has finished
- row-pipelined deblocking inside a picture (row r filtered after row r+1 is
  reconstructed), picture buffer recycling, panic/error isolation per job
- faster luma/chroma interpolation (row-wise filters, window fetch), direct
  interpolation into the picture for unweighted single-list blocks, merged
  motion compensation for uniform direct macroblocks, 8x8 direct derivation
  with direct_8x8_inference, vectorisable weighted prediction, deblocking
  with per-edge parameters and cached reference identities
- conformance tests now decode every fixture single- and multi-threaded and
  check pts/POC output order; ignored perf test (1080p High CRF20, 120 frames)

1080p: ~100 fps single-threaded, ~600 fps with 14 threads (M4 Pro, heavily
loaded machine).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:38:40 -04:00
Brandon ThomasandClaude Opus 5.5 9c8de5468b M2.2/M2.3: CAVLC macroblock decoding, intra and inter prediction, DPB
- CAVLC residual parsing (coeff_token / total_zeros / run_before tables taken
  from the spec text, level decoding with escape codes), macroblock layer for
  I/P/B slices (mb_type, sub_mb_type, mb_pred, sub_mb_pred, me(v) cbp,
  mb_qp_delta), I_PCM
- intra prediction: Intra4x4 (9 modes), Intra8x8 with reference filtering,
  Intra16x16, chroma; constrained_intra_pred
- dequantisation with flat/custom scaling matrices; 4x4, 8x8, luma DC
  Hadamard and 2x2 chroma DC inverse transforms
- inter prediction: median / directional mv prediction, P_Skip, B spatial and
  temporal direct (direct_8x8_inference), B_Skip, 6-tap luma and bilinear
  chroma interpolation, explicit and implicit weighted prediction
- reference lists (init + modification), DPB with sliding window, all MMCOs,
  frame_num gaps, bumping / max_num_reorder_frames output order, IDR and
  no_output_of_prior_pics
- public Decoder/Picture API (Annex-B and avcC input, pts passes through
  reordering)

Deblocking (M2.5) follows in the next commit, so the bit-exact fixtures in
this commit are the no-deblock ones. CABAC slices return Unsupported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:14:18 -04:00