mirror of
https://github.com/storytold/filmcraft.git
synced 2026-10-25 07:29:49 +00:00
c2872fbd8d
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>