[vlc-devel] [RFC] audio: let VLC decode more than 9 audio channels
Emeric Grange
emeric.grange at gmail.com
Mon Oct 12 17:16:09 CEST 2015
2015-10-07 10:42 GMT+02:00 Jean-Baptiste Kempf <jb at videolan.org>:
> On 06 Oct, Emeric Grange wrote :
>> These channels doesn't have to correspond to "real" output speakers, so the code
>> related to new speakers from the WAVE_FORMAT_PCM is just here to avoid VLC
>> segfaulting when playing these files directly.
>
> Then you need to work on object-based audio.
>
>> - AOUT_CHAN_CENTER, AOUT_CHAN_LFE, 0
>> + AOUT_CHAN_CENTER, AOUT_CHAN_LFE,
>> +
>> + AOUT_CHAN_SIDE_LEFT,
>> + AOUT_CHAN_SIDE_RIGHT,
>
> This is MIDDLE_LEFT, MIDDLE_RIGHT.
Are you sure? What you called MIDDLE_LEFT and MIDDLE_RIGHT seems to
reference SPEAKER_FRONT_LEFT_OF_CENTER and RIGHT. SIDE LEFT and RIGHT
are different. (or is it the other way around?).
>> + AOUT_CHAN_TOP_CENTER,
>> + AOUT_CHAN_TOP_FRONT_CENTER,
>> + AOUT_CHAN_TOP_FRONT_LEFT,
>> + AOUT_CHAN_TOP_FRONT_RIGHT,
>> + AOUT_CHAN_TOP_BACK_CENTER,
>> + AOUT_CHAN_TOP_BACK_LEFT,
>> + AOUT_CHAN_TOP_BACK_RIGHT,
>> +
>> + 0
>> };
>>
>> #define AOUT_RESTART_FILTERS 1
>> diff --git a/include/vlc_es.h b/include/vlc_es.h
>> index 97cdb78..bf0bc11 100644
>> --- a/include/vlc_es.h
>> +++ b/include/vlc_es.h
>> @@ -108,13 +108,28 @@ struct audio_format_t
>> #define AOUT_CHAN_REARRIGHT 0x40
>> #define AOUT_CHAN_MIDDLELEFT 0x100
>> #define AOUT_CHAN_MIDDLERIGHT 0x200
>> -#define AOUT_CHAN_LFE 0x1000
>> +
>> +#define AOUT_CHAN_SIDE_LEFT 0x100
>> +#define AOUT_CHAN_SIDE_RIGHT 0x200
>
> See above.
>
>> +#define AOUT_CHAN_TOP_CENTER 0x400
>> +#define AOUT_CHAN_TOP_FRONT_CENTER 0x800
>> +#define AOUT_CHAN_TOP_FRONT_LEFT 0x1000
>> +#define AOUT_CHAN_TOP_FRONT_RIGHT 0x2000
>> +#define AOUT_CHAN_TOP_BACK_CENTER 0x4000
>> +#define AOUT_CHAN_TOP_BACK_LEFT 0x8000
>> +#define AOUT_CHAN_TOP_BACK_RIGHT 0x10000
>> +
>> +#define AOUT_CHAN_LFE 0x80000
>
> OK.
>
>>
>> #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_BACK_LEFT | AOUT_CHAN_TOP_BACK_LEFT)
>> +#define AOUT_CHANS_TOP_CENTER (AOUT_CHAN_TOP_CENTER | AOUT_CHAN_TOP_FRONT_CENTER | AOUT_CHAN_TOP_BACK_CENTER)
>> +
>> #define AOUT_CHANS_STEREO AOUT_CHANS_2_0
>> #define AOUT_CHANS_2_0 (AOUT_CHANS_FRONT)
>> #define AOUT_CHANS_2_1 (AOUT_CHANS_FRONT | AOUT_CHAN_LFE)
>> @@ -128,6 +143,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_REAR | AOUT_CHANS_TOP_CENTER)
>
> This is incorrect.
Probably, this is only to get a correct "popcount" and let the audio
filter and mixer work.
>> #define AOUT_CHANS_4_0_MIDDLE (AOUT_CHANS_FRONT | AOUT_CHANS_MIDDLE)
>> #define AOUT_CHANS_4_CENTER_REAR (AOUT_CHANS_FRONT | AOUT_CHANS_CENTER)
>> @@ -135,12 +151,12 @@ struct audio_format_t
>> #define AOUT_CHANS_6_1_MIDDLE (AOUT_CHANS_5_0_MIDDLE | AOUT_CHAN_REARCENTER | AOUT_CHAN_LFE)
>>
>> /* Values available for original channels only */
>> -#define AOUT_CHAN_DOLBYSTEREO 0x10000
>> -#define AOUT_CHAN_DUALMONO 0x20000
>> -#define AOUT_CHAN_REVERSESTEREO 0x40000
>> +#define AOUT_CHAN_DOLBYSTEREO 0x100000
>> +#define AOUT_CHAN_DUALMONO 0x200000
>> +#define AOUT_CHAN_REVERSESTEREO 0x400000
>
> You cannot change that, without breaking all the existing plugins.
Ok will fix that for a V2.
>> #define AOUT_CHAN_PHYSMASK 0xFFFF
>> -#define AOUT_CHAN_MAX 9
>> +#define AOUT_CHAN_MAX 18
> 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