From d81961eded356475a9ab9db7e5f270bc50bc6a4e Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 26 Feb 2024 14:12:49 +0100 Subject: [PATCH 1/3] issue 993: remove unused function ivas_sba_get_order(); under FIX_993_REMOVE_SBA_GET_ORDER --- lib_com/ivas_prot.h | 3 ++- lib_com/ivas_sba_config.c | 8 ++++++-- lib_com/options.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index d0c797e27d..eab3f6664b 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3496,12 +3496,13 @@ ivas_error ivas_cldfb_dec_reconfig( const int16_t numCldfbSyntheses_old /* i : number of CLDFB synthesis instances in previous frame */ ); +#ifndef FIX_993_REMOVE_SBA_GET_ORDER /*! r: Ambisonic (SBA) order */ int16_t ivas_sba_get_order( const int16_t nb_channels, /* i : Number of ambisonic channels */ const int16_t sba_planar /* i : SBA planar flag */ ); - +#endif /*! r: Ambisonic (SBA) order used for analysis and coding */ int16_t ivas_sba_get_analysis_order( const int32_t ivas_total_brate, /* i : IVAS total bitrate */ diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index 52ed4672b6..ddb59b2ed5 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -70,7 +70,11 @@ void ivas_sba_config( } else if ( sba_order < 0 ) { +#ifdef FIX_993_REMOVE_SBA_GET_ORDER + assert( !"SBA order cannot be negative!" ); +#else sba_order = ivas_sba_get_order( nb_channels, sba_planar ); +#endif } else if ( nb_channels < 0 ) { @@ -117,7 +121,7 @@ void ivas_sba_config( return; } - +#ifndef FIX_993_REMOVE_SBA_GET_ORDER /*-------------------------------------------------------------------* * ivas_sba_get_order() * @@ -147,7 +151,7 @@ int16_t ivas_sba_get_order( return ( sba_order ); } - +#endif /*-------------------------------------------------------------------* * ivas_sba_get_analysis_order() diff --git a/lib_com/options.h b/lib_com/options.h index f79b346839..e48c28c5b6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -164,6 +164,7 @@ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ #define FIX_1008_EXTORIENT_TARGET_INTERPOLATION /* FhG: issue #1008, external orientation init was wrong for 5ms */ +#define FIX_993_REMOVE_SBA_GET_ORDER /* VA: issue 993: remove unused function ivas_sba_get_order() */ /* #################### End BE switches ################################## */ -- GitLab From 002745f9b6d0ce470d4dc5e17e6bd452dea89161 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 29 Feb 2024 12:10:30 +0100 Subject: [PATCH 2/3] Remove "sba_order < 0" conditions --- lib_com/ivas_sba_config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index ddb59b2ed5..eb4e8e49be 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -64,19 +64,19 @@ void ivas_sba_config( int16_t *element_mode /* o : element mode of the core coder */ ) { +#ifndef FIX_993_REMOVE_SBA_GET_ORDER if ( ( sba_order < 0 ) && ( nb_channels < 0 ) ) { assert( 0 && "Either order or number of channels must be positive" ); } else if ( sba_order < 0 ) { -#ifdef FIX_993_REMOVE_SBA_GET_ORDER - assert( !"SBA order cannot be negative!" ); -#else sba_order = ivas_sba_get_order( nb_channels, sba_planar ); -#endif } else if ( nb_channels < 0 ) +#else + if ( nb_channels < 0 ) +#endif { nb_channels = ivas_sba_get_nchan( sba_order, sba_planar ); } -- GitLab From b4c0d7fcc038ae3c813394c9b9da6fc2c3dab24d Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 29 Feb 2024 12:18:45 +0100 Subject: [PATCH 3/3] Remove setting of nb_channels - the parameter is not really used --- lib_com/ivas_sba_config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index eb4e8e49be..f7f32c6a9a 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -74,13 +74,13 @@ void ivas_sba_config( sba_order = ivas_sba_get_order( nb_channels, sba_planar ); } else if ( nb_channels < 0 ) -#else - if ( nb_channels < 0 ) -#endif { nb_channels = ivas_sba_get_nchan( sba_order, sba_planar ); } else +#else + if ( nb_channels > 0 ) +#endif { if ( sba_planar ) { -- GitLab