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

Rémi Denis-Courmont remi at remlab.net
Mon May 28 18:50:44 CEST 2018


Even if it is not a power of two, you shouldn't use double precision for integral square rooting. You can use clz().

Le 28 mai 2018 16:54:31 GMT+02:00, Pierre Lamot <pierre at videolabs.io> a écrit :
>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
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180528/2a8c5a4d/attachment.html>


More information about the vlc-devel mailing list