Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th August 2024, 23:48   #1  |  Link
BuccoBruce
I might be autistic...
 
Join Date: Apr 2022
Location: 16-235
Posts: 34
TrueHD is not ALWAYS 100% lossless...only 99.998%

At least not in DEE 5.2.1

Granted, it's only 467 samples @ only 5.5262 dB above the noise floor, but lossless should mean lossless, no?

Steps to reproduce:
  1. Feed DEE 5.1/7.1 audio with a "full scale" (no highpass) LFE channel that has 0 dBFS peaks
  2. ?
  3. Decode and compare however you choose to

Code:
Differences found in compared tracks.
Zero offset detected.

Comparing:
"Q:\-46h.flac"
"Q:\-46h.thd_.flac"
Compared 30846960 samples.
Differences found: 467 values, 4:29.905000 - 6:59.012688, peak: 0.000000 (-138.47 dBFS) at 4:29.905000, 4ch
Channel difference peaks: 0.000000 0.000000 0.000000 (-138.47 dBFS) 0.000000 (-138.47 dBFS) 0.000000 0.000000
File #1 peaks: 0.635144 (-3.94 dBFS) 0.631598 (-3.99 dBFS) 0.789073 (-2.06 dBFS) 1.000000 (0.00 dBFS) 0.394280 (-8.08 dBFS) 0.396389 (-8.04 dBFS)
File #2 peaks: 0.635144 (-3.94 dBFS) 0.631598 (-3.99 dBFS) 0.789073 (-2.06 dBFS) 1.000000 (-0.00 dBFS) 0.394280 (-8.08 dBFS) 0.396389 (-8.04 dBFS)
Detected offset as 0 samples.

Total duration processed: 10:42.645
Time elapsed: 0:15.049
42.70x realtime
I was scratching my head for hours thinking about things to check and coming up with nothing because most of the options you can change (except the one that dithers to 16-bit) only make DRC/metadata/loudness/etc. related changes. Was starting to worry that there was always something that would get changed by DEE, then I tried taking a pre-existing THD source (THX 2010 Broadway), decoding it, and re-encoding - and was relieved to see the output was identical to the source.



The "Mix" pictured in the screenshots is the original LFE + the inverted THD LFE summed together and normalized to 0 dB. It looks like the center channel might have also had some differences but I neglected to check that one since the LFE channel caught my attention.

I have yet to find any other sources where the same artifacts appear. For what it's worth, I've yet to encounter any sample where DTS-HD MAS, or any other lossless codec, doesn't produce bit-identical output***
***Save for the 1024/16 samples prepended and appended to everything that comes out of MAS because of reasons.

There's a chance this is something they have already fixed in a newer version of DEE, but, you know
If you do have access to a newer version of the encoder and feel like testing this "killer sample" out, send me a PM. AFAIK the only settings that actually affect the audio data are <surround_3db_attenuation> (defaults to ON, I have it off) and <optimize_data_rate> (defaults to off anyways). You can set DRC/DialNorm/etc to whatever you want and it won't change what you get out of the other end from eac3to (ignores DRC by default) or ffmpeg (with -drc_scale 0)

Last edited by tebasuna51; 11th August 2024 at 09:52. Reason: attachements already in postimg
BuccoBruce is offline   Reply With Quote
Old 6th August 2024, 00:24   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,694
Well, first we abuse the LFE channel: feed non bandwith-limited signal to a LFE encoder, and at 0dBFS.
Then we find a difference, a flipping LSB worth. Then we use normalisation on that (a huge amplification under these circumstances).
Then we analyse that boosted ping to find diracs. To be expected ? A comparison would be to drive a car against a wall, record that and...find it noisy.
Lets see if Dolby revisits that use case.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 6th August 2024, 01:24   #3  |  Link
BuccoBruce
I might be autistic...
 
Join Date: Apr 2022
Location: 16-235
Posts: 34
Quote:
Originally Posted by Emulgator View Post
Well, first we abuse the LFE channel: feed non bandwith-limited signal to a LFE encoder, and at 0dBFS.
I didn't create or manipulate this source, just backing something up that only had PCM audio. Every other lossless encoder under the sun will give you what you put into it on the other end...regardless of what channel it's on.
Quote:
Originally Posted by Emulgator View Post
Then we find a difference, a flipping LSB worth. Then we use normalisation on that (a huge amplification under these circumstances).
I normalized it just to visualize it, I made that clear.
This isn't format fanboism, a lossless encoder should have zero killer samples, it is supposed to be lossless - I'm just reporting what I found...
Quote:
Originally Posted by Emulgator View Post
Then we analyse that boosted ping to find diracs. To be expected ? A comparison would be to drive a car against a wall, record that and...find it noisy.
Again, the expected behavior for a lossless codec is to give you back exactly what you gave it. I'm not sure what a dirac is, or what purpose the car comparison serves. I'm not feeding full spectrum noise, tone sweeps, or other bizarre "test" samples to the encoder - it's bloody anime.
Quote:
Originally Posted by Emulgator View Post
Lets see if Dolby revisits that use case.
I don't expect them to

I think you've missed my point entirely and replied solely based on the thread title I chose...
BuccoBruce is offline   Reply With Quote
Old 6th August 2024, 06:08   #4  |  Link
BuccoBruce
I might be autistic...
 
Join Date: Apr 2022
Location: 16-235
Posts: 34
Here's a different example of it doing the same thing either across three channels or on the third channel (center, not LFE).

Code:
Differences found in compared tracks.
Zero offset detected.

