VoidXH / Cavern

Object-based audio engine and codec pack with Dolby Atmos rendering, room correction, HRTF, one-click Unity audio takeover, and much more.
http://cavern.sbence.hu
Other
305 stars 14 forks source link

Make LAF a low-size lossless archival format #77

Closed VoidXH closed 1 year ago

VoidXH commented 1 year ago

LAF's silence flags help minimizing the size for many tracks that aren't always active, but the format is not object-based. Object movement should be added, but while not having to keep the entire metadata in memory like for ADM BWF.

This could be added by modifying the specification so that a specific X rotation (like NaN) for channel positioning would mean that channel is actually used for positional information and not as PCM, and the other rotation could be flags for what channels does it contain metadata for. Since there are only 32 bits, this means a single PCM track can only contain positional information for 32 channels at most. The next such channel would contain data for the next 32 PCM channel and so on.

The bit depth determines the total data available for object movement. A single 16-bit PCM channel can provide 3D position updates for all objects every 3 coordinates * 32 bits per float coordinate / 16 bit sample rate * 32 objects = 192 samples, which means a 250 Hz update rate at 48 kHz. This is 3x slower than what Atmos has, but interpolation makes sure it's not even close to audibly jumpy. When the content is 24 bit, the sample interval is 128, meaning a 375 Hz update rate, which is even better than perfect. This performance is nearly 4x better than the average ADM BWF file, and in some cases, can reduce their file sizes by tenfold, without any losses.

A new documentation correctly and compactly describing what the format can do is needed.

junh1024 commented 1 year ago

Have you looked at Wavpack (compressed lossless) as a format? It can store lots of channels, and supports APEv2 tags. I was thinking of turning ADM into WV + tags

VoidXH commented 1 year ago

That still has BWF's issue with having to parse the entire metadata before playback. I want to make something like IAB, but open.

VoidXH commented 1 year ago

Done in 0175341b7ed27374992d7b89921c5b55116954d5, follow-up: #87.