Skip to content

2.2.0 - decoding about 30% faster

Choose a tag to compare

@superuser404notfound superuser404notfound released this 11 Oct 14:53
· 10 commits to main since this release

Changed

  • Decoding is about 30% faster. The truehd crate built every block with two 160-row sample arrays, copied them whole into the decoder for every block of every substream, and carried a third 160-row array in every decoded access unit. A TrueHD block is usually 40 samples, so memmove and memset were 41% of an Atmos decode. truehdd#42 sizes the buffers to the samples they hold. Unfold's 16-element presentation through the C API on an M1: 1.31 s before, 0.92 s after (21x to 29x real time).
  • truehd pin moves to a fork until truehdd#42 is merged: superuser404notfound/truehdd@9adbb4a, which is upstream main at 02d29cd plus that one change. That also takes in the nine upstream commits since the previous pin (45eff98), among them recovery from damaged frames, a panic fix for backward pointers in skipped substreams, and no false lossless-check or timing findings past a rejected branch. NOTICE says so.
  • harness/verify.sh reads the truehdd URL from Cargo.toml and fetches the pinned commit into an existing checkout.

Added

  • examples/decode_bench.rs: wall time of a whole decode through the C API, with a hash over every output field (PCM, speakers, timing, object metadata).

Verification

Output is unchanged. harness/verify.sh passes in full: PCM bit-exact against truehdd, object metadata, reset and seek, arbitrary chunking, every slice links, Swift through the module map. Separately, the truehdd CLI at 02d29cd and with the change writes byte-identical files for every fixture in truehd/tests/assets, Unfold, the first 120 s of Dolby's 7.1.4 test and FFmpeg's FATE atmos.thd, at --presentation all, max, 0, 1, 2 and 3. cargo test --release is 8/8, and AetherEngine's suite passes against this build.

Same C API (API version unchanged), same slices and minimum OS versions.