INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: TrueHD vs AC3 decoder  (Read 12165 times)

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
TrueHD vs AC3 decoder
« on: September 16, 2013, 02:54:31 pm »

The movie Star Trek Into Darkness contains a lot of clipping in the TrueHD soundtrack that is noticeable regardless of volume level using internal volume. Using JRiver's Convert Format > Convert Video to Audio feature, I extracted a 30 second clip at about the 6 minute mark of both TrueHD and AC3 and compared the LFE tracks in Audacity.

The TrueHD clip has more clipping than the AC3 track. I'm wondering if it was mastered that way, or if the decoder isn't working properly. There is a similar question posted today on madshi's eac3to thread at doom9.

Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: TrueHD vs AC3 decoder
« Reply #1 on: September 16, 2013, 03:33:47 pm »

Ideally the decoder should deliver large values (ie. less than -1.0 or greater than 1.0) to our audio engine, and we should do any clip handling.  In many cases, with Volume Leveling or Internal Volume in use, there won't actually be a clip on the output side.

I know AC3 commonly delivers values outside full range.  I'm not sure about TrueHD.
Logged
Matt Ashland, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #2 on: September 16, 2013, 03:41:13 pm »

TrueHD is a lossless format, it decodes to integer, it cannot possibly overflow its defined range, so it would clip.

I should get the Blu-ray tomorrow, its in shipping right now, so i might check myself.
Logged
~ nevcairiel
~ Author of LAV Filters

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #3 on: September 16, 2013, 03:47:27 pm »

I did some further checking and just the LFE channel is affected. The L,R, and C all match in levels between TrueHD and AC3.

Matt, when I convert video to an audio wav file with no DSP it should represent exactly how it was encoded, right? Sometimes clipping is put in intentionally for certain effects like in Tron or Flight of the Phoenix. In Star Trek Into Darkness there is clipping on all channels and the LFE channel is worse with TrueHD. JRiver's audio engine can't do anything about clipped wave forms on the input side or am I misunderstanding?

Hendrik, thanks for "possibly" checking.  :)
 
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: TrueHD vs AC3 decoder
« Reply #4 on: September 16, 2013, 03:54:50 pm »

Matt, when I convert video to an audio wav file with no DSP it should represent exactly how it was encoded, right? Sometimes clipping is put in intentionally for certain effects like in Tron or Flight of the Phoenix. In Star Trek Into Darkness there is clipping on all channels and the LFE channel is worse with TrueHD. JRiver's audio engine can't do anything about clipped wave forms on the input side or am I misunderstanding?

By default no processing is performed (of course you can optionally apply DSP during conversion, so double-check).

We don't currently have any sort of unclipping DSP.  There's only so much you can do since the real data is gone, but it still could be an interesting addition.  It would help to understand how common the problem really is.
Logged
Matt Ashland, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #5 on: September 16, 2013, 04:05:48 pm »

I just remembered that TrueHD has a lossless check built into the format. It can check if the decoded output matches what it expected, and the decoder actually processes this and would scream if it didn't.
I wonder if the disc isn't just badly mastered on the LFE track.
Logged
~ nevcairiel
~ Author of LAV Filters

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #6 on: September 17, 2013, 11:06:07 am »

I did an Audio Analysis of the TrueHD track. Peak Levels (R128) are at +2.7 Left, +1.7 Right, and +3.7 Center. That is much higher than any other movie I've analyzed.

There is an interesting post at AVS about clipping on Star Trek Into Darkness, but with various hardware:

Quote
There is something going on with decoding of the STID track that is processor/chip related.

I am heard hard clipping (popping/snapping sounds) during the USS Vengenace water crash, and the Super 8 train crash sequence (this is much worse) on my Mcintosh MX-151 processor when bitstreaming. However, decoding in the Oppo does not produce the audible clipping (though I still find the soundtrack overly loud, compressed, and fatiguing)

I can bitstream to my Denon 20.4, and there is no audible clipping (though again, still a crappy mix to me)

Yet other TrueHD 7.1 and 5.1 titles I own do not clip, and sound good and excellent overall - Transformers Dark of the Moon, Monsters Inc 3d, Brave 3d and a few others.

It seems that mixes on STID and Super 8, both of which apparently can approach maximum db levels "trip up" at least my processor, and perhaps others.
Logged

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #7 on: September 23, 2013, 09:17:26 am »

I should get the Blu-ray tomorrow, its in shipping right now, so i might check myself.
Did you get a chance to check out the clipping on the movie yet? I wonder if your copy will have an identical soundtrack to mine?
Logged

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #8 on: September 25, 2013, 09:26:17 am »

Since the Peak Level (R128) is at +3.7, I wonder if there is a dialnorm flag that wasn't properly applied to the soundtrack causing an increase of +4 over 0 dbFS. The default setting of dialnorm is to reduce output by 4 dB. I think this occurs after decoding, though, so probably isn't the reason for the clipping in Star Trek Into Darkness.

Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #9 on: September 25, 2013, 10:25:23 am »

