[vlc-devel] [RFC v2 2/2] audio: let VLC decode more than 9 audio channels

Emeric Grange egrange at gopro.com
Mon Oct 12 18:02:38 CEST 2015


---
 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,
+
+    0
 };

 #define AOUT_RESTART_FILTERS 1
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
 #define AOUT_CHAN_LFE               0x1000
+#define AOUT_CHAN_TOP_CENTER        0x2000
+#define AOUT_CHAN_TOP_FRONT_CENTER  0x4000
+#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

 #define AOUT_CHANS_FRONT  (AOUT_CHAN_LEFT       | AOUT_CHAN_RIGHT)
 #define AOUT_CHANS_MIDDLE (AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT)
 #define AOUT_CHANS_REAR   (AOUT_CHAN_REARLEFT   | AOUT_CHAN_REARRIGHT)
 #define AOUT_CHANS_CENTER (AOUT_CHAN_CENTER     | AOUT_CHAN_REARCENTER)
+#define AOUT_CHANS_TOP_FRONT  (AOUT_CHAN_TOP_FRONT_LEFT | AOUT_CHAN_TOP_FRONT_RIGHT)
+#define AOUT_CHANS_TOP_REAR   (AOUT_CHAN_TOP_REAR_LEFT  | AOUT_CHAN_TOP_REAR_LEFT)
+#define AOUT_CHANS_TOP_CENTER (AOUT_CHAN_TOP_CENTER     | AOUT_CHAN_TOP_FRONT_CENTER | AOUT_CHAN_TOP_REAR_CENTER)

 #define AOUT_CHANS_STEREO AOUT_CHANS_2_0
 #define AOUT_CHANS_2_0    (AOUT_CHANS_FRONT)
@@ -128,6 +140,7 @@ struct audio_format_t
 #define AOUT_CHANS_7_0    (AOUT_CHANS_6_0   | AOUT_CHAN_CENTER)
 #define AOUT_CHANS_7_1    (AOUT_CHANS_5_1   | AOUT_CHANS_MIDDLE)
 #define AOUT_CHANS_8_1    (AOUT_CHANS_7_1   | AOUT_CHAN_REARCENTER)
+#define AOUT_CHANS_16_0   (AOUT_CHANS_8_1   | AOUT_CHANS_TOP_FRONT | AOUT_CHANS_TOP_CENTER | AOUT_CHANS_TOP_REAR)

 #define AOUT_CHANS_4_0_MIDDLE (AOUT_CHANS_FRONT | AOUT_CHANS_MIDDLE)
 #define AOUT_CHANS_4_CENTER_REAR (AOUT_CHANS_FRONT | AOUT_CHANS_CENTER)
@@ -139,8 +152,8 @@ struct audio_format_t
 #define AOUT_CHAN_DUALMONO          0x20000
 #define AOUT_CHAN_REVERSESTEREO     0x40000

-#define AOUT_CHAN_PHYSMASK          0xFFFF
-#define AOUT_CHAN_MAX               9
+#define AOUT_CHAN_PHYSMASK          0xFFFFF
+#define AOUT_CHAN_MAX               18

 /**
  * Picture orientation.
diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index e473cfb..c09f31b 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -81,6 +81,9 @@ static const uint16_t pi_channels_maps[] =
     AOUT_CHAN_CENTER, AOUT_CHANS_2_0, AOUT_CHANS_3_0,
     AOUT_CHANS_4_0,   AOUT_CHANS_5_0, AOUT_CHANS_5_1,
     AOUT_CHANS_7_0,   AOUT_CHANS_7_1, AOUT_CHANS_8_1,
+    0,                0,              0,
+    0,                0,              0,
+    AOUT_CHANS_16_0,  0,              0,
 };

 static void S8Decode( void *, const uint8_t *, unsigned );
diff --git a/modules/demux/windows_audio_commons.h b/modules/demux/windows_audio_commons.h
index 80aa5cb..a2230d4 100644
--- a/modules/demux/windows_audio_commons.h
+++ b/modules/demux/windows_audio_commons.h
@@ -29,11 +29,24 @@
 static const uint32_t pi_channels_src[] = { WAVE_SPEAKER_FRONT_LEFT,
     WAVE_SPEAKER_FRONT_RIGHT, WAVE_SPEAKER_FRONT_CENTER,
     WAVE_SPEAKER_LOW_FREQUENCY, WAVE_SPEAKER_BACK_LEFT, WAVE_SPEAKER_BACK_RIGHT,
-    WAVE_SPEAKER_BACK_CENTER, WAVE_SPEAKER_SIDE_LEFT, WAVE_SPEAKER_SIDE_RIGHT, 0 };
+    WAVE_SPEAKER_FRONT_LEFT_OF_CENTER, WAVE_SPEAKER_FRONT_RIGHT_OF_CENTER,
+    WAVE_SPEAKER_BACK_CENTER, WAVE_SPEAKER_SIDE_LEFT, WAVE_SPEAKER_SIDE_RIGHT,
+    WAVE_SPEAKER_TOP_CENTER,
+    WAVE_SPEAKER_TOP_FRONT_LEFT, WAVE_SPEAKER_TOP_FRONT_CENTER,  WAVE_SPEAKER_TOP_FRONT_RIGHT,
+    WAVE_SPEAKER_TOP_BACK_LEFT,  WAVE_SPEAKER_TOP_BACK_CENTER, WAVE_SPEAKER_TOP_BACK_RIGHT,
+    0,
+};

 static const uint32_t pi_channels_aout[] = { AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
     AOUT_CHAN_CENTER, AOUT_CHAN_LFE, AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT,
-    AOUT_CHAN_REARCENTER, AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT, 0 };
+    AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
+    AOUT_CHAN_REARCENTER,
+    AOUT_CHAN_SIDE_LEFT, AOUT_CHAN_SIDE_RIGHT,
+    AOUT_CHAN_TOP_CENTER,
+    AOUT_CHAN_TOP_FRONT_LEFT, AOUT_CHAN_TOP_FRONT_CENTER, AOUT_CHAN_TOP_FRONT_RIGHT,
+    AOUT_CHAN_TOP_REAR_LEFT, AOUT_CHAN_TOP_REAR_CENTER, AOUT_CHAN_TOP_REAR_RIGHT,
+    0,
+};

 static inline unsigned getChannelMask( uint32_t * wvfextChannelMask, int i_channels, int * i_match )
 {
--
2.6.1


More information about the vlc-devel mailing list