[vlc-devel] Ticket 493 resolved - Multichannel AAC working now(hopefully)

Andre Weber WeberAndre at gmx.de
Sun Feb 10 19:25:56 CET 2008


Hello,

reworked the patch from "gmw" to a clean version, he pointed out that the function
faad.c "DoReordering" works only for stereo, and not for multichannel audio - so
I looked into the source to understand the logic behind, and found that the logic is wrong
and does no channel ordering ... for most case it did just nothing...:)

here is a small example... to understand what should happen and what didn't happen...

Input Channel order values: (just an example)
---------------------------------------------
pi_chan_positions[0] = AOUT_CHAN_LEFT;
pi_chan_positions[1] = AOUT_CHAN_CENTER;
pi_chan_positions[2] = AOUT_CHAN_RIGHT;
pi_chan_positions[3] = AOUT_CHAN_REARLEFT;
pi_chan_positions[4] = AOUT_CHAN_REARRIGHT;
pi_chan_positions[5] = AOUT_CHAN_LFE;

Required Channel order after reordering...
------------------------------------------------------------
static const uint32_t pi_channels_ordered[MAX_CHANNEL_POSITIONS] =
    { AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
      AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
      AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT,
      AOUT_CHAN_CENTER, AOUT_CHAN_REARCENTER, AOUT_CHAN_LFE
    };

Expected Content of
========================
pi_chan_table[0] = 0;
pi_chan_table[1] = 4;
pi_chan_table[2] = 1;
pi_chan_table[3] = 2;
pi_chan_table[4] = 3;
pi_chan_table[5] = 5;
(defines the following write channel X of source to channel Y of dest... where X is index into pi_chan_table)

the current algorithm produces this channel table:
====================================
pi_chan_table[0] = 0;
pi_chan_table[1] = 1;
pi_chan_table[2] = 2;
pi_chan_table[3] = 3;
pi_chan_table[4] = 4;
pi_chan_table[5] = 5;

current implementation
================
    for( k = 0, j = 0; k < i_nb_channels; k++ )
    {
        for( i = 0; i < MAX_CHANNEL_POSITIONS; i++ )
        {
            if( pi_channels_ordered[i] == pi_chan_positions[k] )
            {
                pi_chan_table[k] = j++;
                break;
            }
        }
    }

my suggestions based on patch from jenny.sebastian at gmail.com
[vlc-devel] Ticket 493 resolved - Multichannel AAC working now(hopefully)

    j = 0;
    for( i = 0; i < MAX_CHANNEL_POSITIONS; i++ )
    {
       for( k = 0; k < i_nb_channels; k++ )
        {
            if( pi_channels_ordered[i] == pi_chan_positions[k] )
            {
                pi_chan_table[k] = j++;
                break;
            }
        }
    }

will produces this content .... in pi_chan_table
pi_chan_table[0] = 0;
pi_chan_table[1] = 4;
pi_chan_table[2] = 1;
pi_chan_table[3] = 2;
pi_chan_table[4] = 3;
pi_chan_table[5] = 5;

---
the honor for the fix - belongs to gmw...



André
----
Atmo



----- Original Message ----- 
From: "Sebastian Jenny" <jenny.sebastian at gmail.com>
To: <vlc-devel at videolan.org>
Sent: Saturday, February 09, 2008 4:47 AM
Subject: [vlc-devel] Ticket 493 resolved - Multichannel AAC working now(hopefully)


> Hey there!
>
> After getting really annoyed by AAC messing up for years now I've decided to
> take a look at it myself (you know, I'm not a coder or anything, just
> regular VLC user). Well after trying for about 2 days, most of the time
> spending to compile the source to begin with, I eventually figured out a
> probably really ugly hack. Tested only on my sys, should work fine though
> with stereo and 6channel AAC. No idea about any other channel
> configurations. Heh, have a nice day all ;)
>
> Best Regards,
> gmw
>



> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: faad.diff
Type: text/x-diff
Size: 518 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080210/21d59c1b/attachment.diff>
-------------- next part --------------
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list