Dialog Normalization is never applied to any formats. However it would feel odd that they encode it so high that dialnorm is required to bring it back into the valid range, if they could just flag dialnorm with a 0db offset instead.
Especially since its a lossless format, how do you even feed it such values that exceed the valid range?

I'll keep looking, maybe it would be the solution to scale the volume down somewhere in the decoder, or maybe its really mastered so badly. I tried debugging around in the decoder a bit, especially the places where its converted from the internal 32-bit format to 24-bit for output, however i wasn't able to see any places where it actually overflowed this value and would clip because of the decoder. Like i mentioned earlier, the decoder also does a lossless check, which seems to pass just fine.

Did someone try bitstreaming it to a receiver, or play in TMT or PowerDVD, and see if that doesn't show the clipping? (if its obvious enough to be heard)
I usually don't notice such things in the audio, unless its really bad, but this is only LFE, so even harder to hear...
Logged
~ nevcairiel
~ Author of LAV Filters

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #10 on: September 25, 2013, 01:59:19 pm »

Thanks, nev (or Hendrik now  :)), for checking into this.

There are actually two issues I've mentioned with Star Trek Into Darkness:

1.  The LFE channel of the TrueHD is encoded higher than AC3

2.  There is clipping in at least the first 4 (L,R,C,LFE) channels of STID regardless of codec. In a previous post I showed the highest Peak Level (R128) of +3.7 to be in the center channel.

Many bitstreaming to a receiver have heard the clipping per a couple threads at AVS. Others have heard no clipping even after intentionally re-listening to the scenes. I may try using TMT or PowerDVD.

Here is another post at AVS (The reference to 151 is a McIntosh MX151 processor):

Quote
So it seems there is something with the decoding in the 151 (and perhaps other processors that are exhibiting issues)

I tried a Sony Blu ray player as well as the Oppo, and bitstreaming will always cause the clipping, regardless of any DRC setting in the player or 151. LPCM from the Oppo, Sony BR and an original PS 3 doesn't clip

I then tried the titles in another Sony player (S590) connected to an Integra 20.4, and no clipping via bitstreaming (that is however a 5.1 set up, not 7.1)

So at the moment is seems to be decode related. Does anyone know offhand any other 7.1 TrueHD titles - I'd like to see if the problem is related to STID or any 7.1 TrueHD encode.

Yes, I noticed that several hear that didn't hear the clipping are using the Marantz.

Even via LPCM, the soundtrack is hot and harsh, but at least no clipping.

I am also routing through a Lumagen video processor, so ill see if I can take that out of the equation to see if that's causing this anomaly....

Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #11 on: September 26, 2013, 04:01:57 am »

I did some more checking in the decoder, and I'm pretty sure it decodes the audio completely lossless.
I didn't find any indication that the decoder would cause clipping, and considering the TrueHD bitstream actually carries a lossless checksum, which the decoder also verifies to ensure the decoded audio is lossless to the source, it does seem to function perfectly.

I can see a lot of clipping in the waveform though, and not only in the LFE, but in all front channels, as you suggested. However its not always completely flat-lined as you would expect from hard-clipping, but shows fluctuations close to the maximum.
The LFE seems generally to be louder than the AC3 LFE, however reviewers across the board have reported this, so that seems to be normal.

I'll need to try to spot the clipping on my actual 7.1 speakers, in a downmix on the headphones it seems to easily disappear to some extent from the mixing.
Maybe the clipping gets amplified because of the general high levels of the audio, and applying the 4dB dialnorm would hide it to some degree. I'm not sure I'll find the time to test this before my vacation, though.
Logged
~ nevcairiel
~ Author of LAV Filters

terrym@tassie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 503
Re: TrueHD vs AC3 decoder
« Reply #12 on: September 26, 2013, 06:09:01 am »

I've analysed a Region B (New Zealand) release of Star Trek: Into Darkness and get the following much lower levels on the TrueHD track:

+1.6dBTP +0.9L +1.3R +1.6C -0.1Sub +0.1RL -0.0RR +0.1SL +0.7SR

Subjectively I couldn't hear any clipping during playback.
Logged
Good manners cost nothing.
Bad manners can cost you your reputation
― B.D.Hawkey

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: TrueHD vs AC3 decoder
« Reply #13 on: September 26, 2013, 06:09:38 am »

However its not always completely flat-lined as you would expect from hard-clipping, but shows fluctuations close to the maximum.

I think this is typical because mastering normally uses a hard limiter that's more sophisticated than a simple brick wall.

Unfortunately that complex limiter also makes it more difficult to undo the limiting.

I've listened to some declipping algorithms that try to switch to the frequency domain and rebuild missing data that way, but the effect sounded a little weird to me.
Logged
Matt Ashland, JRiver Media Center

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #14 on: September 26, 2013, 06:27:38 am »

I think this is typical because mastering normally uses a hard limiter that's more sophisticated than a simple brick wall.


So that makes you think its actually clipped in production, not in decoding?
That was kind of my intention to try to hint at.
Logged
~ nevcairiel
~ Author of LAV Filters

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42323
  • Shoes gone again!