Comparing:
"Q:\E3.33\3.33_00011_MPLS_00002_M2TS_track2_jpn.flac"
"Q:\E3.33\3.33_00011_MPLS_00002_M2TS_track2_jpn.thd"
Compared 305088000 samples.
Differences found: 6800 values, 13:00.342854 - 1:38:20.332583, peak: 0.000000 (-138.47 dBTP) at 13:00.342854, 3ch
Channel difference peaks: 0.000000 (-138.47 dBTP) 0.000000 (-138.47 dBTP) 0.000000 (-138.47 dBTP) 0.000000 (-138.47 dBTP) 0.000000 (-138.47 dBTP) 0.000000 (-138.47 dBTP)
File #1 peaks: 0.998749 (-0.01 dBTP) 0.999664 (-0.00 dBTP) 0.999969 (-0.00 dBTP) 0.973450 (-0.23 dBTP) 0.999969 (-0.00 dBTP) 0.999634 (-0.00 dBTP)
File #2 peaks: 0.998749 (-0.01 dBTP) 0.999664 (-0.00 dBTP) 0.999969 (-0.00 dBTP) 0.973450 (-0.23 dBTP) 0.999969 (-0.00 dBTP) 0.999634 (-0.00 dBTP)
Detected offset as 0 samples.

Total duration processed: 1:45:56.000
Time elapsed: 3:56.332
26.89x realtime
This shouldn't be happening, even if it is at -138.47 dBTP and ultimately an entirely inaudible difference of less than 1/5 second total throughout an entire movie (0.002% total samples).

Doubly (heh) interesting is the fact that it coded anything there at all. The input was 16bit here, while it was actually 24bit input in the OP. Putting this THD file through eac3to doesn't show the usual message about a 2nd pass reducing the bit depth to 16 either:
Code:
Original audio track: max 24 bits, average 16 bits, most common 16 bits.
BuccoBruce is offline   Reply With Quote
Old 9th August 2024, 15:25   #5  |  Link
kurkosdr
Registered User
 
Join Date: Aug 2009
Posts: 379
Whaaat? A proprietary and completely undocumented "lossless" format that nobody can study its inner workings isn't really lossless? This hasn't happened since... well... since MQA.
kurkosdr is offline   Reply With Quote
Old 9th August 2024, 22:41   #6  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,397
Well, it does appear Dolby Inc. skrewed some things when it created TrueHD as a ""superset"" of Meridian's "packed PCM" (better known as M.L.P.). The use-case of MLP is «audiophile stuff», whereas the use-case of TrueHD is movies, so they apparently decided to "take some liberties" w.r.t. lossless compression :-|
__________________
«Your software patents have expired.»

Last edited by filler56789; 10th August 2024 at 11:12. Reason: add emphasis :-/
filler56789 is offline   Reply With Quote
Old 10th August 2024, 17:07   #7  |  Link
j7n
Registered User
 
j7n's Avatar
 
Join Date: Apr 2006
Posts: 151
With movie soundtracks on an encrypted disc the copy is not supposed to be used for new encodings. So there is not any practical gain from them being strictly lossless. Could this be a minor problem with the open source decoder?
j7n is offline   Reply With Quote
Old 12th August 2024, 08:44   #8  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,397
Quote:
TrueHD is not ALWAYS 100% lossless...only 99.998%
Well, only yesterday I remembered that the MLP format has a ""feature"" called ReBit :-/
In summary, ReBit is a set of lossy parts ""surrounded"" (so to speak) by lossless compressed segments :-/
The reasoning for the existence of ReBit was/is the maximum bitrate allowed by the DVD-Forum specifications; but I don't know what would be the reasoning (or excuse) of Dolby for allowing TrueHD to include "lossy islands" in a lossless stream, since Blu-Ray discs are not DVDs. 0_o
__________________
«Your software patents have expired.»
filler56789 is offline   Reply With Quote
Old 12th August 2024, 16:16   #9  |  Link
kurkosdr
Registered User
 
Join Date: Aug 2009
Posts: 379
Quote:
Originally Posted by j7n View Post
With movie soundtracks on an encrypted disc the copy is not supposed to be used for new encodings. So there is not any practical gain from them being strictly lossless. Could this be a minor problem with the open source decoder?
This doesn't make any sense. Lossless means lossless. You supply a set of LPCM streams (one per channel) to the encoder, the encoder encodes them into a bitstream, and during decoding the decoder gives you back the exact same LPCM streams that were supplied to the encoder. The fact TrueHD doesn't do that means that the decoded LPCM output isn't always the same as the LPCM streams the movie studio supplied to the encoder.

Movie studios market the term "lossless audio" for their Blu-Ray discs, but some movies have the Cinavia watermark added (which is by definition destructive to the original audio), and now we learn that TrueHD isn't lossless either. I guess there is always DTS-HD MA.

Last edited by kurkosdr; 12th August 2024 at 21:16.
kurkosdr is offline   Reply With Quote
Old 13th August 2024, 03:05   #10  |  Link
j7n
Registered User
 
j7n's Avatar
 
Join Date: Apr 2006
Posts: 151
The sound is still overwhelmingly "HD" if it delivers 20..23 bits of resolution. On DVD, the bitrate would only reach high systained values during loud, noisy sections, when the ability to hear lower bits is diminished.
j7n is offline   Reply With Quote
Old 13th August 2024, 03:36   #11  |  Link
junh1024
Registered User
 
Join Date: Mar 2011
Posts: 61
There might be some factors.

1. Bitdepth reduction might be on in DEE/DME.

2. The way MLP/THD works the core of THD is stereo (IIRC stereo decoding is mandatory for HDDVD, but not surround) , and all surround is a reconstruction, so may produce low level errors.
junh1024 is offline   Reply With Quote
Reply

Tags
bug, dee, killer sample, truehd

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.