Log in

View Full Version : Q Stream size of different lossless codecs


73ChargerFan
21st April 2022, 19:39
I have two copies of the same audio track, one encoded as TrueHD and the other DTS XLL. I don't think either stream is object based.

Why is the latter twice the size? Shouldn't each decode to the exact same PCM stream?

Thanks.

#1 Dolby TrueHD

Format : MLP FBA
Format/Info : Meridian Lossless Packing FBA
Commercial name : Dolby TrueHD
Codec ID : A_TRUEHD
Duration : 2 h 4 min
Bit rate mode : Variable
Bit rate : 2 046 kb/s
Maximum bit rate : 3 414 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 96.0 kHz
Frame rate : 1 200.000 FPS (80 SPF)
Compression mode : Lossless
Delay relative to video : 1 s 0 ms
Stream size : 1.78 GiB


#2 DTS XLL

Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 2 h 4 min
Bit rate mode : Variable
Bit rate : 5 263 kb/s
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 96.0 kHz
Frame rate : 187.500 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossless
Delay relative to video : 1 s 0 ms
Stream size : 4.58 GiB

tebasuna51
22nd April 2022, 00:40
Why is the latter twice the size? Shouldn't each decode to the exact same PCM stream?

Decode both and compare.

Maybe the TrueHD have only 16 bits of bitdepth (eac3to detect that).

Also the DTS encoder is less efficient, try FLAC and obtain less size.

73ChargerFan
22nd April 2022, 17:59
I was thinking that about the DTS encoder. I'll decode them and see. Thanks.

Balling
30th September 2022, 23:50
Oh, but TrueHD has higher compression. Try this: https://www.mediafire.com/file/53xvp604qm7c38e/o4aU-Nikolai.rar/file

After encoding to flac

ffmpeg.exe -i "o4aU.Nikolai.thd" -compression_level 12 dc.flac

45 133 579 vs 35 863 404 bytes vs ffmpeg native encoder that is much worse 49 887 750.

flac does not even have SEEKTABLE, since not supported in ffmpeg.

tebasuna51
1st October 2022, 10:17
Only with that sample, maybe because:
Creating file "C:\tmp\o4aU.Nikolai.thd_.wav"...
Original audio track: max 24 bits, average 16 bits, most common 16 bits.

Most the time flac have better compression.
For instance for Core.thd from Core Universe.m2ts (https://thedigitaltheater.com/dolby-trailers/)

139.404.590 Core.thd Atmos
81.928.230 Core.thd_.thd Without Atmos metadata
216.505.028 Core.thd_.thd_.wav Uncompressed
98.373.524 Core.dtshd_.dts DTS-MA
71.615.788 Core.thd_.thd_.wav_.flac Flac
15.040.000 Core_(5.1.2).eac3 640 Kb/s like Atmos for a 5.1.2 AVR

EDIT: Added DTS-MA size to the compare

Not all 24 bits:
Original audio track, L+C: max 23 bits, average 20 bits.
Original audio track, R+SL+SR: max 22 bits, average 20 bits.
Original audio track, LFE: constant bit depth of 20 bits.
Original audio track, BL+BR: max 24 bits, average 20 bits.

Balling
1st October 2022, 21:55
Apparently Dolby encoder is not lossless in stereo in Dolby media encoder. That is why.

SquallMX
3rd October 2022, 19:48
DTS-HD multichanel encoding is highly inefficient for 24 bits content, almost buggy, encoding an 16 bits audio file padded with 8 bits of 0s (aka fake 24 bits) will result in a way bigger file size, weirdly enough 2.0 encoding is unaffected and have almost the same file size than 16 bits files (as it should).

98,373,524 Core.dtshd24_.dts DTS-MA 24 Bits
61,823,828 Core.dtshd16_.dts DTS-MA 16 Bits
75,459,316 Core.dtshdFake24_.dts DTS-MA 24 Bits Fake (16 bits padded with 0s)
71,772,848 Core.dtshd24_.flac FLAC 24 Bits
42,522,237 Core.dtshd16_.flac FLAC 16 Bits
42,556,253 Core.dtshdFake24_.flac FLAC 24 Bits Fake (16 bits padded with 0s)

Balling
1st February 2023, 11:16
DTS-HD multichanel encoding is highly inefficient for 24 bits content, almost buggy, encoding an 16 bits audio file padded with 8 bits of 0s (aka fake 24 bits) will result in a way bigger file size, weirdly enough 2.0 encoding is unaffected and have almost the same file size than 16 bits files (as it should).

98,373,524 Core.dtshd24_.dts DTS-MA 24 Bits
61,823,828 Core.dtshd16_.dts DTS-MA 16 Bits
75,459,316 Core.dtshdFake24_.dts DTS-MA 24 Bits Fake (16 bits padded with 0s)
71,772,848 Core.dtshd24_.flac FLAC 24 Bits
42,522,237 Core.dtshd16_.flac FLAC 16 Bits
42,556,253 Core.dtshdFake24_.flac FLAC 24 Bits Fake (16 bits padded with 0s)

Dolby Media encoder is not even lossless in many cases, like puting all 0xFF there. And Dolby Encoding Engine is lossless... Even then, Media Encoder SE produced much smaller files, hehe.