[vlc-devel] [PATCH] spacialaudio: discard non diegetic channels

Pierre Lamot pierre at videolabs.io
Mon May 28 16:54:31 CEST 2018


On lundi 28 mai 2018 16:43:12 CEST Francois Cartegnie wrote:
> Le 28/05/2018 à 16:29, Pierre Lamot a écrit :
> > ---
> > 
> >  modules/audio_filter/channel_mixer/spatialaudio.cpp | 19
> >  ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
> > 
> > diff --git a/modules/audio_filter/channel_mixer/spatialaudio.cpp
> > b/modules/audio_filter/channel_mixer/spatialaudio.cpp index
> > 6448585e37..f12350333d 100644
> > --- a/modules/audio_filter/channel_mixer/spatialaudio.cpp
> > +++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp
> > @@ -123,6 +123,7 @@ struct filter_spatialaudio
> > 
> >      }
> 
> if that's only pow(2) values, that can be simplified without roundings.

No, allowed number of channels are in the form (1 + n)^2 + 2j with j = 0..1
for order 2, you have 9 channels, and 11 for order 2 with non-diegetic.

> if( popcount(channels) > 1 )
>  error;
> order = ctz(channels);
> 
> > -    p_sys->i_order = sqrt(infmt->i_channels) - 1;
> > +    p_sys->i_order = floor(sqrt(infmt->i_channels)) - 1;
> > +    p_sys->i_nondiegetic = infmt->i_channels - ( (p_sys->i_order + 1) *
> > (p_sys->i_order + 1) );--
> Francois Cartegnie
> VideoLAN - VLC Developer
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
--
Pierre Lamot



More information about the vlc-devel mailing list