Skip to content

v0.3.4

Choose a tag to compare

@MejiroRina MejiroRina released this 07 Jul 04:46
· 26 commits to main since this release
3e6a07b

Makes serial HCA decoding about 35% faster, adds opt-in multithreaded decoding for HCA and ACB, and removes redundant copies from USM extraction. Decoded PCM and extracted streams are byte-identical to 0.3.3, and existing functions keep their signatures and serial behaviour.

Added

  • Decode HCA on several threads with HcaDecoder::decode_to_wav_parallel(w, threads). Output is byte-identical to serial decoding; HCA v3 files with noise reconstruction and threads <= 1 use the serial path. On a 2:22 stereo HCA on an Apple M4, decoding goes from 52 to 9.8 ms with 10 threads. (#16)
  • Decode ACBs on several threads with decode_acb_to_wav_to_memory_parallel, decode_acb_to_wav_parallel and decode_acb_to_wav_from_file_parallel. Tracks are spread across workers and leftover threads decode blocks within a track, so both single-track music ACBs and many-track sound-effect banks use the whole budget. A 6-track ACB goes from 398 to 97 ms. (#16)
  • Pass threads to decode_hca, decode_hca_bytes, decode_acb_to_wav and decode_acb_to_wav_bytes in Python: None decodes serially as before, 0 uses all cores and N uses N threads. These four functions now release the GIL while decoding, serial mode included. (#16)

Performance

  • Speed up serial HCA decoding by about 35% (72.0 to 53.5 ms on the benchmark file): dequantizer bit counts are computed instead of looked up, scale-factor deltas go through a register-resident bit accumulator, and file input is read about 1 MiB ahead instead of once per block. (#16)
  • Extract USM streams in memory with one copy instead of three: 4.7 to 1.0 ms on a 28.5 MB USM. (#16)
  • Write extracted USM streams through a 1 MiB buffer: 28.7 to 14.7 ms on the same file. (#16)

Upgrade notes

  • Worker threads use their own 8 MiB stacks, named hca-decode and acb-decode, independent of the caller's RUST_MIN_STACK. (#16)

Artifacts

Maintenance
  • Update the API docs and README for 0.3.x and credit PyCriCodecs. (#14)
  • Bump rustc-hash from 2.1.2 to 2.1.3. (#15)

Full Changelog: v0.3.3...v0.3.4