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

Francois Cartegnie fcvlcdev at free.fr
Mon May 28 16:43:12 CEST 2018


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.

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


More information about the vlc-devel mailing list