Motion vector predictors are re-derived in decoding order from the chosen per-partition directions.
Stage 2 set: B-frames (1-3, spatial direct, B_Skip, concurrent B encoding), variance AQ, RD-lite (Quality).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Encoder: transient-driven window switching (long/start/short/stop, grouping),
sine/KBD MDCT, MDCT-domain psychoacoustic model (Bark spreading, SFM tonality,
ATH, PE), TNS, per-band M/S, lambda rate-distortion loop with measured-error
scalefactor search and DP sectioning over all codebooks, bit reservoir with
fill elements (exact CBR), VBR quality scale, 1-8 channels (configs 1-7 + PCE
for 7ch), ASC + optional ADTS, 1024-sample priming reported.
Decoder: full AAC-LC syntax incl. PNS (correlated M/S noise), intensity stereo,
TNS, M/S, pulse data, both window shapes, PCE/DSE/FIL, ADTS helpers; never
panics on malformed input.
Tests use ffmpeg only as an oracle: our streams decode cleanly in ffmpeg
(CBR within 0.1%), our decoder matches ffmpeg to ~1e-7 on ffmpeg-encoded
streams (8-96 kHz, mono..7.1, IS/MS/TNS), plus fuzzing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clean-room ProRes (SMPTE RDD 36) codec: 422 Proxy/LT/Standard/HQ and
4444/4444 XQ decode incl. alpha and interlaced fields, slice-parallel;
progressive encoder with frame-level quantiser rate control targeting
Apple nominal rates. Oracle tests vs ffmpeg (within 1 LSB on all 29
fixtures), round-trip, fuzz and ignored perf tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CABAC engine keeps codIOffset scaled in a 64-bit register with 32-bit
refills instead of re-reading the bitstream on every renormalisation
- significance map collected as a position list; context increments from
per-category tables
- fixed-size row copies for motion-compensation windows and block copies
- explicit weighted prediction (P_Skip and B_Skip bi-prediction) synthetic
test, cross-checked with ffmpeg
- crates/h264/README.md: features, API, threading model, fixture matrix,
performance, known gaps and the plan for High 10 / 4:2:2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
- 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>
- 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>
New crate filmcraft-h264 (L0, depends only on filmcraft-bitstream):
- SPS incl. VUI/HRD, scaling lists with fall-back rules A/B, frame cropping,
high-profile chroma_format_idc / bit depth fields, DPB size from level
- PPS incl. transform_8x8_mode, scaling lists, slice groups (parse only)
- slice header: all fields incl. ref_pic_list_modification, pred_weight_table,
dec_ref_pic_marking
- POC types 0/1/2 (incl. MMCO5 handling and frame_num gap hooks)
- default scaling / QPc / deblocking tables from the public ITU-T spec
- ffmpeg/libx264 fixture generator for tests (skips when ffmpeg is absent)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>