[FFmpeg-devel] [PATCH] rematrix DPLII fix for channel downmixing. Surround now adds to front rather than taking away.

Michael Niedermayer michaelni at gmx.at
Sat Mar 15 20:56:54 CET 2014


On Sat, Mar 15, 2014 at 07:02:00PM +0000, Peter Robertson wrote:
> On 15/03/14 18:00, Michael Niedermayer wrote:
> > On Sat, Mar 15, 2014 at 05:51:09PM +0100, Hendrik Leppkes wrote:
> >> On Sat, Mar 15, 2014 at 4:46 PM, Peter Robertson
> >> <Peter at corrosivetruths.org> wrote:
> >>> This fixes a problem where trying to convert gameplay sound to Dolby Pro
> >>> Logic II would result in a left channel that would be missing the sounds
> >>> that were in center and back left at the same time. I also applied it to
> >>> Dolby Pro Logic as it should work the same way. Sorry if I've done
> >>> anything wrong, first patch. Fixes #3455
> >>>
> >> The encoding matrix for DPL/DPLII is defined by Dolby, and only sounds
> >> good if you use a DPL compatible decoder to reconstruct the original
> >> signal.
> >> Its not necessarily supposed to be played as stereo through stereo speakers.
> >>
> >> All Information I could find about DPL encoding suggests that the
> >> implementation is correct as it is today. Left channel subtracts both
> >> surrounds, and right channel adds them.
> > The EAC-3 specs suggested downmix also seems to match this
> >
> > [...]
> >
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> Could you point me at them? Might help me figure out what's going wrong.
> 
> Like I think the amounts are wrong.
> 
>                 matrix[FRONT_LEFT ][BACK_LEFT ] -= s->slev * SQRT3_2;
>                 matrix[FRONT_LEFT ][BACK_RIGHT] -= s->slev * M_SQRT1_2;
>                 matrix[FRONT_RIGHT][BACK_LEFT ] += s->slev * M_SQRT1_2;
>                 matrix[FRONT_RIGHT][BACK_RIGHT] += s->slev * SQRT3_2;
> 
> Doesn't seem right; I thought it was sqrt of either 6/25 or 19/25 rather
> than 1/2 3/2.

the equations in (e)ac3 that i found: (these dont cover this second
case, only the first)


    if (output_mode == 2/0 Dolby Surround compatible)
    /* 2 ch matrix encoded output requested */
    {
        if (input_nfront != 2)
        {
                mix center into left with -3 dB gain ;
                mix center into right with -3 dB gain ;
        }
        if (input_nrear == 1)
        {
                mix -mono surround into left with -3 dB gain ;
                mix mono surround into right with -3 dB gain ;
        }
        else if (input_nrear == 2)
        {
                mix -left surround into left with -3 dB gain ;
                mix -right surround into left with -3 dB gain ;
                mix left surround into right with -3 dB gain ;
                mix right surround into right with -3 dB gain ;
        }


And

        Prior to the scaling needed to prevent overflow, the 3/2 downmix equations for an LtRt stereo
    signal are
                            Lt = 1.0 * L + 0.707 * C - 0.707 * Ls - 0.707 * Rs ;
                            Rt = 1.0 * R + 0.707 * C + 0.707 * Ls + 0.707 * Rs ;


                            [...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140315/1a3b2ea5/attachment.asc>


More information about the ffmpeg-devel mailing list