[vlc-devel] [RFC v2 2/2] audio: let VLC decode more than 9 audio channels
Emeric Grange
emeric.grange at gmail.com
Tue Oct 13 17:48:34 CEST 2015
2015-10-12 18:16 GMT+02:00 Jean-Baptiste Kempf <jb at videolan.org>:
> On 12 Oct, Emeric Grange wrote :
>> ---
>> include/vlc_aout.h | 14 +++++++++++++-
>> include/vlc_es.h | 17 +++++++++++++++--
>> modules/codec/araw.c | 3 +++
>> modules/demux/windows_audio_commons.h | 17 +++++++++++++++--
>> 4 files changed, 46 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/vlc_aout.h b/include/vlc_aout.h
>> index 630be72..df16254 100644
>> --- a/include/vlc_aout.h
>> +++ b/include/vlc_aout.h
>> @@ -177,7 +177,19 @@ static const uint32_t pi_vlc_chan_order_wg4[] =
>> AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
>> AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
>> AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT, AOUT_CHAN_REARCENTER,
>> - AOUT_CHAN_CENTER, AOUT_CHAN_LFE, 0
>> + AOUT_CHAN_CENTER, AOUT_CHAN_LFE,
>> +
>> + AOUT_CHAN_SIDE_LEFT,
>> + AOUT_CHAN_SIDE_RIGHT,
>> + AOUT_CHAN_TOP_CENTER,
>> + AOUT_CHAN_TOP_FRONT_CENTER,
>> + AOUT_CHAN_TOP_FRONT_LEFT,
>> + AOUT_CHAN_TOP_FRONT_RIGHT,
>> + AOUT_CHAN_TOP_REAR_CENTER,
>> + AOUT_CHAN_TOP_REAR_LEFT,
>> + AOUT_CHAN_TOP_REAR_RIGHT,
>
> Are you sure this is the correct wg4 order?
>
>> diff --git a/include/vlc_es.h b/include/vlc_es.h
>> index 97cdb78..1ce8b7e 100644
>> --- a/include/vlc_es.h
>> +++ b/include/vlc_es.h
>> @@ -108,12 +108,24 @@ struct audio_format_t
>> #define AOUT_CHAN_REARRIGHT 0x40
>> #define AOUT_CHAN_MIDDLELEFT 0x100
>> #define AOUT_CHAN_MIDDLERIGHT 0x200
>> +#define AOUT_CHAN_SIDE_LEFT 0x400
>> +#define AOUT_CHAN_SIDE_RIGHT 0x800
>
> I still don't understand what this AOUT_CHAN_SIDE_RIGHT and
> AOUT_CHAN_SIDE_LEFT are.
>
> AOUT_CHAN_MIDDLE* corresponds to SPEAKER_SIDE_LEFT and
> SPEAKER_SIDE_RIGHT, since AOUT_CHANS_7_1 should correspond to
> KSAUDIO_SPEAKER_7POINT1_SURROUND
Ok I've been reading a bit about speakers. Now I'm lost too.
What seems to be the "reference" when naming speakers is the listing
from WAVE_FORMAT_EX
(https://msdn.microsoft.com/en-us/library/windows/hardware/dn653308(v=vs.85).aspx)
So the way you are using 7.1 it does indeed seems that MIDDLE
correspond to SIDE. So yeah, I'll change SIDE_* to FRONTLEFTOF*.
This is the correspondence between VLC naming and WAVE_FORMAT_EX:
/* Values available for audio channels */
#define AOUT_CHAN_CENTER 0x1 // front center
#define AOUT_CHAN_LEFT 0x2 // front left
#define AOUT_CHAN_RIGHT 0x4 // front right
#define AOUT_CHAN_REARCENTER 0x10 // back center
#define AOUT_CHAN_REARLEFT 0x20 // back left (also
called surround left "B" when there is no side left/right in the
speaker configuration)
#define AOUT_CHAN_REARRIGHT 0x40 // back right (also
called surround right "B")
#define AOUT_CHAN_MIDDLELEFT 0x100 // side left (also
called surround left "A" most of the time)
#define AOUT_CHAN_MIDDLERIGHT 0x200 // side right (also
called surround right "A" most of the time)
#define AOUT_CHAN_FRONT_LEFT_of_CENTER 0x400 // previously what I
called side left
#define AOUT_CHAN_FRONT_RIGHT_of_CENTER 0x800 // previously what I
called side right
#define AOUT_CHAN_LFE 0x1000
#define AOUT_CHAN_TOP_CENTER 0x2000 // front "height" center
#define AOUT_CHAN_TOP_FRONT_CENTER 0x4000 // etc...
#define AOUT_CHAN_TOP_FRONT_LEFT 0x8000
#define AOUT_CHAN_TOP_FRONT_RIGHT 0x100000
#define AOUT_CHAN_TOP_REAR_CENTER 0x200000
#define AOUT_CHAN_TOP_REAR_LEFT 0x400000
#define AOUT_CHAN_TOP_REAR_RIGHT 0x800000
Your profiles could also use a bit of documentation, so I came up with
that after reading this page
(https://en.wikipedia.org/wiki/Surround_sound#Standard_speaker_channels)
:
#define AOUT_CHANS_3_0 (AOUT_CHANS_FRONT | AOUT_CHAN_CENTER) //
3.0 stereo
#define AOUT_CHANS_3_1 (AOUT_CHANS_3_0 | AOUT_CHAN_LFE)
#define AOUT_CHANS_4_0 (AOUT_CHANS_FRONT | AOUT_CHANS_REAR) //
4.0 quadraphonic (dolby, but using rear left/right as surround
left/right)
#define AOUT_CHANS_4_1 (AOUT_CHANS_4_0 | AOUT_CHAN_LFE)
#define AOUT_CHANS_5_0 (AOUT_CHANS_4_0 | AOUT_CHAN_CENTER) //
5.0 surround (dolby)
#define AOUT_CHANS_5_1 (AOUT_CHANS_5_0 | AOUT_CHAN_LFE)
#define AOUT_CHANS_6_0 (AOUT_CHANS_4_0 | AOUT_CHANS_MIDDLE) //
what is this one? seems like 6.0 side (4.0 surround + side left/right)
but using 4.0 quadriphonic instead
#define AOUT_CHANS_7_0 (AOUT_CHANS_6_0 | AOUT_CHAN_CENTER) //
what is this one?
#define AOUT_CHANS_7_1 (AOUT_CHANS_5_1 | AOUT_CHANS_MIDDLE) //
7.1 surround (dolby)
#define AOUT_CHANS_8_1 (AOUT_CHANS_7_1 | AOUT_CHAN_REARCENTER) //
seems ok but I can't find any resources about it
I think these one could be added:
#define AOUT_CHANS_9_1 (AOUT_CHANS_7_1 | AOUT_CHANS_TOP_FRONT) //
9.1 surround (dolby)
#define AOUT_CHANS_11_1 (AOUT_CHANS_9_1 |
AOUT_CHAN_FRONT_LEFT_of_CENTER | AOUT_CHAN_FRONT_RIGHT_of_CENTER) //
11.1 surround (dolby)
And finally this one (I don't know anything about the other "special" profiles:
#define AOUT_CHANS_4_CENTER_REAR (AOUT_CHANS_FRONT |
AOUT_CHANS_CENTER) // 4.0 surround
> With my kindest regards,
>
> --
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list