Skip to content

Releases: superuser404notfound/LibTrueHD

2.3.0 - decoding about a third faster again

Choose a tag to compare

@superuser404notfound superuser404notfound released this 13 Oct 07:14

Changed

  • Decoding is about a third faster again. The truehd pin moves to harletty's speed work on the decoder, which includes the truehdd#42 change from 2.2.0 and adds: blocks decoded in place instead of copied, bits read straight from the slice with table-driven Huffman codes, CRC-8 eight bytes per step, prediction filters for several channels side by side, and matrices applied to a whole block. Through the C API on an M1: Unfold's 16-element presentation 0.98 s before, 0.60 s after (29x to 45x real time), the first 120 s of Dolby's 7.1.4 test file 3.04 s to 2.00 s.
  • truehd pin: superuser404notfound/truehdd@5c8b880, mirrored unchanged from harletty's branch (upstream main 02d29cd plus 17 commits), so the pin does not depend on a third-party branch. It returns to upstream once the work is merged there. NOTICE says so.

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, both link orders next to a second Rust library, Swift through the module map. examples/decode_bench hashes every output field (PCM, speakers, timing, object metadata) and gives the same checksum as 2.2.1 on Unfold, the 7.1.4 test file and FFmpeg's FATE atmos.thd. The truehdd CLI at the 2.2.1 pin and at 5c8b880 writes byte-identical files for every fixture in truehd/tests/assets and every sample at presentations 0 to 3 (60 decodes). 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. No wrapper change.

2.2.1 - links next to another Rust library in a host with Objective-C and C++

Choose a tag to compare

@superuser404notfound superuser404notfound released this 13 Oct 04:49

Fixed

  • A host with its own Objective-C and C++ links again next to LibDovi (AetherEngine#752). The prelink step made every symbol except the C API local, including rust_eh_personality. A local copy still counts as a second personality routine in the final image, and compact unwind can encode at most three per image. LibDovi's copy plus this one plus the host's __objc_personality_v0 and __gxx_personality_v0 made four, and ld stopped with "Too many personality routines for compact unwind to encode". rust_eh_personality is now exported as a weak definition, so the linker keeps a single copy: another Rust library's strong one if present, otherwise this one. Panics still never leave the library. Every exported function catches them, and only the routine that reads the unwind tables is shared. truehd_atmos_selftest confirms the catch in the final link.

Verification

  • With LibDovi 2.1.0 and an Objective-C and C++ host, 2.2.0 fails to link for tvOS, the tvOS simulator, iOS and the iOS simulator (x86_64), and 2.2.1 links for all four in both link orders.
  • harness/verify.sh gained a check that links the macOS slice next to a second Rust static library in an Objective-C and C++ host, in both link orders, and catches one exception in each of the four runtimes. That check fails against the 2.2.0 binaries.
  • The rest of verify.sh passes in full, with PCM bit-exact against truehdd on every sample and fixture.

Same decoder, same C API (API version unchanged), same slices and minimum OS versions. The only new global symbol is the weak _rust_eh_personality.

2.2.0 - decoding about 30% faster

Choose a tag to compare

@superuser404notfound superuser404notfound released this 11 Oct 14:53

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.

2.1.0

Choose a tag to compare

@superuser404notfound superuser404notfound released this 11 Oct 09:48

Added

  • x86_64 in the iOS simulator slice. The slice is now ios-arm64_x86_64-simulator, like LibDovi's. A generic iOS Simulator build of a consumer links both architectures, and without x86_64 an app embedding AetherEngine failed to link with undefined truehd_atmos_* symbols. The tvOS and visionOS simulators stay arm64 only.

Same decoder, source and pins as 2.0.0; every other slice is a rebuild. harness/verify.sh passes in full (PCM bit-exact against truehdd, every slice links, x86_64 simulator included) and cargo test --release is 8/8.

2.0.0

Choose a tag to compare

@superuser404notfound superuser404notfound released this 11 Oct 04:46

First release under the new name. The package was written by Quick104 for Silo as SiloObjectAudio and transferred here for AetherEngine (AetherEngine#731).

Breaking

  • Package LibTrueHD, product and module TrueHD, TrueHD.xcframework. Consumers switch to:

    .package(url: "https://github.com/superuser404notfound/LibTrueHD", .upToNextMinor(from: "2.0.0")),
    .product(name: "TrueHD", package: "LibTrueHD"),

    and import TrueHD. The C API (truehd_atmos_*, API version 1) is unchanged.

Changed

  • The xcframework is rebuilt from source with the pinned toolchain (Rust 1.98.1, truehd at truehdd 45eff984e3e5). A rebuild of the transferred tree matched the binary 1.0.0 shipped: identical section sizes and strings, every function equal up to addresses.
  • The wrapper code (C API, framer, packaging) is MIT. The truehd and oamd crates compiled into the library stay Apache-2.0; ship LICENSE, LICENSE-APACHE and NOTICE with the binary.
  • cargo test reads the same work directory harness/verify.sh fills (.work/ or $TRUEHD_ATMOS_WORK).

Verified

harness/verify.sh: PCM bit-exact against truehdd on Dolby's Unfold demo, the 7.1.4 Atmos test and every fixture, object metadata and seek checks pass, every slice links, Swift imports the module. cargo test --release: 8/8.

Silo's 1.0.x pin keeps resolving through GitHub's redirect.