libavresample: Dolby downmix oddity

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

libavresample: Dolby downmix oddity

Post by mithrandir »

I discovered an additional issue.

I played back the SVN 4899 encode I made where I converted the DTS-HD track to AC3 with DPL2 mixdown. Over a 5.1 setup with my receiver's surround mode set to DPL2 I noticed the left surround channel was practically silent while the right surround (and all other channels) played at normal volume. Scenes where noticeable sounds should be coming out the left surround did not have these sounds. (The left surround wasn't entirely quiet though because there is some cross-channel leakage inherent in DPL2.)

Using either SVN 4782 or 4829, I tried DTS-HD -> AC3/DPL2 and there was no audio from the left surround. I also tried DTS (lossy) -> AC3/DPL2 and found the audio was good, all channels had sound.

Using SVN 4899, I tried DTS (lossy) -> AC3/DPL2 but there was no audio from the left surround.

So DPL2 is completely busted in 4899 for DTS and was working for DTS (but not DTS MasterAudio) in 4782 and 4829.

It's a lot to keep track of, I know. And yes, I'll retry with ~4907 that will get built soon.
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

Re: SVN 4887 - hb_audio_resample errors

Post by mithrandir »

OK, good news is that SVN 4907 fixes the problem with the AC3 2.0 tracks. The audio of these secondary tracks is clean without any buzzing. I also haven't encountered a situation where the encode process terminates early. So I believe you can close this particular bug.

The issue with the DPL2 and DS mixdown remains. I'll create a new thread for that.
Deleted User 11865

Re: SVN 4887 - hb_audio_resample errors

Post by Deleted User 11865 »

OK, so I got a reply from John on the Dolby Pro Logic I/II downmix issue:
JohnAStebbins wrote:There appears to be a strong correlation between rear and front channels. The matrix that does the conversion to dplii subtracts some of both right and left rear from the front left and adds some of right and left rear to the front right. Due to the correlation between the front and rear, this is causing the front left to have diminished volume while the front right gets a boost.

The reason that the downmix built into dca works better in this situation is that it adds a little of back left and subtracts a little of back right to front left. And similarly subtracts a little of back left and adds a little of back right to front right. Since it is flipping the sign it avoids the canceling out effect we are seeing.

The reason I did the matrix this way is
1) this scenario didn't occur to me
2) wikipedia does it this way
and
3) i originally copied what a52dec and libdca did but someone on the forums that sounded like they knew what they were talking about said it should be the other way.

I am guessing that there are channel separation advantages to doing it the current way, but it has this downside of diminishing the left and amplifying the right channels when there is strong correlation between front and rear sound. So we may want to flip the sign.

As I said, I originally did it the other way, and both ways "worked" in my home testing.
mithrandir
Enlightened
Posts: 101
Joined: Sun Nov 30, 2008 2:24 pm

Re: libavresample: Dolby downmix oddity

Post by mithrandir »

That is quite interesting and I'm concerned situations of strong front-rear correlation may be more typical than perhaps assumed.

Before this particular situation I've been setting my left rear channel's volume higher than the right rear, even though when I play the receiver's volume-balancing test tone the left is louder. I've had it this way because it seemed more balanced in practice, without ever knowing why. Based on what John is saying above it's possible if not likely that the sources I've been listening to do have scenarios where the right rears are boosted and the left rears are subdued after DPL2 conversion (though rarely as extreme as the example I provided). That's what "prompted" me to adjust the channel volume. It therefore seems to me that the current implementation is not "right" though according to John there does not seem to be a 100% mathematically correct way to do this.

However I would take weaker channel separation over the current implementation because situations like that extract ruin the experience. If I have a vote I'd like John to flip the sign and get that code in a nightly so I can evaluate the impact and provide feedback.
Post Reply