Re: TrueHD vs AC3 decoder
« Reply #15 on: September 26, 2013, 06:52:47 am »

So that makes you think its actually clipped in production, not in decoding?

Since it passes a lossless check and isn't a clear flat-line, I think that's the most likely answer.

Mastering really dynamic stuff is a challenge.  If they want people to be able to hear dialog, they may need to allow some dynamic range to be lost (with a limiter) during the really loud stuff.  As long as it's only during loud bursts, it probably isn't a huge deal with regards to sound quality.
Logged
Matt Ashland, JRiver Media Center

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #16 on: September 26, 2013, 09:35:08 am »

I've analysed a Region B (New Zealand) release of Star Trek: Into Darkness and get the following much lower levels on the TrueHD track:

+1.6dBTP +0.9L +1.3R +1.6C -0.1Sub +0.1RL -0.0RR +0.1SL +0.7SR

Subjectively I couldn't hear any clipping during playback.

Would you mind setting a Playback Range of 00:05:40-00:06:10 on the movie and then doing a Convert Format > Convert Video to Audio with no DSP. If you choose FLAC it will create a multi-channel FLAC exactly as decoded. The file will be about 18 MB and the whole process only takes about 10 seconds.

Hendrik, did you run Analyze Audio yet on your copy?
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #17 on: September 26, 2013, 09:40:20 am »

Hendrik, did you run Analyze Audio yet on your copy?

No, I didn't rip it to MKV yet, its not getting into my library otherwise.
But i looked at the waveform of the 6 minute mark and it looked very similar to yours.

I'll try to remember to do the analysis tomorrow.
Logged
~ nevcairiel
~ Author of LAV Filters

terrym@tassie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 503
Re: TrueHD vs AC3 decoder
« Reply #18 on: September 26, 2013, 01:38:10 pm »

Hi Audio extract in flac format for range requested is here: http://www.mediafire.com/download/fny8zgizey1ak32/Star_Trek_Into_Darkness_t00.flac

Looking at the file in Audacity it appears to have the same clipping on the LFE channel as shown in the OP.
Logged
Good manners cost nothing.
Bad manners can cost you your reputation
― B.D.Hawkey

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #19 on: September 26, 2013, 03:20:01 pm »

Thanks for the clip. Yes, they are identical. I wonder why the different peak readings?

Logged

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #20 on: September 26, 2013, 03:34:10 pm »

I'll need to try to spot the clipping on my actual 7.1 speakers, in a downmix on the headphones it seems to easily disappear to some extent from the mixing.
Maybe the clipping gets amplified because of the general high levels of the audio, and applying the 4dB dialnorm would hide it to some degree. I'm not sure I'll find the time to test this before my vacation, though.
I don't think you need to spend anymore time on this.

Enjoy your vacation!  8)
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #21 on: September 27, 2013, 07:54:00 am »

These are my analysis results for the R128 Peaks:
+1.6dBTP +0.9L +1.3R +1.6C -0.1Sub +0.1RL -0.0RR +0.1SL +0.7SR

Seems to be exactly the same as terrym@nz above
Logged
~ nevcairiel
~ Author of LAV Filters

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #22 on: September 27, 2013, 10:32:19 am »

Strange, the waveforms match exactly for all channels for the clip terrym@nz gave me vs my own clip. I wonder why the Peal Levels (R128) are different?

I reran Analyze Audio twice on the complete movie and got the following:

TrueHD:  +3.7BTP +2.7L +1.7R +3.7C -0.1Sub -0.0RL +0.1RR +0.2SL +0.0SR (same as before)

AC3:  +5.3dBTP +2.8L +1.8R +3.9C +4.5Sub +4.6SL +5.3SR

On a side note, why the -0.0 and +0.0 entries? I don't mind the +/-, but I would think it would be consistent. Maybe it is due to rounding.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #23 on: September 27, 2013, 10:35:32 am »

On a side note, why the -0.0 and +0.0 entries? I don't mind the +/-, but I would think it would be consistent. Maybe it is due to rounding.

Float actually has a concept of negative and positive zero, however in this case its most likely just rounding.
Logged
~ nevcairiel
~ Author of LAV Filters

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10923
Re: TrueHD vs AC3 decoder
« Reply #24 on: September 27, 2013, 10:37:47 am »

Maybe my EU disc is slightly different?
I also watched the movie today, and i didn't notice any obvious distortions in the scenes that were mentioned over at AVS, but as I said before, I'm not the best to spot such things.
Logged
~ nevcairiel
~ Author of LAV Filters

mojave

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3732
  • Requires "iTunes or better" so I installed JRiver
Re: TrueHD vs AC3 decoder
« Reply #25 on: September 27, 2013, 10:58:31 am »

My positive zero is bigger than your negative zero.  ;D
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72367
  • Where did I put my teeth?
Re: TrueHD vs AC3 decoder
« Reply #26 on: September 27, 2013, 11:13:48 am »

I doubt you can be positive.
Logged
Pages: [1]   Go Up