[MPlayer-dev-eng] [PATCH] Automatic downmix

Tobias Diedrich ranma at tdiedrich.de
Fri Sep 24 20:33:06 CEST 2010


Clément Bœsch wrote:
> On Thu, Sep 23, 2010 at 03:03:31PM +0200, Clément Bœsch wrote:
> > > For example:
> > > 
> > > Lt = 1.0*L + 0.707*C + 0.707*LFE - 0.8165*Ls - 0.5774*Rs
> > > Rt = 1.0*R + 0.707*C + 0.707*LFE + 0.5774*Ls + 0.8165*Rs
> > > 
> > 
> > That sure could be used for one case. I'm going to test those values, and
> > see if I can adapt them to all the other input channels case.
> > 
> 
> Well, I just did try those values, and I'm not really enthusiastic about
> the actual result (RL and RR are mixed and have a weird sound, I get
> saturation in some cases, etc.).

Did you try the adjusted matrix, where everything adds up to 1? That
one shoulnd't have saturation.
RL+RR will have weird sound because it's dolby encoded, so you'd
need to put it into a dolby decoder to get the rear channels back.

I'm not proposing to have this as default, but optional because it
makes sense to have this option for people with an old dolby
surround amplifier.

For normal non-dolby stereo this would make more sense:
Lt = 1.0*L + 0.707*C + 0.707*LFE + 1.0*Ls
Rt = 1.0*R + 0.707*C + 0.707*LFE + 1.0*Rs

Normalized to add up to 1.0:
Lt = .2929*L + .207*C + .207*LFE + .2929*Ls
Rt = .2929*R + .207*C + .207*LFE + .2929*Rs

For best usability I'd imagine having a 'downmix' filter where you
can just specify the unnormalized 5.1 downmix matrix would be great
I think.
i.e. "-af downmix=1.0:1.0:0.707:0.707:1.0:1.0" (downmix=L:R:C:LFE:Ls:Rs)
and the filter would normalize to a sum of 1.0 internally.

Oh, and this links explains where the .707 for C and LFE is coming from:
http://ac3filter.net/guides/mixing_matrix

"We should hear the center channel from between of left and right
channels. To do this we should route equal amount of the center
channel to the left and to the right. But if we mix the center to
both front channels it will be louder than just one original center
channel! Therefore we should attenuate it. It's why the value of 0.7
is in the mixing matrix"

"Why 0.7 and not 0.5 (twice quieter)? No, it's not a bug. Loudness
is not summed as usual. We must sum the *power* of the signal.
Simply talking, we must sum squared amplitudes"

Or in electrical engineering terms:
The sampled waveform records the voltage.
If we halve the voltage we also halve the current and thus get only
one quarter of the power output.

But we want to distribute the power output of one center speaker
onto the left and right channels, so each should get half of the
power output, not just one quarter.

So we need to multiply by 1/sqrt(2) instead of 1/2.

-- 
Tobias						PGP: http://8ef7ddba.uguu.de


More information about the MPlayer-dev-eng mailing list