From 47b6824dc80031a6df9d1f8d5880eb16db1d5e2c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:19:09 +0200 Subject: [PATCH 01/65] [cleanup] accept USE_NEW_HRTF_BINARY_FILE_FORMAT --- lib_com/options.h | 1 - lib_util/hrtf_file_reader.c | 105 ------------------------------------ 2 files changed, 106 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8556b7947..768a9c33c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ #define LC3PLUS_LEA_COMPAT_BITRATES_48_6 /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel) */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 16a1e8e32..c23d28cbb 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -189,7 +189,6 @@ static ivas_error check_hrtf_binary_header( { /* Check the renderer type */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_PARAMETRIC ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM ) && @@ -197,15 +196,6 @@ static ivas_error check_hrtf_binary_header( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Header of HRTF binary file not compliant (renderer type)" ); } -#else - if ( ( hrtf_header->rend_type != RENDERER_BINAURAL_MIXER_CONV ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_FASTCONV ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_FASTCONV_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_PARAMETRIC ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_OBJECTS_TD ) ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Header of HRTF binary file not compliant (renderer type)" ); - } -#endif /* Check the output format of the decoder */ if ( ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_FOA ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED ) ) @@ -443,19 +433,6 @@ static ivas_error LoadBSplineBinary( LoadBSplineBinaryITD( &HrFiltSet_p->ModelParamsITD, f_hrtf ); } -#ifndef USE_NEW_HRTF_BINARY_FILE_FORMAT - /* left/right energy and interaural coherence for late reverb */ - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), LR_IAC_LENGTH_NR_FC, f_hrtf ); - HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; - } -#endif return IVAS_ERR_OK; } @@ -529,11 +506,7 @@ static ivas_error load_reverb_from_binary( return header_check_result; } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT - is_reverb = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_REVERB_ALL ); -#else is_reverb = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_REVERB_ALL ); -#endif if ( !is_reverb ) { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) @@ -663,11 +636,7 @@ static ivas_error TDREND_MIX_LoadHRTF( return header_check_result; } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT is_tdrend = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD ); -#else - is_tdrend = ( hrtf_header.rend_type == RENDERER_BINAURAL_OBJECTS_TD ); -#endif if ( !is_tdrend ) { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) @@ -962,7 +931,6 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->index_frequency_max_diffuse = *( (uint16_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint16_t ); -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { ( *hHRTF )->inv_diffuse_weight[0][i] = *( (float *) ( hrtf_data_rptr ) ); @@ -973,15 +941,6 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->inv_diffuse_weight[1][i] = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); } -#else - /* inv_diffuse_weight */ - for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) - { - ( *hHRTF )->inv_diffuse_weight[0][i] = *( (float *) ( hrtf_data_rptr ) ); - ( *hHRTF )->inv_diffuse_weight[1][i] = ( *hHRTF )->inv_diffuse_weight[0][i]; - hrtf_data_rptr += sizeof( float ); - } -#endif /* max_total_num_fsamp_per_iteration */ @@ -1092,23 +1051,16 @@ static ivas_error create_HRTF_from_rawdata( static ivas_error create_fastconv_HRTF_from_rawdata( HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ char *hrtf_data, /* i : pointer to binary file */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ -#else - RENDERER_TYPE rend_type, /* i : Renderer type */ -#endif BINAURAL_INPUT_AUDIO_CONFIG input_cfg /* i : Input binaural config */ ) { int16_t i, j; char *hrtf_data_rptr; -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT ivas_error error; -#endif ( *hHRTF )->allocate_init_flag = 0; -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) { if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, 0, input_cfg, RENDERER_BINAURAL_FASTCONV, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) @@ -1127,38 +1079,21 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "renderer type not compliant" ); } -#else - ivas_allocate_binaural_hrtf( *hHRTF, 0, input_cfg, rend_type, ( *hHRTF )->allocate_init_flag ); -#endif hrtf_data_rptr = hrtf_data; -#if !defined USE_NEW_HRTF_BINARY_FILE_FORMAT - /* BINAURAL_CONVBANDS */ - if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); - } - hrtf_data_rptr += sizeof( uint16_t ); -#endif /* HRIR */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#else - if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#endif { ( *hHRTF )->FASTCONV_HRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1205,23 +1140,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) -#endif { /* HRIR_HOA3 */ ( *hHRTF )->FASTCONV_HOA3_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA3_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1267,23 +1196,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) -#endif { /* HRIR_HOA2 */ ( *hHRTF )->FASTCONV_HOA2_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA2_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1330,23 +1253,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) -#endif { /* HRIR_FOA */ ( *hHRTF )->FASTCONV_FOA_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( FOA_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1395,22 +1312,16 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } /* BRIR */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#endif { ( *hHRTF )->FASTCONV_BRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1524,11 +1435,7 @@ ivas_error load_fastconv_HRTF_from_binary( free( hrtf_data ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#else - if ( ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#endif { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) { @@ -1686,11 +1593,7 @@ ivas_error load_parambin_HRTF_from_binary( } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Parametric binauralizer data is represented as single entity */ -#else - if ( hrtf_header.rend_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Parametric binauralizer data is represented as single entity */ -#endif { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) { @@ -1780,11 +1683,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = NULL; if ( hrtf_header.frequency == output_Fs ) { -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) -#else - if ( hrtf_header.rend_type == RENDERER_BINAURAL_MIXER_CONV ) -#endif { if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1803,11 +1702,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_foa ); } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#else - else if ( hrtf_header.rend_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#endif { if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { -- GitLab From 9a1322687eaa63d2ea828d473f5043ea0a2d1703 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:19:44 +0200 Subject: [PATCH 02/65] [cleanup] accept FIX_WARNING_RENDER_CONFIG --- lib_com/options.h | 1 - lib_util/render_config_reader.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 768a9c33c..8a7109fa5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ #define LC3PLUS_LEA_COMPAT_BITRATES_48_6 /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel) */ #define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2262b1940..fd06f07bb 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -438,11 +438,7 @@ static ivas_error read_bin_bits( *pTarget = 0; for ( n = 0; n < nBits; n++ ) { -#ifdef FIX_WARNING_RENDER_CONFIG nByte = (uint32_t) ( ( this->readOffset + n ) >> 3 ); -#else - nByte = ( this->readOffset + n ) >> 3; -#endif bit = this->pBitstream[nByte] >> ( 7 - ( ( this->readOffset + n ) % 8 ) ) & 1; *pTarget = ( *pTarget << 1 ) + bit; } -- GitLab From 7ab6a65f9171733bc726e99e6261e61a2187e9f6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:20:21 +0200 Subject: [PATCH 03/65] [cleanup] accept NONBE_FIX_991_PARAMBIN_BINARY_HRTF --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 4 -- lib_dec/ivas_init_dec.c | 4 -- lib_dec/ivas_ism_dec.c | 8 --- lib_rend/ivas_dirac_dec_binaural_functions.c | 72 -------------------- lib_rend/ivas_prot_rend.h | 4 -- lib_rend/ivas_stat_rend.h | 18 ----- lib_rend/lib_rend.c | 18 ----- 8 files changed, 129 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 8a7109fa5..14724bcf2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ #define LC3PLUS_LEA_COMPAT_BITRATES_48_6 /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel) */ #define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 8fc0712d5..b9ece009a 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -871,11 +871,7 @@ ivas_error ivas_dirac_dec_config( if ( st_ivas->hDiracDecBin[0] == NULL ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 8d00ef2b9..8ec720732 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2276,11 +2276,7 @@ ivas_error ivas_init_decoder( } } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index a11553299..ae347706f 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -237,11 +237,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -268,11 +264,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 85f265da3..74fde0dfc 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -112,17 +112,9 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( COM static void formulate2x2MixingMatrix( float Ein1, float Ein2, float CinRe, float CinIm, float Eout1, float Eout2, float CoutRe, float CoutIm, float Q[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], const float regularizationFactor ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue ); -#endif -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked ); -#endif static void matrixMul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Aim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); @@ -138,11 +130,7 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; @@ -178,9 +166,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->hReverb = NULL; hDiracDecBin->h_freq_domain_decorr_ap_params = NULL; hDiracDecBin->h_freq_domain_decorr_ap_state = NULL; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = NULL; -#endif } output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -232,7 +218,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF #ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { @@ -251,9 +236,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( #else mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); #endif -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ if ( hDiracDecBin->hReverb != NULL && ( ( hDiracDecBin->hReverb->numBins != nBins ) || @@ -264,7 +246,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF #ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, @@ -281,9 +262,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) #endif { return error; @@ -344,9 +322,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif st_ivas->hDiracDecBin[pos_idx] = hDiracDecBin; } @@ -1297,11 +1273,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1344,11 +1316,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1358,11 +1326,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -1719,11 +1683,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin->processMtxImPrev[chA][chB + 2][bin] = hDiracDecBin->processMtxIm[chA][chB + 2][bin]; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked ); -#endif hDiracDecBin->processMtxRe[0][chB + 2][bin] = lRealp * gainFactor; hDiracDecBin->processMtxIm[0][chB + 2][bin] = lImagp * gainFactor; @@ -2477,12 +2437,8 @@ static void getDirectPartGains( const uint8_t renderStereoOutputInsteadOfBinaural, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t isHeadtracked -#endif ) { float aziRad, eleRad; @@ -2528,11 +2484,7 @@ static void getDirectPartGains( { if ( aziDeg == gainCache->azi && eleDeg == gainCache->ele ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE ); -#endif } else { @@ -2542,11 +2494,7 @@ static void getDirectPartGains( { rotateAziEle( (float) aziDeg, (float) eleDeg, &aziDeg, &eleDeg, Rmat, 0 ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE ); -#endif } } @@ -2563,21 +2511,15 @@ static void hrtfShGetHrtf( float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t useCachedValue -#endif ) { int16_t k; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF float( *hrtfShCoeffsReInt )[16][60]; float( *hrtfShCoeffsImInt )[16][60]; hrtfShCoeffsReInt = hHrtfParambin->hrtfShCoeffsRe; hrtfShCoeffsImInt = hHrtfParambin->hrtfShCoeffsIm; -#endif *lRealp = 0.0f; *lImagp = 0.0f; @@ -2591,17 +2533,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif } } else @@ -2615,17 +2550,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif gainCache->shVec[k] = shVec[k]; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index df8e8a853..cc2c19537 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -210,11 +210,7 @@ void ivas_masa_ext_rend_parambin_render( ); ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ); void ivas_dirac_dec_close_binaural_data( diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index eacab49ee..56bb6190d 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -497,7 +497,6 @@ typedef struct ivas_diffuse_distribution_data_structure } DIFFUSE_DISTRIBUTION_DATA, *DIFFUSE_DISTRIBUTION_HANDLE; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF typedef struct ivas_hrtfs_parambin_struct { float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; @@ -510,7 +509,6 @@ typedef struct ivas_hrtfs_parambin_struct int16_t allocatedFromFile; /* Not used and should not be here. Remove in cleanup. */ } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif /* Parametric binaural data structure */ typedef struct ivas_dirac_dec_binaural_data_structure @@ -547,9 +545,7 @@ typedef struct ivas_dirac_dec_binaural_data_structure ivas_td_decorr_state_t *hTdDecorr; float reqularizationFactor; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#endif DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; @@ -1323,20 +1319,6 @@ typedef struct ivas_hrtfs_fastconv_struct } HRTFS_FASTCONV, *HRTFS_FASTCONV_HANDLE; -#ifndef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -typedef struct ivas_hrtfs_parambin_struct -{ - float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - - float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX]; - float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; - float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; - - int16_t allocatedFromFile; - -} HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif typedef struct ivas_hrtfs_statistics_struct { const float *average_energy_l; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d7d6cc54a..5cef9584c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8390,11 +8390,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin; -#endif int16_t nBins; int32_t output_Fs; RENDERER_TYPE renderer_type; @@ -8410,11 +8406,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( error = IVAS_ERR_OK; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF phHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; -#else - hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); -#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); @@ -8486,7 +8478,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF #ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART if ( *inputMasa->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { @@ -8505,13 +8496,9 @@ static ivas_error ivas_masa_ext_rend_parambin_init( #else mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); #endif -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF #ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, @@ -8528,9 +8515,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) #endif { return error; @@ -8568,9 +8552,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( /* External renderer uses constant regularization factor */ hDiracDecBin->reqularizationFactor = 0.4f; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif inputMasa->hMasaExtRend->hDiracDecBin[pos_idx] = hDiracDecBin; } -- GitLab From d65bb0e0efcc7329c60cf0879f2051067ccecb0e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:21:01 +0200 Subject: [PATCH 04/65] [cleanup] accept LC3PLUS_LEA_COMPAT_BITRATES_48_6 --- lib_com/options.h | 1 - lib_isar/isar_prot.h | 2 -- lib_isar/isar_splitRendererPre.c | 8 -------- lib_isar/isar_splitRenderer_utils.c | 2 -- lib_isar/lib_isar_pre_rend.c | 4 ---- 5 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 14724bcf2..ef5ccf5be 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define LC3PLUS_LEA_COMPAT_BITRATES_48_6 /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel) */ #define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ #define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */ diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index 442c2806d..85a99aa90 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -290,13 +290,11 @@ void isar_set_split_rend_ht_setup( float Rmat[MAX_PARAM_SPATIAL_SUBFRAMES][3][3] ); -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 int32_t isar_get_lc3plus_bitrate( const int32_t SplitRendBitRate, const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode, const int32_t nChannels, const int32_t codecFrameDurationUs ); -#endif ivas_error isar_split_rend_validate_config( const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 520fba4c4..372c924ad 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -1744,11 +1744,7 @@ ivas_error split_renderer_open_lc3plus( config.channels = BINAURAL_CHANNELS; if ( ( error = ISAR_LC3PLUS_ENC_Open( config, -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 isar_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode, config.channels, config.lc3plus_frame_duration_us ), -#else - isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode ), -#endif &hSplitRendWrapper->hLc3plusEnc ) ) != IVAS_ERR_OK ) { return error; @@ -1967,7 +1963,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( } else { -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 if ( pBits->pose_correction == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) { available_bits = isar_get_lc3plus_bitrate( SplitRendBitRate, hSplitBin->multiBinPoseData.poseCorrectionMode, hSplitBin->hLc3plusEnc->config.channels, hSplitBin->hLc3plusEnc->config.lc3plus_frame_duration_us ) / FRAMES_PER_SEC; @@ -1976,9 +1971,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( { available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; } -#else - available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; -#endif if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, in ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index dbd0b11cb..02dd552ef 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -562,7 +562,6 @@ int32_t isar_get_lcld_bitrate( return -1; } -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 /*------------------------------------------------------------------------- * Function isar_get_lc3plus_bitrate() * @@ -586,7 +585,6 @@ int32_t isar_get_lc3plus_bitrate( } return bitrate; } -#endif /*------------------------------------------------------------------------- diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index 5867793c2..2e6c70b47 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -390,7 +390,6 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( } -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 if ( pBits->pose_correction == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) { available_bits = isar_get_lc3plus_bitrate( SplitRendBitRate, hSplitBin->multiBinPoseData.poseCorrectionMode, hSplitBin->hLc3plusEnc->config.channels, hSplitBin->hLc3plusEnc->config.lc3plus_frame_duration_us ) / FRAMES_PER_SEC; @@ -399,9 +398,6 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( { available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; } -#else - available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; -#endif if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, output ) ) != IVAS_ERR_OK ) { return error; -- GitLab From 93bdf82d03c91bd0616ac8d1524b810a3ce7305b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:21:36 +0200 Subject: [PATCH 05/65] [cleanup] accept NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS --- lib_com/options.h | 1 - lib_dec/ivas_dirac_output_synthesis_cov.c | 6 ------ 2 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index ef5ccf5be..c2296a99a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ #define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nok: issue 1497 - porting OMASA EXT MR */ diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index 5139a6d55..cd525dbf8 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov.c @@ -51,13 +51,11 @@ #include "wmc_auto.h" #include "rom_dec.h" -#ifdef NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /*-----------------------------------------------------------------------* * Local constants *-----------------------------------------------------------------------*/ #define SQRT_EPSILON 3.16227755e-08 /* square root of EPSILON */ -#endif /*-------------------------------------------------------------------* * ivas_dirac_dec_output_synthesis_cov_open() @@ -581,11 +579,7 @@ int16_t computeMixingMatrices( *-----------------------------------------------------------------*/ maximum( svd_s_buffer, lengthCx, &limit ); -#ifdef NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS limit = (float) max( limit * reg_Sx, SQRT_EPSILON ); -#else - limit = limit * reg_Sx + EPSILON; -#endif for ( i = 0; i < lengthCx; ++i ) { -- GitLab From b3a7e5dbf3bcd8f77fc7f0649864d34c9072311c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:22:15 +0200 Subject: [PATCH 06/65] [cleanup] accept FIX_1053_REVERB_RECONFIGURATION --- apps/decoder.c | 45 -------------- apps/renderer.c | 39 ------------- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 33 ----------- lib_dec/ivas_rom_dec.c | 11 ---- lib_dec/ivas_rom_dec.h | 7 --- lib_dec/lib_dec.c | 2 - lib_rend/ivas_reverb.c | 91 ----------------------------- lib_rend/ivas_stat_rend.h | 3 - lib_rend/lib_rend.c | 6 -- lib_util/render_config_reader.c | 2 - 11 files changed, 240 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 59aacd9a9..634e3e599 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -89,7 +89,6 @@ static *------------------------------------------------------------------------------------------*/ -#ifdef FIX_1053_REVERB_RECONFIGURATION typedef struct { uint16_t *pID; @@ -98,7 +97,6 @@ typedef struct uint16_t selected; uint16_t frameCounter; } AcousticEnvironmentSequence; -#endif typedef struct { @@ -153,11 +151,7 @@ typedef struct uint16_t tsmScale; #endif #endif -#ifdef FIX_1053_REVERB_RECONFIGURATION AcousticEnvironmentSequence aeSequence; -#else - uint16_t acousticEnvironmentId; -#endif #ifdef FIX_745_FIX_DATA_TYPE_CONVERSION bool dpidEnabled; #else @@ -451,7 +445,6 @@ int main( asked_frame_size = arg.renderFramesize; -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; #ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain, @@ -459,10 +452,6 @@ int main( #else if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, - arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -709,11 +698,7 @@ int main( if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#else - if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#endif { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { @@ -723,11 +708,7 @@ int main( } else { -#ifdef FIX_1053_REVERB_RECONFIGURATION fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); -#else - fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId ); -#endif goto cleanup; } #ifndef FIX_587_DEFAULT_REVERB @@ -937,13 +918,11 @@ cleanup: free( pcmBuf ); -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( arg.aeSequence.count > 0 ) { free( arg.aeSequence.pID ); free( arg.aeSequence.pValidity ); } -#endif #ifdef DEBUG_SBA_AUDIO_DUMP IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels ); @@ -1168,15 +1147,11 @@ static bool parseCmdlIVAS_dec( arg->tsmScaleFileName = NULL; #endif #endif -#ifdef FIX_1053_REVERB_RECONFIGURATION arg->aeSequence.count = 0; arg->aeSequence.pID = NULL; arg->aeSequence.pValidity = NULL; arg->aeSequence.selected = 0; arg->aeSequence.frameCounter = 0; -#else - arg->acousticEnvironmentId = 65535; -#endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { arg->directivityPatternId[i] = 65535; @@ -1562,7 +1537,6 @@ static bool parseCmdlIVAS_dec( if ( !is_digits_only( argv[i] ) ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t k; char *s = argv[i]; char *token = argv[i]; @@ -1622,14 +1596,8 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } -#else - fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] ); - usage_dec(); - return false; -#endif } -#ifdef FIX_1053_REVERB_RECONFIGURATION else { /* A single acoustic environment */ @@ -1644,9 +1612,6 @@ static bool parseCmdlIVAS_dec( arg->aeSequence.pID[0] = (int16_t) atoi( argv[i++] ); arg->aeSequence.pValidity[0] = 0; } -#else - arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] ); -#endif } else if ( strcmp( argv_to_upper, "-DPID" ) == 0 ) { @@ -1898,15 +1863,11 @@ static void usage_dec( void ) fprintf( stdout, " output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" ); fprintf( stdout, " ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" ); fprintf( stdout, " otherwise a default directivity pattern is used.\n" ); -#ifdef FIX_1053_REVERB_RECONFIGURATION fprintf( stdout, "-aeid ID : Acoustic environment ID (number > 0) or\n" ); fprintf( stdout, " a sequence thereof in the format [ID1:duration1,ID2:duration2...]\n" ); fprintf( stdout, " without braces and spaces, with ':' character separating ID from duration and ',' separating\n" ); fprintf( stdout, " ID and duration pairs, where duration is specified in frames\n" ); fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" ); -#else - fprintf( stdout, "-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" ); -#endif fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); @@ -2269,7 +2230,6 @@ static ivas_error decodeG192( int16_t vec_pos_update, vec_pos_len; SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; -#ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; @@ -2305,7 +2265,6 @@ static ivas_error decodeG192( goto cleanup; } } -#endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { @@ -2507,7 +2466,6 @@ static ivas_error decodeG192( { if ( needNewFrame ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL && arg.aeSequence.count > 0 && arg.aeSequence.pValidity[arg.aeSequence.selected] != 0 ) { @@ -2538,7 +2496,6 @@ static ivas_error decodeG192( } } } -#endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmScaleFileEnabled ) @@ -2964,9 +2921,7 @@ static ivas_error decodeG192( cleanup: -#ifdef FIX_1053_REVERB_RECONFIGURATION RenderConfigReader_close( &renderConfigReader ); -#endif split_rend_reader_writer_close( &splitRendWriter ); AudioFileWriter_close( &afWriter ); MasaFileWriter_close( &masaWriter ); diff --git a/apps/renderer.c b/apps/renderer.c index 5d338d1ac..81e1156e2 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -140,7 +140,6 @@ typedef struct IVAS_CUSTOM_LS_DATA outSetupCustom; } OutputConfig; -#ifdef FIX_1053_REVERB_RECONFIGURATION typedef struct { uint16_t *pID; @@ -149,7 +148,6 @@ typedef struct uint16_t selected; uint16_t frameCounter; } AcousticEnvironmentSequence; -#endif typedef struct { @@ -190,11 +188,7 @@ typedef struct float syncMdDelay; IVAS_RENDER_FRAMESIZE render_framesize; uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; -#ifdef FIX_1053_REVERB_RECONFIGURATION AcousticEnvironmentSequence aeSequence; -#else - uint16_t acousticEnvironmentId; -#endif } CmdlnArgs; typedef enum @@ -389,11 +383,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_acousticEnvironmentId, .match = "acoustic_environment_id", .matchShort = "aeid", -#ifdef FIX_1053_REVERB_RECONFIGURATION .description = "Acoustic environment ID( number > 0 ) or a sequence thereof in the format [ID1:duration1,ID2:duration2...] without braces and spaces, with ':' character separating ID from duration and ',' separating ID and duration pairs, where duration is specified in frames for BINAURAL_ROOM_REVERB output configuration.", -#else - .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output.", -#endif }, }; @@ -713,9 +703,7 @@ int main( int16_t zeroPadToWrite = 0; int32_t delayTimeScale = 0; int16_t i, numChannels; -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t aeID; -#endif ivas_error error = IVAS_ERR_OK; #ifdef WMOPS @@ -1103,12 +1091,8 @@ int main( #endif if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535; if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#else - if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#endif { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { @@ -1118,11 +1102,7 @@ int main( } else { -#ifdef FIX_1053_REVERB_RECONFIGURATION fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", aeID ); -#else - fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId ); -#endif goto cleanup; } #ifndef FIX_587_DEFAULT_REVERB @@ -1511,7 +1491,6 @@ int main( num_in_channels = inBuffer.config.numChannels; const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0; -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL && args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 ) { @@ -1544,7 +1523,6 @@ int main( } } } -#endif numSamplesRead = 0; /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK ) @@ -2015,13 +1993,11 @@ cleanup: { free( bitsBufferData ); } -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( args.aeSequence.count > 0 ) { free( args.aeSequence.pID ); free( args.aeSequence.pValidity ); } -#endif for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { MasaFileReader_close( &masaReaders[i] ); @@ -2493,7 +2469,6 @@ static bool parseLfePositionConfig( } -#ifdef FIX_1053_REVERB_RECONFIGURATION static bool parseAcousticEnvironmentIds( const char *value, AcousticEnvironmentSequence *aeSequence ) @@ -2578,7 +2553,6 @@ static bool parseAcousticEnvironmentIds( return true; } -#endif static bool checkRequiredArgs( CmdlnArgs args ) @@ -2692,15 +2666,11 @@ static CmdlnArgs defaultArgs( args.directivityPatternId[i] = 65535; } -#ifdef FIX_1053_REVERB_RECONFIGURATION args.aeSequence.count = 0; args.aeSequence.pID = NULL; args.aeSequence.pValidity = NULL; args.aeSequence.selected = 0; args.aeSequence.frameCounter = 0; -#else - args.acousticEnvironmentId = 65535; -#endif return args; } @@ -2876,19 +2846,10 @@ static void parseOption( break; case CmdLnOptionId_acousticEnvironmentId: assert( numOptionValues == 1 ); -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( !parseAcousticEnvironmentIds( optionValues[0], &args->aeSequence ) ) { fprintf( stderr, "Invalid acoustic environment ID specified: %s\n", optionValues[0] ); } -#else - if ( !is_digits_only( optionValues[0] ) ) - { - fprintf( stderr, "Invalid acousting environment ID specified: %s\n", optionValues[0] ); - exit( -1 ); - } - args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 ); -#endif break; case CmdLnOptionId_syncMdDelay: assert( numOptionValues == 1 ); diff --git a/lib_com/options.h b/lib_com/options.h index c2296a99a..87706145c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ #define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nok: issue 1497 - porting OMASA EXT MR */ #define FIX_1161_REDUCE_OMASA_HEAP /* VA: reduction of OMASA heap memory */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 0c37769c3..1e5d2c42b 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -47,7 +47,6 @@ #endif #include "wmc_auto.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION /*------------------------------------------------------------------------- * Local constants @@ -59,7 +58,6 @@ const float dmxmtx_table[BINAURAL_CHANNELS][REVERB_INPUT_DOWNMIX_CHANNELS] = { { 1.0f, 0.0f, 0.70709997f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 0.70709997f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f }, }; -#endif /*------------------------------------------------------------------------- * ivas_binRenderer_filterModule() @@ -837,11 +835,7 @@ static void ivas_binaural_obtain_DMX( for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION float dmxConst = dmxmtx_table[chOutIdx][chIdx]; -#else - float dmxConst = hBinRenderer->hReverb->dmxmtx[chOutIdx][chIdx]; -#endif for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { for ( k = 0; k < numTimeSlots; k++ ) @@ -1050,11 +1044,7 @@ ivas_error ivas_binRenderer_open( ) { BINAURAL_RENDERER_HANDLE hBinRenderer; -#ifdef FIX_1053_REVERB_RECONFIGURATION int16_t convBand, k; -#else - int16_t convBand, chIdx, k; -#endif ivas_error error; #ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; @@ -1220,29 +1210,6 @@ ivas_error ivas_binRenderer_open( return error; } -#ifndef FIX_1053_REVERB_RECONFIGURATION - /* initialize the dmx matrix */ - if ( hBinRenderer->nInChannels != HOA3_CHANNELS ) - { - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < hBinRenderer->nInChannels; k++ ) - { - hBinRenderer->hReverb->dmxmtx[chIdx][k] = dmxmtx_table[chIdx][k]; - } - } - } - if ( hBinRenderer->nInChannels != HOA3_CHANNELS ) - { - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < hBinRenderer->nInChannels; k++ ) - { - hBinRenderer->hReverb->dmxmtx[chIdx][k] = dmxmtx_table[chIdx][k]; - } - } - } -#endif } else { diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index a909faf40..deaf02164 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -390,17 +390,6 @@ const float dirac_dithering_ele_scale[DIRAC_DIFFUSE_LEVELS] = 6.716062e-01f, 1.011804e+00f, 1.796875e+00f, 2.804382e+00f, 4.623130e+00f, 7.802667e+00f, 1.045446e+01f, 1.379538e+01f }; -#ifndef FIX_1053_REVERB_RECONFIGURATION -/*----------------------------------------------------------------------------------* - * FASTCONV and PARAMETRIC binaural renderer ROM tables - *----------------------------------------------------------------------------------*/ - -const float dmxmtx_table[BINAURAL_CHANNELS][11] = -{ - { 1.0f, 0.0f, 0.70709997f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f }, - { 0.0f, 1.0f, 0.70709997f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f }, -}; -#endif /*----------------------------------------------------------------------* * MC ParamUpmix ROM tables diff --git a/lib_dec/ivas_rom_dec.h b/lib_dec/ivas_rom_dec.h index c77e3db4f..063921501 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -96,13 +96,6 @@ extern const uint16_t *const sym_freq_ECSQ_tab_abs_lsbs[1 + 4]; extern const float dirac_dithering_azi_scale[DIRAC_DIFFUSE_LEVELS]; extern const float dirac_dithering_ele_scale[DIRAC_DIFFUSE_LEVELS]; -#ifndef FIX_1053_REVERB_RECONFIGURATION -/*----------------------------------------------------------------------------------* - * FASTCONV and PARAMETRIC binaural renderer ROM tables - *----------------------------------------------------------------------------------*/ - -extern const float dmxmtx_table[BINAURAL_CHANNELS][11]; -#endif /*----------------------------------------------------------------------* * MC ParamUpmix ROM tables diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 868fc4e06..fedc36cb2 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2264,7 +2264,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( mvr2r( renderConfig.roomAcoustics.pAcoustic_rt60, hRenderConfig->roomAcoustics.pAcoustic_rt60, CLDFB_NO_CHANNELS_MAX ); mvr2r( renderConfig.roomAcoustics.pAcoustic_dsr, hRenderConfig->roomAcoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_1053_REVERB_RECONFIGURATION /* Re-initialize reverb instance if already available */ /* TD renderer Jot reverberator */ @@ -2328,7 +2327,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( return error; } } -#endif mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 * MAX_NUM_OBJECTS ); #ifdef CONF_DISTATT diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index e54b75cab..c41b2492a 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -109,11 +109,6 @@ typedef struct ivas_reverb_params_t float *pFc; /* Center frequencies for FFT filter design */ float *pRt60; /* RT60 values at these frequencies */ float *pDsr; /* DSR values at these frequencies */ -#ifndef FIX_1053_REVERB_RECONFIGURATION - float *pHrtf_avg_pwr_response_l; /* The HRTF set's average left ear power response */ - float *pHrtf_avg_pwr_response_r; /* The HRTF set's average right ear power response */ - float *pHrtf_inter_aural_coherence; /* The HRTF set's inter-aural coherence for diffuse sound */ -#endif const float *pHrtf_avg_pwr_response_l_const; /* The HRTF set's average left ear power response */ const float *pHrtf_avg_pwr_response_r_const; /* The HRTF set's average right ear power response */ const float *pHrtf_inter_aural_coherence_const; /* The HRTF set's inter-aural coherence for diffuse sound */ @@ -998,9 +993,6 @@ static ivas_error setup_FDN_branches( { int16_t nr_coefs, branch_idx, channel_idx; ivas_error error; -#ifndef FIX_1053_REVERB_RECONFIGURATION - float *pCoef_a, *pCoef_b; -#endif error = IVAS_ERR_OK; /* initialize feedback branches */ @@ -1022,15 +1014,6 @@ static ivas_error setup_FDN_branches( { for ( branch_idx = 0; branch_idx < pParams->nr_loops; branch_idx++ ) { -#ifndef FIX_1053_REVERB_RECONFIGURATION - pCoef_a = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx + nr_coefs]; - pCoef_b = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx]; - - if ( ( error = set_t60_filter( hReverb, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif if ( ( error = set_feedback_delay( hReverb, branch_idx, pParams->pLoop_delays[branch_idx] ) ) != IVAS_ERR_OK ) { return error; @@ -1055,19 +1038,11 @@ static ivas_error setup_FDN_branches( } -#ifdef FIX_1053_REVERB_RECONFIGURATION /*------------------------------------------------------------------------- * ivas_reverb_open() * * Allocate and initialize FDN reverberation handle *------------------------------------------------------------------------*/ -#else -/*------------------------------------------------------------------------- - * ivas_reverb_open() - * - * Allocate and initialize Crend reverberation handle - *------------------------------------------------------------------------*/ -#endif ivas_error ivas_reverb_open( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ @@ -1077,13 +1052,9 @@ ivas_error ivas_reverb_open( { ivas_error error; -#ifdef FIX_1053_REVERB_RECONFIGURATION REVERB_HANDLE pState = *hReverb; int16_t nr_coefs, branch_idx; float *pCoef_a, *pCoef_b; -#else - REVERB_HANDLE pState = NULL; -#endif int16_t bin_idx, subframe_len, output_frame, predelay_bf_len, loop_idx; ivas_reverb_params_t params; rv_fftwf_type_complex pFft_wf_filter_ch0[RV_LENGTH_NR_FC]; @@ -1101,7 +1072,6 @@ ivas_error ivas_reverb_open( predelay_bf_len = output_frame; nr_fc_input = hRenderConfig->roomAcoustics.nBands; -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { /* Allocate main reverb. handle */ @@ -1110,20 +1080,12 @@ ivas_error ivas_reverb_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for FDN Reverberator " ); } } -#else - /* Allocate main reverb. handle */ - if ( ( pState = (REVERB_HANDLE) malloc( sizeof( REVERB_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Reverberator " ); - } -#endif if ( ( error = set_base_config( ¶ms, output_Fs ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { /* Allocate memory for feedback delay lines */ @@ -1141,22 +1103,6 @@ ivas_error ivas_reverb_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for FDN Reverberator" ); } } -#else - /* Allocate memory for feedback delay lines */ - for ( loop_idx = 0; loop_idx < IVAS_REV_MAX_NR_BRANCHES; loop_idx++ ) - { - if ( ( pState->loop_delay_buffer[loop_idx] = (float *) malloc( params.pLoop_delays[loop_idx] * sizeof( float ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CREND Reverberator" ); - } - } - - /* Allocate memory for the pre-delay delay line */ - if ( ( pState->pPredelay_buffer = (float *) malloc( output_frame * sizeof( float ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CREND Reverberator" ); - } -#endif pState->nr_of_branches = IVAS_REV_MAX_NR_BRANCHES; set_fft_and_datablock_sizes( pState, subframe_len ); @@ -1166,16 +1112,9 @@ ivas_error ivas_reverb_open( /* === 'Control logic': compute the reverb processing parameters from the === */ /* === room, source and listener acoustic information provided in the reverb config === */ /* Setting up shared temporary buffers for fc, RT60, DSR, etc. */ -#ifndef FIX_1053_REVERB_RECONFIGURATION - params.pHrtf_avg_pwr_response_l = &pFft_wf_filter_ch0[0][0]; - params.pHrtf_avg_pwr_response_r = params.pHrtf_avg_pwr_response_l + nr_fc_fft_filter; -#endif params.pRt60 = &pFft_wf_filter_ch1[0][0]; params.pDsr = params.pRt60 + nr_fc_fft_filter; params.pFc = &pState->fft_filter_color_0.fft_spectrum[0]; -#ifndef FIX_1053_REVERB_RECONFIGURATION - params.pHrtf_inter_aural_coherence = &pState->fft_filter_color_1.fft_spectrum[0]; -#endif /* Note: these temp buffers can only be used before the final step of the FFT filter design : */ /* before calls to ivas_reverb_calc_correl_filters(...) or to ivas_reverb_calc_color_filters(...) */ @@ -1208,15 +1147,10 @@ ivas_error ivas_reverb_open( } /* set up input downmix */ -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { pState->dmx_gain = calc_dmx_gain(); } -#else - /* set up input downmix */ - pState->dmx_gain = calc_dmx_gain(); -#endif /* set up predelay - must be after set_base_config() and before compute_t60_coeffs() */ calc_predelay( ¶ms, hRenderConfig->roomAcoustics.acousticPreDelay, output_Fs ); @@ -1240,7 +1174,6 @@ ivas_error ivas_reverb_open( /* Compute the window used for FFT filters */ ivas_reverb_define_window_fft( pTime_window, transition_start, transition_length, nr_fc_fft_filter ); -#ifdef FIX_1053_REVERB_RECONFIGURATION /* === Copy parameters from ivas_reverb_params_t into DSP blocks === */ /* === to be used for subsequent audio signal processing === */ if ( *hReverb == NULL ) @@ -1253,19 +1186,6 @@ ivas_error ivas_reverb_open( return error; } } -#else - - /* === Now, copy parameters from ivas_reverb_params_t into DSP blocks === */ - /* === to be used for subsequent audio signal processing === */ - - pState->do_corr_filter = params.do_corr_filter; - - /* clear & init jot reverb fft filters */ - if ( ( error = initialize_reverb_filters( pState ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif if ( pState->do_corr_filter ) @@ -1299,7 +1219,6 @@ ivas_error ivas_reverb_open( return error; } -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { /* init predelay */ @@ -1328,16 +1247,6 @@ ivas_error ivas_reverb_open( return error; } } -#else - /* init predelay */ - ivas_rev_delay_line_init( &( pState->predelay_line ), pState->pPredelay_buffer, params.pre_delay, predelay_bf_len ); - - /* set up feedback delay network */ - if ( ( error = setup_FDN_branches( pState, ¶ms ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif *hReverb = pState; diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 56bb6190d..7ba3cbbc0 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -480,9 +480,6 @@ typedef struct ivas_binaural_reverb_struct uint32_t binRend_RandNext; int16_t highestBinauralCoherenceBin; -#ifndef FIX_1053_REVERB_RECONFIGURATION - float dmxmtx[BINAURAL_CHANNELS][MAX_OUTPUT_CHANNELS]; -#endif float foa_enc[MAX_OUTPUT_CHANNELS][FOA_CHANNELS]; } REVERB_STRUCT, *REVERB_STRUCT_HANDLE; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5cef9584c..d417bf07a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4258,16 +4258,12 @@ int16_t IVAS_REND_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t i; input_ism *pIsmInput; input_masa *pMasaInput; input_mc *pMcInput; input_sba *pSbaInput; ivas_error error; -#else - ivas_error error; -#endif if ( hIvasRend == NULL || hIvasRend->hRendererConfig == NULL ) { @@ -4300,7 +4296,6 @@ int16_t IVAS_REND_FeedRenderConfig( mvr2r( renderConfig.roomAcoustics.AbsCoeff, hRenderConfig->roomAcoustics.AbsCoeff, IVAS_ROOM_ABS_COEFF ); } -#ifdef FIX_1053_REVERB_RECONFIGURATION /* Re-initialize reverb instance if already available */ /* ISM inputs */ for ( i = 0, pIsmInput = hIvasRend->inputsIsm; i < RENDERER_MAX_ISM_INPUTS; ++i, ++pIsmInput ) @@ -4422,7 +4417,6 @@ int16_t IVAS_REND_FeedRenderConfig( } } } -#endif hRenderConfig->split_rend_config = renderConfig.split_rend_config; /* Overwrite any pose correction settings if 0 DOF (no pose correction) was selected */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index fd06f07bb..097b0fe70 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2992,12 +2992,10 @@ ivas_error RenderConfigReader_getAcousticEnvironment( pAcEnv->AbsCoeff[j] = pRenderConfigReader->pAE[n].pEarlyReflections->pAbsCoeff[j]; } } -#ifdef FIX_1053_REVERB_RECONFIGURATION else { pAcEnv->use_er = false; } -#endif return IVAS_ERR_OK; } } -- GitLab From 254600708e5a9723e957b2b953fcce4e18a248a3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:22:51 +0200 Subject: [PATCH 07/65] [cleanup] accept NONBE_FIX_ISM_XOVER_BR --- lib_com/options.h | 1 - lib_dec/ivas_corecoder_dec_reconfig.c | 8 -------- lib_dec/ivas_init_dec.c | 14 -------------- lib_dec/ivas_osba_dec.c | 2 -- lib_dec/ivas_sba_dec.c | 25 ------------------------ lib_enc/ivas_corecoder_enc_reconfig.c | 4 ---- lib_enc/ivas_init_enc.c | 11 ----------- lib_enc/ivas_osba_enc.c | 28 --------------------------- 8 files changed, 93 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 87706145c..a7de2e01f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */ #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nok: issue 1497 - porting OMASA EXT MR */ #define FIX_1161_REDUCE_OMASA_HEAP /* VA: reduction of OMASA heap memory */ #define CONF_DISTATT /* Eri: Make distance attenuation configurable */ diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index 7a6db2376..97be3ac58 100644 --- a/lib_dec/ivas_corecoder_dec_reconfig.c +++ b/lib_dec/ivas_corecoder_dec_reconfig.c @@ -270,11 +270,7 @@ ivas_error ivas_corecoder_dec_reconfig( } else if ( st_ivas->hMCT != NULL && st_ivas->nCPE > 1 ) { -#ifdef NONBE_FIX_ISM_XOVER_BR if ( ( error = mct_dec_reconfigure( st_ivas, nchan_transport_real != nchan_transport_old ) ) != IVAS_ERR_OK ) -#else - if ( ( error = mct_dec_reconfigure( st_ivas, st_ivas->nchan_transport != nchan_transport_old ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -355,11 +351,7 @@ ivas_error ivas_corecoder_dec_reconfig( * Set CNA/CNG flags *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_ISM_XOVER_BR if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) -#endif { ivas_sba_set_cna_cng_flag( st_ivas ); } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 8ec720732..40fd8eab4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -724,25 +724,15 @@ ivas_error ivas_dec_setup( /*correct number of CPEs for discrete ISM coding*/ if ( st_ivas->ini_frame > 0 && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#ifdef NONBE_FIX_ISM_XOVER_BR { int16_t n; n = st_ivas->nchan_transport + st_ivas->nchan_ism; st_ivas->nCPE = ( n + 1 ) >> 1; } -#else - { - st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; - } -#endif } -#ifdef NONBE_FIX_ISM_XOVER_BR if ( ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ) == ISM_SBA_MODE_DISC ) -#else - if ( ivas_total_brate >= IVAS_256k ) -#endif { st_ivas->ism_mode = ISM_SBA_MODE_DISC; } @@ -1856,16 +1846,12 @@ ivas_error ivas_init_decoder( if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_ISM_XOVER_BR { int16_t n_all; n_all = st_ivas->nchan_transport + st_ivas->nchan_ism; st_ivas->nCPE = ( n_all + 1 ) >> 1; } -#else - st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; -#endif st_ivas->element_mode_init = IVAS_CPE_MDCT; } diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index c9e9e2e93..c9169abe7 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -153,9 +153,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( return error; } -#ifdef NONBE_FIX_ISM_XOVER_BR ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); -#endif if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 7d01fabe9..968bd64f1 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -70,11 +70,7 @@ void ivas_sba_set_cna_cng_flag( st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag = 1; st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag = 1; } -#ifdef NONBE_FIX_ISM_XOVER_BR else if ( st_ivas->nchan_transport == 2 && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#else - else if ( st_ivas->nchan_transport == 2 ) -#endif { for ( n = 0; n < CPE_CHANNELS; n++ ) { @@ -124,9 +120,7 @@ ivas_error ivas_sba_dec_reconfigure( ivas_error error; ISM_MODE ism_mode_old; int16_t granularity_new; -#ifdef NONBE_FIX_ISM_XOVER_BR int16_t nchan_transport; -#endif ism_mode_old = st_ivas->ism_mode; hDecoderConfig = st_ivas->hDecoderConfig; @@ -146,11 +140,7 @@ ivas_error ivas_sba_dec_reconfigure( if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { -#ifdef NONBE_FIX_ISM_XOVER_BR if ( ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ) == ISM_SBA_MODE_DISC ) -#else - if ( ivas_total_brate >= IVAS_256k ) -#endif { st_ivas->ism_mode = ISM_SBA_MODE_DISC; } @@ -444,9 +434,7 @@ ivas_error ivas_sba_dec_reconfigure( * Allocate, initialize, and configure SCE/CPE/MCT handles *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( ism_mode_old == ISM_MODE_NONE && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -515,12 +503,8 @@ ivas_error ivas_sba_dec_reconfigure( return error; } -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport += st_ivas->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; -#else - st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; -#endif } else if ( ism_mode_old == ISM_SBA_MODE_DISC && st_ivas->ism_mode == ISM_MODE_NONE ) { @@ -534,24 +518,15 @@ ivas_error ivas_sba_dec_reconfigure( { ivas_td_binaural_close( &st_ivas->hBinRendererTd ); } -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif nchan_transport_old += st_ivas->nchan_ism; st_ivas->ism_mode = ISM_MODE_NONE; } else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; nchan_transport_old += st_ivas->nchan_ism; -#else - st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; - nCPE_old = st_ivas->nCPE; - nchan_transport_old = st_ivas->nchan_transport; - nchan_transport_old += st_ivas->nchan_ism; -#endif } } diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 48c37b0d6..dcab60608 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -459,11 +459,7 @@ ivas_error ivas_corecoder_enc_reconfig( else if ( st_ivas->hMCT != NULL && st_ivas->nCPE > 1 ) { -#ifdef NONBE_FIX_ISM_XOVER_BR if ( ( error = mct_enc_reconfigure( st_ivas, nchan_transport_old_real != nchan_transport_real ) ) != IVAS_ERR_OK ) -#else - if ( ( error = mct_enc_reconfigure( st_ivas, st_ivas->nchan_transport != nchan_transport_old ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index dbed65daf..46566a543 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -705,14 +705,7 @@ ivas_error ivas_init_encoder( { st_ivas->ism_mode = ISM_MODE_NONE; -#ifdef NONBE_FIX_ISM_XOVER_BR st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism ); -#else - if ( ivas_total_brate >= IVAS_256k ) - { - st_ivas->ism_mode = ISM_SBA_MODE_DISC; - } -#endif if ( ( error = ivas_ism_metadata_enc_create( st_ivas, hEncoderConfig->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) { @@ -767,16 +760,12 @@ ivas_error ivas_init_encoder( else { /* allocate and initialize MCT core coder */ -#ifdef NONBE_FIX_ISM_XOVER_BR { int16_t n_all; n_all = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; st_ivas->nCPE = ( n_all + 1 ) >> 1; } -#else - st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; -#endif for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index b50367379..438edc41c 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -185,9 +185,7 @@ ivas_error ivas_osba_enc_reconfig( error = IVAS_ERR_OK; hEncoderConfig = st_ivas->hEncoderConfig; ivas_total_brate = hEncoderConfig->ivas_total_brate; -#ifdef NONBE_FIX_ISM_XOVER_BR int16_t nchan_transport; -#endif if ( ivas_total_brate != hEncoderConfig->last_ivas_total_brate ) @@ -201,18 +199,7 @@ ivas_error ivas_osba_enc_reconfig( spar_reconfig_flag = 0; old_ism_mode = st_ivas->ism_mode; -#ifdef NONBE_FIX_ISM_XOVER_BR st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism ); -#else - if ( ivas_total_brate >= IVAS_256k ) - { - st_ivas->ism_mode = ISM_SBA_MODE_DISC; - } - else - { - st_ivas->ism_mode = ISM_MODE_NONE; - } -#endif nchan_transport_old = st_ivas->nchan_transport; nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; @@ -342,42 +329,27 @@ ivas_error ivas_osba_enc_reconfig( /*-----------------------------------------------------------------* * Allocate, initialize, and configure SCE/CPE/MCT handles *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif if ( old_ism_mode == ISM_MODE_NONE && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_ISM_XOVER_BR { nchan_transport = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; } -#else - st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; -#endif } else if ( old_ism_mode == ISM_SBA_MODE_DISC && st_ivas->ism_mode == ISM_MODE_NONE ) { nchan_transport_old += st_ivas->hEncoderConfig->nchan_ism; -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif } else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport_old += st_ivas->hEncoderConfig->nchan_ism; nchan_transport = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; -#else - st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; - nCPE_old = st_ivas->nCPE; - nchan_transport_old = st_ivas->nchan_transport; - nchan_transport_old += st_ivas->hEncoderConfig->nchan_ism; -#endif } if ( ( error = ivas_corecoder_enc_reconfig( st_ivas, nSCE_old, nCPE_old, nchan_transport_old, ivas_total_brate / st_ivas->nchan_transport, ( ivas_total_brate / st_ivas->nchan_transport ) * CPE_CHANNELS, MC_MODE_NONE ) ) != IVAS_ERR_OK ) -- GitLab From 119e9dd0546be347224fe3b9912d0d4251b77503 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:23:35 +0200 Subject: [PATCH 08/65] [cleanup] accept NONBE_FIX_984_OMASA_EXT_OUTPUT --- apps/decoder.c | 28 --------------- apps/renderer.c | 4 --- lib_com/ivas_cnst.h | 4 --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 19 ---------- lib_dec/ivas_jbm_dec.c | 20 ----------- lib_dec/ivas_masa_dec.c | 31 ---------------- lib_dec/ivas_omasa_dec.c | 47 ------------------------ lib_dec/ivas_output_config.c | 4 --- lib_dec/ivas_sba_dec.c | 4 --- lib_dec/ivas_stat_dec.h | 4 --- lib_dec/lib_dec.c | 22 ------------ lib_enc/ivas_masa_enc.c | 12 ------- lib_rend/ivas_output_init.c | 2 -- lib_util/masa_file_writer.c | 70 ------------------------------------ lib_util/masa_file_writer.h | 4 --- 17 files changed, 278 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 634e3e599..4e2f1df20 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2140,12 +2140,8 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; @@ -2677,7 +2673,6 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -2686,7 +2681,6 @@ static ivas_error decodeG192( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { @@ -2694,12 +2688,8 @@ static ivas_error decodeG192( goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -2826,7 +2816,6 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -2834,18 +2823,13 @@ static ivas_error decodeG192( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -3494,7 +3478,6 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -3503,18 +3486,13 @@ static ivas_error decodeVoIP( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -3591,7 +3569,6 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -3600,19 +3577,14 @@ static ivas_error decodeVoIP( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 81e1156e2..f20d8a91f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1908,11 +1908,7 @@ int main( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput, NULL ) ) != IVAS_ERR_OK ) /* NULL -> use default metadata delay settings */ -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index a94f024fc..db6f7b8e4 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -118,13 +118,9 @@ typedef enum RENDERER_NON_DIEGETIC_DOWNMIX, RENDERER_OSBA_STEREO, RENDERER_OSBA_AMBI, -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT RENDERER_OSBA_LS, RENDERER_OMASA_OBJECT_EXT, RENDERER_OMASA_MIX_EXT -#else - RENDERER_OSBA_LS -#endif } RENDERER_TYPE; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index b46381291..40db59c88 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5793,7 +5793,6 @@ void ivas_omasa_rearrange_channels( const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT ivas_error ivas_omasa_combine_separate_ism_with_masa_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -5820,7 +5819,6 @@ void ivas_omasa_render_objects_from_mix( const int16_t output_frame /* i : output frame length per channel */ ); -#endif void ivas_omasa_dirac_rend_jbm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ diff --git a/lib_com/options.h b/lib_com/options.h index a7de2e01f..ea7db4e9b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nok: issue 1497 - porting OMASA EXT MR */ #define FIX_1161_REDUCE_OMASA_HEAP /* VA: reduction of OMASA heap memory */ #define CONF_DISTATT /* Eri: Make distance attenuation configurable */ #define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 40fd8eab4..0f6695145 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -601,7 +601,6 @@ ivas_error ivas_dec_setup( { st_ivas->nchan_transport = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* this should be non-zero if original input format was MASA_ISM_FORMAT */ st_ivas->nchan_ism = st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2]; @@ -634,7 +633,6 @@ ivas_error ivas_dec_setup( st_ivas->nchan_transport = 2; element_mode_flag = 1; } -#endif if ( st_ivas->ini_frame > 0 ) { /* reconfigure in case a change of operation mode is detected */ @@ -1398,11 +1396,7 @@ ivas_error ivas_init_decoder( #endif hDecoderConfig->nchan_out += st_ivas->nchan_ism; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { hDecoderConfig->nchan_out = st_ivas->nchan_transport + st_ivas->nchan_ism; } @@ -2394,7 +2388,6 @@ ivas_error ivas_init_decoder( return error; } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ @@ -2423,7 +2416,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif } if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && @@ -3331,7 +3323,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbSyntheses = 0; } break; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: *numCldfbAnalyses = st_ivas->nchan_transport; *numCldfbSyntheses = st_ivas->hDecoderConfig->nchan_out; @@ -3340,7 +3331,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbAnalyses = st_ivas->nchan_transport + 1; *numCldfbSyntheses = 0; break; -#endif default: assert( 0 && "Renderer not handled for CLDFB reservation." ); } @@ -3481,15 +3471,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, "Wrong set-up: Acoustic environment is not supported in this output configuration." ); } } -#ifndef NONBE_FIX_984_OMASA_EXT_OUTPUT - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - } -#endif #ifdef DEBUGGING if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index dacbbf159..0ed1add7d 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -312,7 +312,6 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == MASA_FORMAT ) { ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* external output */ if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) { @@ -323,7 +322,6 @@ ivas_error ivas_jbm_dec_tc( ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, output_frame ); } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { @@ -400,7 +398,6 @@ ivas_error ivas_jbm_dec_tc( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); @@ -415,15 +412,6 @@ ivas_error ivas_jbm_dec_tc( /* Extract objects from MASA, output MASA + all objects (i.e., extracted and separated objects) */ ivas_omasa_render_objects_from_mix( st_ivas, p_output, st_ivas->nchan_ism, output_frame ); } -#else - /* sanity check in case of bitrate switching */ - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - - ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); @@ -915,7 +903,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); @@ -927,7 +914,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else { -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); @@ -939,9 +925,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( { ivas_ism_dec_digest_tc( st_ivas ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_DIRAC ) { @@ -1209,13 +1193,11 @@ ivas_error ivas_jbm_dec_render( { ivas_omasa_dirac_rend_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT || st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, *nSamplesRendered ); } -#endif } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { @@ -2705,10 +2687,8 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_PARAM_ISM: case RENDERER_BINAURAL_MIXER_CONV: case RENDERER_BINAURAL_MIXER_CONV_ROOM: -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: case RENDERER_OMASA_MIX_EXT: -#endif case RENDERER_OSBA_AMBI: case RENDERER_OSBA_LS: buffer_mode = TC_BUFFER_MODE_RENDERER; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 408318a34..08c842d74 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -295,7 +295,6 @@ ivas_error ivas_masa_decode( } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifndef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* read 2 bits: @@ -317,20 +316,6 @@ ivas_error ivas_masa_decode( { hMasa->config.input_ivas_format = MASA_ISM_FORMAT; } -#else - /* read the MASA_ISM_FORMAT bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; - if ( byteBuffer == 1 ) - { - hMasa->config.input_ivas_format = MASA_ISM_FORMAT; - } - else - { - hMasa->config.input_ivas_format = MASA_FORMAT; - } - /* reserved bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; -#endif *nb_bits_read += MASA_HEADER_BITS; /* read number of directions */ @@ -415,13 +400,11 @@ ivas_error ivas_masa_decode( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx, st_ivas->hSpatParamRendCom->dirac_md_buffer_length ); } -#endif else { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, @@ -545,12 +528,10 @@ ivas_error ivas_masa_decode( dirac_bs_md_write_idx = st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx; /* Store the write-index for this frame */ ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0 ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx = ( st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx + MAX_PARAM_SPATIAL_SUBFRAMES ) % st_ivas->hSpatParamRendCom->dirac_md_buffer_length; } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( hQMetaData->q_direction == NULL ) @@ -669,14 +650,12 @@ ivas_error ivas_masa_dec_open( } ism_total_brate = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* ISM metadata */ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* these are not needed -> clean. EXT metafile writer in OMASA needs only the number of ISMs and writes default null-data */ ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) @@ -751,13 +730,11 @@ ivas_error ivas_masa_dec_open( nchan_transport = 1; nchan_to_allocate = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC ) ) { /* addtl channel for CNG */ @@ -1520,16 +1497,12 @@ ivas_error ivas_masa_dec_reconfigure( if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->nchan_ism = 0; /* Initialization if it has not been already read from the end of the bitstream at the same time with reading of the format: nchan_ism is needed in MASA format because for the EXT output in MASA-only (pre-rendering mode of OMASA) the number of ISMs to output correct number of empty objects is needed */ } -#else - st_ivas->nchan_ism = 0; -#endif st_ivas->ism_mode = ISM_MODE_NONE; } @@ -1585,13 +1558,11 @@ ivas_error ivas_masa_dec_reconfigure( /* addtl channel for CNG */ tc_nchan_to_allocate++; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { tc_nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; tc_nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode ) { @@ -2566,12 +2537,10 @@ static int16_t ivas_decode_masaism_metadata( hMasaIsmData->energy_ratio_ism[dir][meta_write_index][b] = energy_ratio_ism[i][band][dir]; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hMasaIsmData->hExtData != NULL ) { hMasaIsmData->hExtData->masa_render_masa_to_total[meta_write_index][b] = hMasaIsmData->masa_to_total_energy_ratio[i][band]; } -#endif } } } diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 6a98f9b1b..b70137923 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -32,9 +32,7 @@ #include "options.h" #include -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #include -#endif #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" @@ -50,9 +48,7 @@ * Local constants *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #define EXT_RENDER_IIR_FAC 0.95f -#endif /*-------------------------------------------------------------------* * ivas_omasa_data_open() @@ -107,7 +103,6 @@ ivas_error ivas_omasa_data_open( } set_s( hMasaIsmData->azimuth_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); set_s( hMasaIsmData->elevation_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT hMasaIsmData->hExtData = NULL; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -140,7 +135,6 @@ ivas_error ivas_omasa_data_open( hMasaIsmData->hExtData = hExtData; } -#endif st_ivas->hMasaIsmData = hMasaIsmData; return IVAS_ERR_OK; @@ -173,13 +167,11 @@ void ivas_omasa_data_close( free( ( *hMasaIsmData )->delayBuffer ); ( *hMasaIsmData )->delayBuffer = NULL; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( *hMasaIsmData )->hExtData != NULL ) { free( ( *hMasaIsmData )->hExtData ); ( *hMasaIsmData )->hExtData = NULL; } -#endif free( *hMasaIsmData ); *hMasaIsmData = NULL; @@ -293,7 +285,6 @@ ivas_error ivas_omasa_dec_config( { /* ISM MD reconfig. */ n_MD = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* the full number of hIsmMetaData are needed for EXT output */ @@ -342,33 +333,6 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); } -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - n_MD = 1; - - if ( st_ivas->hIsmMetaData[0] == NULL ) - { - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - n_MD = st_ivas->nchan_ism; - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); - - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); -#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; @@ -398,14 +362,9 @@ ivas_error ivas_omasa_dec_config( } /* objects renderer reconfig. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hMasaIsmData != NULL || st_ivas->hIsmRendererData != NULL ) { /* this calls also ivas_ism_renderer_close() closing st_ivas->hIsmRendererData used by the EXT renderers. also cleans st_ivas->hMasaIsmData */ -#else - if ( st_ivas->hMasaIsmData != NULL ) - { -#endif ivas_omasa_separate_object_renderer_close( st_ivas ); } @@ -483,7 +442,6 @@ ivas_error ivas_omasa_dec_config( ivas_omasa_separate_object_renderer_close( st_ivas ); } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { /* Allocate 'hIsmRendererData' handle */ @@ -513,7 +471,6 @@ ivas_error ivas_omasa_dec_config( return error; } } -#endif /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -707,7 +664,6 @@ ivas_error ivas_omasa_ism_metadata_dec( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); @@ -724,7 +680,6 @@ ivas_error ivas_omasa_ism_metadata_dec( st_ivas->hMasaIsmData->elevation_separated_ism[block] = elevation_ism; } } -#endif } return IVAS_ERR_OK; @@ -905,7 +860,6 @@ void ivas_omasa_rearrange_channels( return; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /*-------------------------------------------------------------------------* * ivas_omasa_combine_separate_ism_with_masa_open() @@ -1396,4 +1350,3 @@ void ivas_omasa_render_objects_from_mix( return; } -#endif diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 801cc58e6..e8130f11f 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -417,7 +417,6 @@ void ivas_renderer_select( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { @@ -431,9 +430,6 @@ void ivas_renderer_select( { *renderer_type = RENDERER_DISABLE; } -#else // NONBE_FIX_984_OMASA_EXT_OUTPUT - *renderer_type = RENDERER_DISABLE; -#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 968bd64f1..791e0ce6e 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -673,11 +673,7 @@ void ivas_sba_dec_digest_tc( int16_t ch_idx, nchan_transport; /* set the md map */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDirAC || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) -#else - if ( st_ivas->hDirAC ) -#endif { ivas_dirac_dec_set_md_map( st_ivas, nCldfbSlots ); } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index fdc604b3d..b470313fd 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -883,7 +883,6 @@ typedef struct ivas_masa_decoder_struct } MASA_DECODER, *MASA_DECODER_HANDLE; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* Data structure for MASA_ISM EXT rendering */ typedef struct ivas_masa_ism_ext_data_structure { @@ -896,7 +895,6 @@ typedef struct ivas_masa_ism_ext_data_structure float masa_render_masa_to_total[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR][CLDFB_NO_CHANNELS_MAX]; } MASA_ISM_EXT_DATA, *MASA_ISM_EXT_DATA_HANDLE; -#endif /* Data structure for MASA_ISM rendering */ typedef struct ivas_masa_ism_data_structure @@ -928,9 +926,7 @@ typedef struct ivas_masa_ism_data_structure int16_t delayBuffer_size; int16_t delayBuffer_nchan; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_ISM_EXT_DATA_HANDLE hExtData; -#endif } MASA_ISM_DATA, *MASA_ISM_DATA_HANDLE; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index fedc36cb2..2253a6966 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1529,15 +1529,12 @@ ivas_error IVAS_DEC_GetNumObjects( uint16_t *numObjects /* o : number of objects for which the decoder has been configured */ ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { if ( hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -1546,9 +1543,6 @@ ivas_error IVAS_DEC_GetNumObjects( } } if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || is_masa_ism ) -#else - if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { *numObjects = hIvasDec->st_ivas->nchan_ism; } @@ -1589,12 +1583,10 @@ ivas_error IVAS_DEC_GetFormat( *format = IVAS_DEC_BS_UNKOWN; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( *format == IVAS_DEC_BS_MASA && hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) { *format = IVAS_DEC_BS_MASA_ISM; } -#endif return IVAS_ERR_OK; } @@ -1710,17 +1702,14 @@ ivas_error IVAS_DEC_GetObjectMetadata( { Decoder_Struct *st_ivas; ISM_METADATA_HANDLE hIsmMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } st_ivas = hIvasDec->st_ivas; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { if ( hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -1729,9 +1718,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } } if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT && is_masa_ism == 0 ) -#else - if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -1742,11 +1728,7 @@ ivas_error IVAS_DEC_GetObjectMetadata( } hIsmMeta = st_ivas->hIsmMetaData[objectIdx]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIsmMeta == NULL || zero_flag || ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( hIsmMeta == NULL || zero_flag ) -#endif { metadata->azimuth = 0.f; metadata->elevation = 0.f; @@ -2381,11 +2363,7 @@ ivas_error IVAS_DEC_GetDelay( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0], hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ); -#else - nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], hDecoderConfig->output_config ) ); -#endif nSamples[2] = (int16_t) roundf( (float) st_ivas->binaural_latency_ns * hDecoderConfig->output_Fs / 1000000000.f ); nSamples[0] = nSamples[1] + nSamples[2]; diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 164c2d5d4..2b7b9987d 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -440,7 +440,6 @@ ivas_error ivas_masa_encode( } else { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { #ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR @@ -468,18 +467,14 @@ ivas_error ivas_masa_encode( } else { -#endif /* write the number of MASA transport channels */ push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; } if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR if ( nchan_ism >= 3 ) /* if 3 or 4 objects */ { @@ -500,13 +495,6 @@ ivas_error ivas_masa_encode( } #endif hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; -#else - /* signal MASA_ISM_FORMAT to decoder */ - push_next_indice( hMetaData, 1, 1 ); - /* write reserved bit */ - push_next_indice( hMetaData, 0, MASA_HEADER_BITS - 1 ); - hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; -#endif } else { diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 351ac4264..56b045fcb 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -339,12 +339,10 @@ int16_t ivas_get_nchan_buffers_dec( nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_ism > 0 ) { nchan_out_buff = st_ivas->nchan_ism + CPE_CHANNELS; } -#endif } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index c7dd7df86..0f5d5ec2b 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -41,20 +41,12 @@ typedef struct masaMetaDelayStorage { MASA_DECRIPTIVE_META descriptiveMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t prevDelay; -#else - uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; -#endif } MASA_META_DELAY_STORAGE; struct MasaFileWriter @@ -96,23 +88,16 @@ static void getExtMasaMetadataFileName( static void delayMasaMetadata( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ uint8_t delayNsf -#else - MASA_META_DELAY_STORAGE *delayStorage /* i/o: Storage for 10 ms of metadata and related descriptive metadata */ -#endif ) { int16_t dir, sf, band; uint8_t currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t storeReadOffset; -#endif /* Move meta to delay and output. Always use two directions as the metadata is prepared to contain zero energy second direction * if there is 1dir meta. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* stable state expected results delay change expected results delayNsf = 2 delayNsf = 3 delayNsf = 3 (from 2) delayNsf = 2 (from 3) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[0] (prev ext[1]) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[1] (prev ext[2]) @@ -183,43 +168,6 @@ static void delayMasaMetadata( } } -#else - for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES - DELAY_MASA_PARAM_DEC_SFR; sf++ ) - { - for ( band = 0; band < MASA_FREQUENCY_BANDS; band++ ) - { - uint16_t temp_u16; - uint8_t temp_u8; - for ( dir = 0; dir < MASA_MAXIMUM_DIRECTIONS; dir++ ) - { - temp_u16 = delayStorage->directionIndex[dir][sf][band]; - delayStorage->directionIndex[dir][sf][band] = extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directionIndex[dir][sf][band]; - extOutMeta->directionIndex[dir][sf][band] = temp_u16; - - temp_u8 = delayStorage->directToTotalRatio[dir][sf][band]; - delayStorage->directToTotalRatio[dir][sf][band] = extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directToTotalRatio[dir][sf][band]; - extOutMeta->directToTotalRatio[dir][sf][band] = temp_u8; - - temp_u8 = delayStorage->spreadCoherence[dir][sf][band]; - delayStorage->spreadCoherence[dir][sf][band] = extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->spreadCoherence[dir][sf][band]; - extOutMeta->spreadCoherence[dir][sf][band] = temp_u8; - } - - temp_u8 = delayStorage->surroundCoherence[sf][band]; - delayStorage->surroundCoherence[sf][band] = extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->surroundCoherence[sf][band]; - extOutMeta->surroundCoherence[sf][band] = temp_u8; - - temp_u8 = delayStorage->diffuseToTotalRatio[sf][band]; - delayStorage->diffuseToTotalRatio[sf][band] = extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->diffuseToTotalRatio[sf][band]; - extOutMeta->diffuseToTotalRatio[sf][band] = temp_u8; - } - } -#endif /* Finalize descriptive meta by using new frame except for number of directions which is the larger of the two */ currentNumberOfDirections = extOutMeta->descriptiveMeta.numberOfDirections; if ( delayStorage->descriptiveMeta.numberOfDirections > extOutMeta->descriptiveMeta.numberOfDirections ) @@ -227,9 +175,7 @@ static void delayMasaMetadata( extOutMeta->descriptiveMeta.numberOfDirections = delayStorage->descriptiveMeta.numberOfDirections; } delayStorage->descriptiveMeta.numberOfDirections = currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayStorage->prevDelay = delayNsf; -#endif return; } @@ -272,9 +218,7 @@ ivas_error MasaFileWriter_open( if ( !delayCompensationEnabled ) { self->delayStorage = calloc( sizeof( MASA_META_DELAY_STORAGE ), 1 ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT self->delayStorage->prevDelay = DELAY_MASA_PARAM_DEC_SFR; -#endif } *masaWriter = self; @@ -291,12 +235,8 @@ ivas_error MasaFileWriter_open( ivas_error MasaFileWriter_writeFrame( MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ) { if ( self == NULL ) @@ -307,7 +247,6 @@ ivas_error MasaFileWriter_writeFrame( uint16_t descMetaTemp = 0; int16_t i, sf, dir, numDirections; uint8_t writeTempOther[MASA_FREQUENCY_BANDS]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* If delay storage has been reserved, then we are in the normal mode for the decoder * (i.e., no delay compensation for PCM) which means that metadata should be delayed * by two or three subframes (10 or 15 ms). Descriptive metadata is a combined result. */ @@ -317,15 +256,6 @@ ivas_error MasaFileWriter_writeFrame( delayMasaMetadata( hMasaExtOutMeta, self->delayStorage, delayFrames ); } -#else - /* If delay storage has been reserved, then we are in the normal mode for the decoder - * (i.e., no delay compensation for PCM) which means that metadata should be delayed - * by two subframes (10 ms). Descriptive metadata is a combined result. */ - if ( self->delayStorage ) - { - delayMasaMetadata( hMasaExtOutMeta, self->delayStorage ); - } -#endif numDirections = hMasaExtOutMeta->descriptiveMeta.numberOfDirections + 1; diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index c3e142254..7b7497232 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -48,12 +48,8 @@ ivas_error MasaFileWriter_open( ivas_error MasaFileWriter_writeFrame( MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ); void MasaFileWriter_close( -- GitLab From 043f3f7daba8ab9c22526a945f43e8bcda9ad0cc Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:24:18 +0200 Subject: [PATCH 09/65] [cleanup] accept FIX_1161_REDUCE_OMASA_HEAP --- lib_com/ivas_prot.h | 4 -- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 14 ------ lib_dec/ivas_ism_renderer.c | 30 ------------- lib_dec/ivas_masa_dec.c | 4 -- lib_dec/ivas_omasa_dec.c | 28 ------------ lib_enc/ivas_masa_enc.c | 89 ------------------------------------- lib_enc/ivas_omasa_enc.c | 36 --------------- lib_enc/ivas_stat_enc.h | 8 ---- 9 files changed, 214 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 40db59c88..173edfd13 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5804,11 +5804,7 @@ void ivas_omasa_combine_separate_ism_with_masa( const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef FIX_1161_REDUCE_OMASA_HEAP ivas_error ivas_omasa_objects_delay_open( -#else -ivas_error ivas_omasa_render_objects_from_mix_open( -#endif Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); diff --git a/lib_com/options.h b/lib_com/options.h index ea7db4e9b..28e42aad5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define FIX_1161_REDUCE_OMASA_HEAP /* VA: reduction of OMASA heap memory */ #define CONF_DISTATT /* Eri: Make distance attenuation configurable */ #define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ #define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 0f6695145..d4179e75a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2358,30 +2358,20 @@ ivas_error ivas_init_decoder( } } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /* Allocate memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#else - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { @@ -2392,11 +2382,7 @@ ivas_error ivas_init_decoder( { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_omasa_render_objects_from_mix_open( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 19338aa72..f8e25682a 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -374,14 +374,10 @@ ivas_error ivas_omasa_separate_object_renderer_open( init_interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); interpolator_length = init_interpolator_length; -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( st_ivas->hIsmRendererData->interpolator = (float *) malloc( sizeof( float ) * init_interpolator_length ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM renderer interpolator \n" ) ); } -#else - st_ivas->hIsmRendererData->interpolator = (float *) malloc( sizeof( float ) * init_interpolator_length ); -#endif for ( i = 0; i < interpolator_length; i++ ) { @@ -389,32 +385,6 @@ ivas_error ivas_omasa_separate_object_renderer_open( } st_ivas->hIsmRendererData->interpolator_length = interpolator_length; -#ifndef FIX_1161_REDUCE_OMASA_HEAP - st_ivas->hMasaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); - - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - st_ivas->hMasaIsmData->delayBuffer_nchan = 1; - } - else - { - st_ivas->hMasaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; - } - - if ( ( st_ivas->hMasaIsmData->delayBuffer = (float **) malloc( st_ivas->hMasaIsmData->delayBuffer_nchan * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); - } - - for ( i = 0; i < st_ivas->hMasaIsmData->delayBuffer_nchan; i++ ) - { - if ( ( st_ivas->hMasaIsmData->delayBuffer[i] = (float *) malloc( st_ivas->hMasaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); - } - set_zero( st_ivas->hMasaIsmData->delayBuffer[i], st_ivas->hMasaIsmData->delayBuffer_size ); - } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 08c842d74..dc4b06573 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -886,11 +886,7 @@ static ivas_error ivas_masa_dec_config( for ( i = 0; i < st_ivas->hQMetaData->no_directions; i++ ) { st_ivas->hQMetaData->q_direction[i].cfg.nbands = hMasa->config.numCodingBands; -#ifdef FIX_1161_REDUCE_OMASA_HEAP st_ivas->hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - st_ivas->hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) { diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index b70137923..594227665 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -388,19 +388,11 @@ ivas_error ivas_omasa_dec_config( } } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /* Allocate memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#else - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } else { @@ -424,12 +416,10 @@ ivas_error ivas_omasa_dec_config( if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { @@ -456,11 +446,7 @@ ivas_error ivas_omasa_dec_config( DIRAC_CONFIG_FLAG common_rend_config_flag = st_ivas->hSpatParamRendCom == NULL ? DIRAC_OPEN : DIRAC_RECONFIGURE; /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_omasa_render_objects_from_mix_open( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1046,7 +1032,6 @@ void ivas_omasa_combine_separate_ism_with_masa( } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /*-------------------------------------------------------------------------* * ivas_omasa_objects_delay_open() * @@ -1054,21 +1039,11 @@ void ivas_omasa_combine_separate_ism_with_masa( *-------------------------------------------------------------------------*/ ivas_error ivas_omasa_objects_delay_open( -#else -/*-------------------------------------------------------------------------* - * ivas_omasa_render_objects_from_mix_open() - * - * Open structures, reserve memory, and init values. - *-------------------------------------------------------------------------*/ - -ivas_error ivas_omasa_render_objects_from_mix_open( -#endif Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { int16_t i; -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { st_ivas->hMasaIsmData->delayBuffer_nchan = 1; @@ -1077,9 +1052,6 @@ ivas_error ivas_omasa_render_objects_from_mix_open( { st_ivas->hMasaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; } -#else - st_ivas->hMasaIsmData->delayBuffer_nchan = 1; -#endif st_ivas->hMasaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 2b7b9987d..616c8894d 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -174,7 +174,6 @@ ivas_error ivas_masa_enc_open( hOmasaData->lp_noise_CPE = -1; hOmasaData->omasa_stereo_sw_cnt = OMASA_STEREO_SW_CNT_MAX; -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { if ( ( hOmasaData->hOmasaEnergy = (OMASA_ENCODER_ENERGY_HANDLE) malloc( sizeof( OMASA_ENCODER_ENERGY_STATE ) ) ) == NULL ) @@ -186,7 +185,6 @@ ivas_error ivas_masa_enc_open( { hOmasaData->hOmasaEnergy = NULL; } -#endif hMasa->data.hOmasaData = hOmasaData; } @@ -225,14 +223,12 @@ void ivas_masa_enc_close( if ( ( *hMasa )->data.hOmasaData != NULL ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( *hMasa )->data.hOmasaData->hOmasaEnergy != NULL ) { free( ( *hMasa )->data.hOmasaData->hOmasaEnergy ); ( *hMasa )->data.hOmasaData->hOmasaEnergy = NULL; } -#endif free( ( *hMasa )->data.hOmasaData ); ( *hMasa )->data.hOmasaData = NULL; } @@ -870,11 +866,7 @@ ivas_error ivas_masa_enc_config( for ( i = 0; i < hQMetaData->no_directions; i++ ) { hQMetaData->q_direction[i].cfg.nbands = hMasa->config.numCodingBands; -#ifdef FIX_1161_REDUCE_OMASA_HEAP hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif if ( ivas_format == MC_FORMAT ) { @@ -1387,11 +1379,7 @@ static void move_metadata_to_qmetadata( numCodingBands = hMasa->config.numCodingBands; numDirections = hMasa->config.numberOfDirections; -#ifdef FIX_1161_REDUCE_OMASA_HEAP numSf = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif hMeta = &( hMasa->masaMetadata ); for ( dir = 0; dir < numDirections; dir++ ) @@ -2688,17 +2676,11 @@ void ivas_merge_masa_metadata( float eneBand; float energyMerged[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hMasa->data.hOmasaData->hOmasaEnergy; -#endif numCodingBands = hMasa->config.numCodingBands; numDirections = hMasa->config.numberOfDirections; -#ifdef FIX_1161_REDUCE_OMASA_HEAP numSf = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif hMeta = &( hMasa->masaMetadata ); for ( sf = 0; sf < numSf; sf++ ) @@ -2719,11 +2701,7 @@ void ivas_merge_masa_metadata( /* Compute energies */ eneBand = hMasa->data.energy[sf][band]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP energyMerged[sf][band] = eneBand + hOmasaEnergy->energy_ism[sf][band]; -#else - energyMerged[sf][band] = eneBand + hMasa->data.hOmasaData->energy_ism[sf][band]; -#endif /* Compute weights */ energyTimesRatioMASA[0] = eneBand * hMeta->directional_meta[0].energy_ratio[sf][band]; @@ -2740,11 +2718,7 @@ void ivas_merge_masa_metadata( total_diff_nrg = eneBand * hMeta->common_meta.diffuse_to_total_ratio[sf][band]; /* criterion is mean of ISM ratio and new ratio */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hOmasaEnergy->energy_ism[sf][band] ) ) ) / 2.0f * hOmasaEnergy->energy_ism[sf][band]; -#else - energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.hOmasaData->energy_ism[sf][band] ) ) ) / 2.0f * hMasa->data.hOmasaData->energy_ism[sf][band]; -#endif /* Determine combined metadata based on the weights */ merge_dest = -1; @@ -2766,11 +2740,7 @@ void ivas_merge_masa_metadata( hMeta->directional_meta[merge_dest].elevation[sf][band] = hOMasaMeta->directional_meta[0].elevation[sf][band]; /* limit with the earlier direct-energy ratio */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hOmasaEnergy->energy_ism[sf][band] ); /* new dir ratio */ -#else - dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.hOmasaData->energy_ism[sf][band] ); /* new dir ratio */ -#endif hMeta->directional_meta[merge_dest].energy_ratio[sf][band] = min( dir_sum, hOMasaMeta->directional_meta[0].energy_ratio[sf][band] ); /* clip with original ISM dir */ hMeta->common_meta.diffuse_to_total_ratio[sf][band] = 1.0f - hMeta->directional_meta[merge_dest].energy_ratio[sf][band]; @@ -3485,9 +3455,7 @@ static void ivas_encode_masaism_metadata( int16_t tmp, rotate; int16_t n_ism_tmp, i; OMASA_ENCODER_DATA_HANDLE hOmasaData = hMasa->data.hOmasaData; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hOmasaData->hOmasaEnergy; -#endif int16_t nbands_work; /* use the values from hQMetaData */ @@ -3498,11 +3466,7 @@ static void ivas_encode_masaism_metadata( { for ( sf = 0; sf < numSf; sf++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( sum_f( hOmasaEnergy->energy_ism[sf], omasa_nbands ) == 0.0f ) -#else - if ( sum_f( hOmasaData->energy_ism[sf], omasa_nbands ) == 0.0f ) -#endif { hOmasaData->masa_to_total_energy_ratio[sf][0] = 1.0f; } @@ -3524,29 +3488,17 @@ static void ivas_encode_masaism_metadata( for ( band = 0; band < omasa_nbands; band++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism += hOmasaEnergy->energy_ism[sf][band]; -#else - energy_ism += hOmasaData->energy_ism[sf][band]; -#endif for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism_ind[obj] += hOmasaEnergy->energy_ism[sf][band] * hOmasaEnergy->energy_ratio_ism[sf][band][obj]; -#else - energy_ism_ind[obj] += hOmasaData->energy_ism[sf][band] * hOmasaData->energy_ratio_ism[sf][band][obj]; -#endif } } for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[sf][0][obj] = energy_ism_ind[obj] / energy_ism; -#else - hOmasaData->energy_ratio_ism[sf][0][obj] = energy_ism_ind[obj] / energy_ism; -#endif } hOmasaData->masa_to_total_energy_ratio[sf][0] = eneBand / ( eneBand + energy_ism + EPSILON ); } @@ -3563,18 +3515,10 @@ static void ivas_encode_masaism_metadata( } for ( sf = 0; sf < omasa_nblocks; sf++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism += hOmasaEnergy->energy_ism[sf][band]; -#else - energy_ism += hOmasaData->energy_ism[sf][band]; -#endif for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism_ind[obj] += hOmasaEnergy->energy_ism[sf][band] * hOmasaEnergy->energy_ratio_ism[sf][band][obj]; -#else - energy_ism_ind[obj] += hOmasaData->energy_ism[sf][band] * hOmasaData->energy_ratio_ism[sf][band][obj]; -#endif } } @@ -3586,11 +3530,7 @@ static void ivas_encode_masaism_metadata( { for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[0][band][obj] = energy_ism_ind[obj] / energy_ism; -#else - hOmasaData->energy_ratio_ism[0][band][obj] = energy_ism_ind[obj] / energy_ism; -#endif } brange[0] = hMasa->data.band_mapping[band]; brange[1] = hMasa->data.band_mapping[band + 1]; @@ -3612,11 +3552,7 @@ static void ivas_encode_masaism_metadata( for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[0][band][obj] = hOmasaEnergy->energy_ratio_ism[0][nbands_work - 1][obj]; -#else - hOmasaData->energy_ratio_ism[0][band][obj] = hOmasaData->energy_ratio_ism[0][nbands_work - 1][obj]; -#endif } } } @@ -3626,11 +3562,7 @@ static void ivas_encode_masaism_metadata( { for ( band = 0; band < nbands_work; band++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( hOmasaEnergy->energy_ism[sf][band] == 0.0f ) -#else - if ( hOmasaData->energy_ism[sf][band] == 0.0f ) -#endif { hOmasaData->masa_to_total_energy_ratio[sf][band] = 1.0f; } @@ -3644,11 +3576,7 @@ static void ivas_encode_masaism_metadata( { eneBand += hMasa->data.energy[sf][bin]; } -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hOmasaEnergy->energy_ism[sf][band] + EPSILON ); -#else - hOmasaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hOmasaData->energy_ism[sf][band] + EPSILON ); -#endif } } for ( band = nbands_work; band < numCodingBands; band++ ) @@ -3657,11 +3585,7 @@ static void ivas_encode_masaism_metadata( for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[sf][band][obj] = hOmasaEnergy->energy_ratio_ism[sf][nbands_work - 1][obj]; -#else - hOmasaData->energy_ratio_ism[sf][band][obj] = hOmasaData->energy_ratio_ism[sf][nbands_work - 1][obj]; -#endif } } } @@ -3683,13 +3607,8 @@ static void ivas_encode_masaism_metadata( { for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP assert( ( hOmasaEnergy->energy_ratio_ism[sf][band][obj] >= 0 ) && ( hOmasaEnergy->energy_ratio_ism[sf][band][obj] <= 1 ) ); ratio_ism[band][obj] = hOmasaEnergy->energy_ratio_ism[sf][band][obj]; -#else - assert( ( hOmasaData->energy_ratio_ism[sf][band][obj] >= 0 ) && ( hOmasaData->energy_ratio_ism[sf][band][obj] <= 1 ) ); - ratio_ism[band][obj] = hOmasaData->energy_ratio_ism[sf][band][obj]; -#endif } /* Quantize ISM ratios */ @@ -3713,11 +3632,7 @@ static void ivas_encode_masaism_metadata( } /* reconstructed values */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP reconstruct_ism_ratios( ratio_ism_idx[band], nchan_ism, step, hOmasaEnergy->q_energy_ratio_ism[sf][band] ); -#else - reconstruct_ism_ratios( ratio_ism_idx[band], nchan_ism, step, hMasa->data.hOmasaData->q_energy_ratio_ism[sf][band] ); -#endif } if ( ( nchan_ism > 2 ) && ( idx_separated_object == nchan_ism - 1 ) ) @@ -3793,11 +3708,7 @@ static void ivas_encode_masaism_metadata( } -#ifdef FIX_1161_REDUCE_OMASA_HEAP calculate_nbits_meta( nchan_ism, hOmasaEnergy->q_energy_ratio_ism, hOmasaData->masa_to_total_energy_ratio, numSf, numCodingBands, bits_ism, idx_separated_object, ism_imp ); -#else - calculate_nbits_meta( nchan_ism, hOmasaData->q_energy_ratio_ism, hOmasaData->masa_to_total_energy_ratio, numSf, numCodingBands, bits_ism, idx_separated_object, ism_imp ); -#endif /* quantize directions */ for ( obj = 0; obj < nchan_ism; obj++ ) diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 399ad301b..d38980016 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -290,7 +290,6 @@ ivas_error ivas_omasa_enc_config( st_ivas->hOMasa = NULL; } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /* OMASA energy handle */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hMasa->data.hOmasaData->hOmasaEnergy == NULL ) { @@ -305,7 +304,6 @@ ivas_error ivas_omasa_enc_config( st_ivas->hMasa->data.hOmasaData->hOmasaEnergy = NULL; } -#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) @@ -839,9 +837,7 @@ static void ivas_omasa_param_est_enc( float renormalization_factor_diff[MASA_FREQUENCY_BANDS]; float norm_tmp; int16_t mrange[2], brange[2]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hOmasaData->hOmasaEnergy; -#endif num_freq_bins = hOMasa->cldfbAnaEnc[0]->no_channels; num_freq_bands = hOMasa->nbands; @@ -873,11 +869,7 @@ static void ivas_omasa_param_est_enc( hOMasa->direction_vector_m[2][block_m_idx][band_m_idx] = 0.0f; } -#ifdef FIX_1161_REDUCE_OMASA_HEAP set_zero( hOmasaEnergy->energy_ism[block_m_idx], num_freq_bands ); -#else - set_zero( hOmasaData->energy_ism[block_m_idx], num_freq_bands ); -#endif for ( ts = mrange[0]; ts < mrange[1]; ts++ ) { @@ -895,11 +887,7 @@ static void ivas_omasa_param_est_enc( { for ( k = 0; k < nchan_ism; k++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ism[block_m_idx][i] += Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; -#else - hOmasaData->energy_ism[block_m_idx][i] += Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; -#endif } } } @@ -1027,9 +1015,7 @@ static void ivas_omasa_energy_and_ratio_est( int16_t mrange[2], brange[2]; float tftile_energy; float ism_ratio_sum; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hOmasaData->hOmasaEnergy; -#endif num_freq_bands = hOMasa->nbands; l_ts = input_frame / CLDFB_NO_COL_MAX; @@ -1044,17 +1030,9 @@ static void ivas_omasa_energy_and_ratio_est( for ( i = 0; i < hOMasa->nbands; i++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP set_zero( hOmasaEnergy->energy_ratio_ism[block_m_idx][i], nchan_ism ); -#else - set_zero( hOmasaData->energy_ratio_ism[block_m_idx][i], nchan_ism ); -#endif } -#ifdef FIX_1161_REDUCE_OMASA_HEAP set_zero( hOmasaEnergy->energy_ism[block_m_idx], num_freq_bands ); -#else - set_zero( hOmasaData->energy_ism[block_m_idx], num_freq_bands ); -#endif /* Compute CLDFB */ for ( ts = mrange[0]; ts < mrange[1]; ts++ ) @@ -1074,13 +1052,8 @@ static void ivas_omasa_energy_and_ratio_est( for ( k = 0; k < nchan_ism; k++ ) { tftile_energy = Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ism[block_m_idx][i] += tftile_energy; hOmasaEnergy->energy_ratio_ism[block_m_idx][i][k] += tftile_energy; -#else - hOmasaData->energy_ism[block_m_idx][i] += tftile_energy; - hOmasaData->energy_ratio_ism[block_m_idx][i][k] += tftile_energy; -#endif } } } @@ -1092,13 +1065,8 @@ static void ivas_omasa_energy_and_ratio_est( ism_ratio_sum = 0.0f; for ( j = 0; j < nchan_ism; j++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[block_m_idx][i][j] /= ( hOmasaEnergy->energy_ism[block_m_idx][i] + EPSILON ); ism_ratio_sum += hOmasaEnergy->energy_ratio_ism[block_m_idx][i][j]; -#else - hOmasaData->energy_ratio_ism[block_m_idx][i][j] /= ( hOmasaData->energy_ism[block_m_idx][i] + EPSILON ); - ism_ratio_sum += hOmasaData->energy_ratio_ism[block_m_idx][i][j]; -#endif } if ( ism_ratio_sum == 0.0f ) @@ -1106,11 +1074,7 @@ static void ivas_omasa_energy_and_ratio_est( float temp_ism_ratio = 1.0f / ( (float) nchan_ism ); for ( j = 0; j < nchan_ism; j++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[block_m_idx][i][j] = temp_ism_ratio; -#else - hOmasaData->energy_ratio_ism[block_m_idx][i][j] = temp_ism_ratio; -#endif } } } diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 4778c2eee..44c5c5ea1 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -798,7 +798,6 @@ typedef struct ivas_omasa_enc_state_structure } OMASA_ENC_STATE, *OMASA_ENC_HANDLE; -#ifdef FIX_1161_REDUCE_OMASA_HEAP typedef struct ivas_omasa_encoder_energy_struct { float energy_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; @@ -807,17 +806,10 @@ typedef struct ivas_omasa_encoder_energy_struct } OMASA_ENCODER_ENERGY_STATE, *OMASA_ENCODER_ENERGY_HANDLE; -#endif typedef struct ivas_omasa_encoder_data_struct { -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy; -#else - float energy_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; - float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; - float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; -#endif float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; float lp_noise_CPE; /* LP filtered total noise estimation */ int16_t omasa_stereo_sw_cnt; -- GitLab From 46a554adaf20948a076983a704ecbb30eba678ba Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:25:07 +0200 Subject: [PATCH 10/65] [cleanup] accept CONF_DISTATT --- apps/decoder.c | 2 -- lib_com/common_api_types.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_objectRenderer_internal.c | 7 ------- lib_dec/lib_dec.c | 2 -- lib_rend/ivas_objectRenderer.c | 20 -------------------- lib_rend/ivas_objectRenderer_sources.c | 14 -------------- lib_rend/ivas_prot_rend.h | 4 ---- lib_rend/ivas_render_config.c | 2 -- lib_util/render_config_reader.c | 16 ---------------- lib_util/render_config_reader.h | 2 -- 11 files changed, 72 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 4e2f1df20..98628492f 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -663,13 +663,11 @@ int main( goto cleanup; } -#ifdef CONF_DISTATT if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get Distance Attenuation \n\n" ); goto cleanup; } -#endif if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index f3c818149..3b4877a67 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -327,9 +327,7 @@ typedef struct _IVAS_RENDER_CONFIG IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics; ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; float directivity[IVAS_MAX_NUM_OBJECTS * 3]; -#ifdef CONF_DISTATT float distAtt[3]; -#endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; typedef struct diff --git a/lib_com/options.h b/lib_com/options.h index 28e42aad5..363cb2edd 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define CONF_DISTATT /* Eri: Make distance attenuation configurable */ #define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ #define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ #define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 804b5fef6..8ad2b2790 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -61,13 +61,8 @@ ivas_error ivas_td_binaural_open( num_src = st_ivas->nchan_ism; } -#ifdef CONF_DISTATT return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hRenderConfig->distAtt, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); -#else - return ivas_td_binaural_open_unwrap( &st_ivas->hHrtfTD, st_ivas->hDecoderConfig->output_Fs, num_src, st_ivas->ivas_format, - st_ivas->transport_config, st_ivas->hRenderConfig->directivity, st_ivas->hTransSetup, &st_ivas->hBinRendererTd, &st_ivas->binaural_latency_ns ); -#endif } @@ -286,9 +281,7 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( st_ivas->ivas_format, st_ivas->transport_config, st_ivas->hRenderConfig->directivity, -#ifdef CONF_DISTATT st_ivas->hRenderConfig->distAtt, -#endif st_ivas->hTransSetup, &st_ivas->hTdRendHandles[i], &st_ivas->binaural_latency_ns ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 2253a6966..c0b4c39ca 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2311,9 +2311,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( } mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 * MAX_NUM_OBJECTS ); -#ifdef CONF_DISTATT mvr2r( renderConfig.distAtt, hRenderConfig->distAtt, 3 ); -#endif hRenderConfig->split_rend_config = renderConfig.split_rend_config; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2137c9483..fd1a29368 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -66,9 +66,7 @@ ivas_error ivas_td_binaural_open_unwrap( const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ const AUDIO_CONFIG transport_config, /* i : Transport configuration */ const float *directivity, /* i : Directivity pattern (used for ISM) */ -#ifdef CONF_DISTATT const float *distAtt, /* i : Distance attenuation (used for ISM) */ -#endif const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -82,9 +80,7 @@ ivas_error ivas_td_binaural_open_unwrap( float Pos[3]; float Dir[3]; TDREND_DirAtten_t *DirAtten_p; -#ifdef CONF_DISTATT TDREND_DistAtten_t DistAtten; -#endif int16_t nchan_rend; ivas_error error; @@ -190,12 +186,10 @@ ivas_error ivas_td_binaural_open_unwrap( DirAtten_p->ConeOuterAngle = 360.0f; DirAtten_p->ConeOuterGain = 1.0f; -#ifdef CONF_DISTATT DistAtten.DistAttenModel = TDREND_DIST_ATTEN_MODEL_INV_DIST_CLAMPED; DistAtten.MaxDist = 15.75f; DistAtten.RefDist = 1.0f; DistAtten.RollOffFactor = 1.0f; -#endif if ( ( error = TDREND_MIX_SRC_SetPos( pBinRendTd, nS, Pos ) ) != IVAS_ERR_OK ) { @@ -216,12 +210,10 @@ ivas_error ivas_td_binaural_open_unwrap( { return error; } -#ifdef CONF_DISTATT if ( ( error = TDREND_MIX_SRC_SetDistAtten( pBinRendTd, nS, &DistAtten ) ) != IVAS_ERR_OK ) { return error; } -#endif } } @@ -243,7 +235,6 @@ ivas_error ivas_td_binaural_open_unwrap( DirAtten_p->ConeOuterAngle = directivity[nS * 3 + 1]; DirAtten_p->ConeOuterGain = directivity[nS * 3 + 2]; } -#ifdef CONF_DISTATT if ( NULL == distAtt ) { DistAtten.DistAttenModel = TDREND_DIST_ATTEN_MODEL_INV_DIST_CLAMPED; @@ -258,17 +249,14 @@ ivas_error ivas_td_binaural_open_unwrap( DistAtten.RefDist = distAtt[1]; DistAtten.RollOffFactor = distAtt[2]; } -#endif if ( ( error = TDREND_MIX_SRC_SetDirAtten( pBinRendTd, nS, DirAtten_p ) ) != IVAS_ERR_OK ) { return error; } -#ifdef CONF_DISTATT if ( ( error = TDREND_MIX_SRC_SetDistAtten( pBinRendTd, nS, &DistAtten ) ) != IVAS_ERR_OK ) { return error; } -#endif } } @@ -693,9 +681,7 @@ ivas_error ivas_td_binaural_open_ext( IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; -#ifdef CONF_DISTATT float *distAtt = NULL; -#endif float *directivity = NULL; if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) @@ -725,16 +711,10 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { directivity = hRendCfg->directivity; -#ifdef CONF_DISTATT distAtt = hRendCfg->distAtt; -#endif } -#ifdef CONF_DISTATT return ivas_td_binaural_open_unwrap( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, distAtt, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#else - return ivas_td_binaural_open_unwrap( pTDRend->hHrtfTD, outFs, nchan_transport, ivas_format, transport_config, directivity, hTransSetup, &pTDRend->hBinRendererTd, &pTDRend->binaural_latency_ns ); -#endif } diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index db26566ad..29546aff7 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -51,9 +51,7 @@ static void TDREND_SRC_SPATIAL_Init( TDREND_SRC_SPATIAL_t *SrcSpatial_p, const T static void TDREND_SRC_SPATIAL_SetDirAtten( TDREND_SRC_SPATIAL_t *SrcSpatial_p, const TDREND_DirAtten_t *DirAtten_p ); -#ifdef CONF_DISTATT static void TDREND_SRC_SPATIAL_SetDistAtten( TDREND_SRC_SPATIAL_t *SrcSpatial_p, const TDREND_DistAtten_t *DistAtten_p ); -#endif static float TDREND_SRC_SPATIAL_GetDirGain( const TDREND_DirAtten_t *DirAtten_p, const float *Front_p, const float *RelPos_p ); @@ -157,7 +155,6 @@ ivas_error TDREND_MIX_SRC_SetDirAtten( return IVAS_ERR_OK; } -#ifdef CONF_DISTATT /*-------------------------------------------------------------------* * TDREND_MIX_SRC_SetDistAtten() * @@ -183,7 +180,6 @@ ivas_error TDREND_MIX_SRC_SetDistAtten( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * TDREND_MIX_SRC_SetPlayState() @@ -523,7 +519,6 @@ static void TDREND_SRC_SPATIAL_SetDirAtten( return; } -#ifdef CONF_DISTATT /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_SetDistAtten() * @@ -543,7 +538,6 @@ static void TDREND_SRC_SPATIAL_SetDistAtten( return; } -#endif /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_GetDirGain() * @@ -617,11 +611,7 @@ static float TDREND_SRC_SPATIAL_GetDistGain( switch ( DistAtten_p->DistAttenModel ) { case TDREND_DIST_ATTEN_MODEL_INV_DIST: -#ifdef CONF_DISTATT DistGain = powf( DistAtten_p->RefDist / Dist2, DistAtten_p->RollOffFactor ); -#else - DistGain = DistAtten_p->RefDist / ( DistAtten_p->RefDist + DistAtten_p->RollOffFactor * ( Dist2 - DistAtten_p->RefDist ) ); -#endif break; case TDREND_DIST_ATTEN_MODEL_INV_DIST_CLAMPED: @@ -634,11 +624,7 @@ static float TDREND_SRC_SPATIAL_GetDistGain( { Dist2 = DistAtten_p->MaxDist; } -#ifdef CONF_DISTATT DistGain = powf( DistAtten_p->RefDist / Dist2, DistAtten_p->RollOffFactor ); -#else - DistGain = DistAtten_p->RefDist / ( DistAtten_p->RefDist + DistAtten_p->RollOffFactor * ( Dist2 - DistAtten_p->RefDist ) ); -#endif break; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index cc2c19537..0675ee829 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -630,9 +630,7 @@ ivas_error ivas_td_binaural_open_unwrap( const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ const AUDIO_CONFIG transport_config, /* i : Transport configuration */ const float *directivity, /* i : Directivity pattern (used for ISM) */ -#ifdef CONF_DISTATT const float *distAtt, /* i : Distance attenuation (used for ISM) */ -#endif const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -725,13 +723,11 @@ ivas_error TDREND_MIX_SRC_SetDirAtten( const int16_t SrcInd, /* i : Source index */ const TDREND_DirAtten_t *DirAtten_p /* i : Directional attenuation specifier */ ); -#ifdef CONF_DISTATT ivas_error TDREND_MIX_SRC_SetDistAtten( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ const int16_t SrcInd, /* i : Source index */ const TDREND_DistAtten_t *DistAtten_p /* i : Distance attenuation specifier */ ); -#endif ivas_error TDREND_MIX_SRC_SetPlayState( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ const int16_t SrcInd, /* i : Source index */ diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 6a6ac6130..8f86e8012 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -133,11 +133,9 @@ ivas_error ivas_render_config_init_from_rom( ( *hRenderConfig )->directivity[i * 3 + 1] = 360.0f; /* Back cone */ ( *hRenderConfig )->directivity[i * 3 + 2] = 1.0f; /* Back attenuation */ } -#ifdef CONF_DISTATT ( *hRenderConfig )->distAtt[0] = 15.75f; /* Default max dist */ ( *hRenderConfig )->distAtt[1] = 1.0f; /* Default ref dist */ ( *hRenderConfig )->distAtt[2] = 1.0f; /* Default rolloff factor */ -#endif ( *hRenderConfig )->split_rend_config.splitRendBitRate = SPLIT_REND_768k; ( *hRenderConfig )->split_rend_config.dof = 3; ( *hRenderConfig )->split_rend_config.hq_mode = 0; diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 097b0fe70..149204ba1 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -124,9 +124,7 @@ struct RenderConfigReader AcousticEnv *pAE; /* Acoustic environments */ uint32_t nDP; /* Number of directivity patterns */ DirectrivityPat *pDP; /* Directivity Pattern */ -#ifdef CONF_DISTATT float distAtt[3]; /* [MaxDist, RefDist, Rolloff] */ -#endif }; @@ -999,7 +997,6 @@ static ivas_error get_bin_outer_attenuation( return IVAS_ERR_OK; } -#ifdef CONF_DISTATT /*-----------------------------------------------------------------------------------------* * Function get_bin_max_dist () * Gets a Maximum Distance value [1.0, 64.0] @@ -1069,7 +1066,6 @@ static ivas_error get_bin_rolloff( return IVAS_ERR_OK; } -#endif /*-----------------------------------------------------------------------------------------* * Function read_txt_vector() @@ -1198,9 +1194,7 @@ ivas_error RenderConfigReader_checkValues( pRoom_acoustics = &hRenderConfig->roomAcoustics; tab_value_err_count = 0; int16_t wall_idx; -#ifdef CONF_DISTATT int16_t i; -#endif /* Verify the number of frequency bands in the config input data */ if ( ( pRoom_acoustics->nBands > N_BANDS_MAX ) || ( pRoom_acoustics->nBands < N_BANDS_MIN ) ) @@ -1318,7 +1312,6 @@ ivas_error RenderConfigReader_checkValues( } } -#ifdef CONF_DISTATT /* Verify range of distance attenuation parameters: 0.1 <= distAtt[0] <= distAtt[1] */ /* 0.0 <= distAtt[2] <= 10.0 */ hRenderConfig->distAtt[0] = max( 0.1f, hRenderConfig->distAtt[0] ); @@ -1332,7 +1325,6 @@ ivas_error RenderConfigReader_checkValues( hRenderConfig->directivity[i * 3 + 1] = max( 0.0f, min( 360.0f, hRenderConfig->directivity[i * 3 + 1] ) ); hRenderConfig->directivity[i * 3 + 2] = max( 0.0f, min( 1.0f, hRenderConfig->directivity[i * 3 + 2] ) ); } -#endif } @@ -1375,9 +1367,7 @@ ivas_error RenderConfigReader_open( pSelf->pAE = NULL; pSelf->nDP = 0; pSelf->pDP = NULL; -#ifdef CONF_DISTATT pSelf->distAtt[0] = -1; -#endif *ppRenderConfigReader = pSelf; return IVAS_ERR_OK; @@ -1897,7 +1887,6 @@ static ivas_error RenderConfigReader_readBinary( } } } -#ifdef CONF_DISTATT /**********************************/ /* Read the distance attenuation */ /**********************************/ @@ -1925,7 +1914,6 @@ static ivas_error RenderConfigReader_readBinary( return error; } } -#endif /* Cleanup */ @@ -2777,7 +2765,6 @@ ivas_error RenderConfigReader_read( free( pValue ); accDPIdx++; } -#ifdef CONF_DISTATT else if ( strcmp( chapter, "DISTANCEATTENUATION" ) == 0 ) { params_idx = 0; @@ -2823,7 +2810,6 @@ ivas_error RenderConfigReader_read( free( pValue ); } -#endif else if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) { params_idx = 0; @@ -3082,7 +3068,6 @@ ivas_error RenderConfigReader_getDirectivity( return IVAS_ERR_OK; } -#ifdef CONF_DISTATT /*------------------------------------------------------------------------------------------* * RenderConfigReader_getDistanceAttenuation() * @@ -3109,7 +3094,6 @@ ivas_error RenderConfigReader_getDistanceAttenuation( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------------------------* * RenderConfigReader_close() diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index 561e05f31..8edaecc2f 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -62,12 +62,10 @@ ivas_error RenderConfigReader_getDirectivity( uint16_t *pId, /* i : Directivity pattern ID */ float *directivity /* o : Target directivity */ ); -#ifdef CONF_DISTATT ivas_error RenderConfigReader_getDistanceAttenuation( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ float *distAtt /* o : Distance attenuation */ ); -#endif /* Verifies configuration parameters */ ivas_error RenderConfigReader_checkValues( IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ -- GitLab From e833c7c6cf5f61d53eb7e03290dcca9c1df388e3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:25:48 +0200 Subject: [PATCH 11/65] [cleanup] accept FIX_1052_EXT_OUTPUT --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 46 ----------------------------- lib_dec/ivas_jbm_dec.c | 4 --- lib_dec/ivas_masa_dec.c | 10 ------- lib_dec/ivas_mc_param_dec.c | 4 --- lib_dec/ivas_mct_dec.c | 6 ---- lib_dec/ivas_out_setup_conversion.c | 14 --------- lib_dec/ivas_output_config.c | 16 ---------- lib_rend/ivas_output_init.c | 4 --- 9 files changed, 105 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 363cb2edd..b9a02d15f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ #define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ #define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index d4179e75a..c94849a0c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1371,7 +1371,6 @@ ivas_error ivas_init_decoder( if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef FIX_1052_EXT_OUTPUT if ( st_ivas->ivas_format == STEREO_FORMAT ) { hDecoderConfig->nchan_out = CPE_CHANNELS; @@ -1384,9 +1383,6 @@ ivas_error ivas_init_decoder( else if ( st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) #else else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif -#else - if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) #endif { #ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER @@ -1414,7 +1410,6 @@ ivas_error ivas_init_decoder( st_ivas->intern_config = output_config; -#ifdef FIX_1052_EXT_OUTPUT if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->ivas_format == MC_FORMAT ) { ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->transport_config ); @@ -1435,9 +1430,6 @@ ivas_error ivas_init_decoder( { ivas_output_init( &( st_ivas->hOutSetup ), output_config ); } -#else - ivas_output_init( &( st_ivas->hOutSetup ), output_config ); -#endif if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { @@ -3376,50 +3368,12 @@ static ivas_error doSanityChecks_IVAS( /* Verify stereo output configuration */ if ( st_ivas->ivas_format == STEREO_FORMAT ) { -#ifdef FIX_1052_EXT_OUTPUT if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" ); } } -#ifdef FIX_1052_EXT_OUTPUT if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - else if ( st_ivas->ivas_format == ISM_FORMAT ) - { - /* Verify ISM output configuration */ - if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for ISM" ); - } - } - else if ( st_ivas->ivas_format == SBA_FORMAT ) - { - /* Verify SBA output coniguration */ - if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for SBA" ); - } - } - else if ( st_ivas->ivas_format == MASA_FORMAT ) - { - if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for MASA!" ); - } - } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - /* Verify MC output configuration */ - if ( output_config == IVAS_AUDIO_CONFIG_INVALID || output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for Multi-channel" ); - } - } -#endif if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 0ed1add7d..cf5956555 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -680,11 +680,7 @@ ivas_error ivas_jbm_dec_tc( /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || -#ifdef FIX_1052_EXT_OUTPUT output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) || output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) -#endif { ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, p_output, output_frame, n, LFE_CHANNEL ); } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index dc4b06573..07bafa790 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -449,11 +449,7 @@ ivas_error ivas_masa_decode( hMasa->config.coherencePresent = !hQMetaData->all_coherence_zero; -#ifdef FIX_1052_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) ) -#else - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) -#endif { index_16bits( hQMetaData, hMasa->data.sph_grid16 ); } @@ -672,11 +668,7 @@ ivas_error ivas_masa_dec_open( hMasa->config.joinedSubframes = FALSE; /* Create spherical grid only for external output */ -#ifdef FIX_1052_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) ) -#else - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) -#endif { if ( ( hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) malloc( sizeof( SPHERICAL_GRID_DATA ) ) ) == NULL ) { @@ -1107,9 +1099,7 @@ static ivas_error init_lfe_synth_data( ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || -#ifdef FIX_1052_EXT_OUTPUT output_config == IVAS_AUDIO_CONFIG_EXTERNAL || -#endif output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) ) diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 3cd98b9ca..68da9856b 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -148,11 +148,7 @@ ivas_error ivas_param_mc_dec_open( hParamMC->hoa_encoder = NULL; /* determine the synthesis config */ -#ifdef FIX_1052_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD || st_ivas->transport_config == output_config || output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD || st_ivas->transport_config == output_config ) -#endif { hParamMC->synthesis_conf = PARAM_MC_SYNTH_DIRECT; } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 586bd6490..4fa290a8d 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -685,7 +685,6 @@ ivas_error ivas_mc_dec_config( { st_ivas->transport_config = signaled_config; } -#ifdef FIX_1052_EXT_OUTPUT else if ( st_ivas->transport_config != signaled_config ) { #ifdef DEBUGGING @@ -693,7 +692,6 @@ ivas_error ivas_mc_dec_config( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); } -#endif /* select MC format mode */ st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), st_ivas->hDecoderConfig->ivas_total_brate ); @@ -701,11 +699,7 @@ ivas_error ivas_mc_dec_config( /* MC format switching */ if ( st_ivas->ini_frame != 0 ) { -#ifdef FIX_1052_EXT_OUTPUT if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || last_mc_mode != st_ivas->mc_mode ) -#else - if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || st_ivas->transport_config != signaled_config || last_mc_mode != st_ivas->mc_mode ) -#endif { if ( ( error = ivas_mc_dec_reconfig( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index ce0172a86..f897ad87b 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -309,9 +309,7 @@ ivas_error ivas_ls_setup_conversion_open( int16_t output_frame; int32_t output_Fs; int16_t paramUpmixMonoStereo; -#ifdef FIX_1052_EXT_OUTPUT ivas_error error; -#endif if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { @@ -421,37 +419,25 @@ ivas_error ivas_ls_setup_conversion_open( { if ( paramUpmixMonoStereo == TRUE ) { -#ifdef FIX_1052_EXT_OUTPUT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); -#endif } else { -#ifdef FIX_1052_EXT_OUTPUT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ); -#endif } } else { -#ifdef FIX_1052_EXT_OUTPUT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ); -#endif } } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index e8130f11f..e2d1d8955 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -266,11 +266,7 @@ void ivas_renderer_select( } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { -#ifdef FIX_1052_EXT_OUTPUT if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO ) -#endif { *renderer_type = RENDERER_MC; } @@ -435,11 +431,7 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MC_FORMAT ) { *internal_config = transport_config; -#ifdef FIX_1052_EXT_OUTPUT if ( st_ivas->mc_mode == MC_MODE_MCT && *internal_config != output_config && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( st_ivas->mc_mode == MC_MODE_MCT && *internal_config != output_config ) -#endif { if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 ) { @@ -453,11 +445,7 @@ void ivas_renderer_select( else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { *internal_config = transport_config; -#ifdef FIX_1052_EXT_OUTPUT if ( *internal_config != output_config && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( *internal_config != output_config ) -#endif { if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 ) { @@ -482,14 +470,10 @@ void ivas_renderer_select( } else if ( st_ivas->mc_mode == MC_MODE_MCMASA ) { -#ifdef FIX_1052_EXT_OUTPUT if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { *internal_config = output_config; } -#else - *internal_config = output_config; -#endif /* No rendering for 1TC to Mono or Stereo and 2TC to Stereo */ if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 56b045fcb..bec46053e 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -412,11 +412,7 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef FIX_1052_EXT_OUTPUT else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - else -#endif { nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); -- GitLab From a38d3788a64a9a7b790570a17c7e647def783a56 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:26:26 +0200 Subject: [PATCH 12/65] [cleanup] accept NONBE_1215_FIX_JBM_MAX_SCALING --- lib_com/options.h | 1 - lib_dec/jbm_jb4sb.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b9a02d15f..fdf817338 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ #define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index d7130a7ea..c1e728e10 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -811,15 +811,11 @@ static void JB4_adaptActivePlayout( ( dropRateMax - dropRateMin ) / dropGapMax + dropRateMin; *scale = ( 1000 - rate ) / 10; -#ifdef NONBE_1215_FIX_JBM_MAX_SCALING /* Limit max scaling to the duration of one frame. APA will not exceed this limit * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting * the value to a sensible range here avoids integer overflows at later stages when * converting maxScaling from milliseconds to samples. */ *maxScaling = JB4_MIN( currPlayoutDelay - targetMax, 1000 / IVAS_NUM_FRAMES_PER_SEC ); -#else - *maxScaling = currPlayoutDelay - targetMax; -#endif } } } @@ -835,15 +831,11 @@ static void JB4_adaptActivePlayout( currPlayoutDelay < targetMaxStretch && currPlayoutDelay < (uint32_t) ( 110 + h->rfDelay / 4 ) ) { *scale = 120; -#ifdef NONBE_1215_FIX_JBM_MAX_SCALING /* Limit max scaling to the duration of one frame. APA will not exceed this limit * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting * the value to a sensible range here avoids integer overflows at later stages when * converting maxScaling from milliseconds to samples. */ *maxScaling = JB4_MIN( targetMaxStretch - currPlayoutDelay, 1000 / IVAS_NUM_FRAMES_PER_SEC ); -#else - *maxScaling = targetMaxStretch - currPlayoutDelay; -#endif } } -- GitLab From 3c1a8b37d34f949a25108beb1f397b2cc417edb9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:27:03 +0200 Subject: [PATCH 13/65] [cleanup] accept NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index fdf817338..69ee48967 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ #define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index cf5956555..78a68a964 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1624,7 +1624,6 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( mc_mode_old == MC_MODE_MCT ) { -#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT int16_t crendInPlaceRotation = FALSE; if ( st_ivas->transport_config != intern_config_old && ( intern_config_old == IVAS_AUDIO_CONFIG_FOA || intern_config_old == IVAS_AUDIO_CONFIG_HOA2 || intern_config_old == IVAS_AUDIO_CONFIG_HOA3 ) ) @@ -1635,16 +1634,10 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_mc2sba( st_ivas->hTransSetup, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, hIntSetupOld->ambisonics_order, GAIN_LFE ); } } -#endif if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV || renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { -#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : st_ivas->hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) -#endif { return error; } -- GitLab From b5e04ae66f47d40963fb9bb397c732599972cf84 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:27:51 +0200 Subject: [PATCH 14/65] [cleanup] accept FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR --- lib_com/options.h | 1 - lib_dec/ivas_mct_dec.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 69ee48967..432ac3e29 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,6 @@ /* #################### Start BASOP porting switches ############################ */ -#define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ #define FIX_1050_EFAP_ALLOC /* FhG: issue 1050: reduction of memory allocated to EFAP handle */ diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 4fa290a8d..482d6740f 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1221,12 +1221,10 @@ static ivas_error ivas_mc_dec_reconfig( if ( st_ivas->hBinRenderer != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) ) { ivas_binRenderer_close( &st_ivas->hBinRenderer ); -#ifdef FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) { efap_free_data( &st_ivas->hEFAPdata ); } -#endif } if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hIntSetup.output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) -- GitLab From 6fdbcce92f0d084b4a3d1ae6084e2f95375259b2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:28:32 +0200 Subject: [PATCH 15/65] [cleanup] accept NONBE_FIX_MC_LFE_LPF --- lib_com/ivas_cnst.h | 3 --- lib_com/ivas_filters.c | 7 ------- lib_com/ivas_lfe_com.c | 18 ------------------ lib_com/ivas_prot.h | 4 ---- lib_com/ivas_rom_com.c | 16 ---------------- lib_com/ivas_rom_com.h | 5 ----- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 39 --------------------------------------- lib_dec/ivas_lfe_dec.c | 14 -------------- lib_dec/ivas_mct_dec.c | 36 ------------------------------------ 10 files changed, 143 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index db6f7b8e4..1477e6d7e 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1432,9 +1432,6 @@ typedef enum typedef enum { IVAS_FILTER_ORDER_1 = 1, -#ifndef NONBE_FIX_MC_LFE_LPF - IVAS_FILTER_ORDER_2 = 2, -#endif IVAS_FILTER_ORDER_4 = 4, } ivas_filter_order; diff --git a/lib_com/ivas_filters.c b/lib_com/ivas_filters.c index 82d4f5a00..8fc82f7cd 100644 --- a/lib_com/ivas_filters.c +++ b/lib_com/ivas_filters.c @@ -62,11 +62,7 @@ void ivas_filters_init( int16_t i; filter_state->order = order; -#ifdef NONBE_FIX_MC_LFE_LPF if ( order == IVAS_FILTER_ORDER_1 ) -#else - if ( order == IVAS_FILTER_ORDER_2 || order == IVAS_FILTER_ORDER_1 ) -#endif { filter_state->filt_len = order + 1; @@ -120,9 +116,6 @@ void ivas_filter_process( switch ( filter_state->order ) { case IVAS_FILTER_ORDER_1: -#ifndef NONBE_FIX_MC_LFE_LPF - case IVAS_FILTER_ORDER_2: -#endif ivas_iir_2_filter( filter_state, pIn_Out, length, IVAS_FILTER_STAGE_0 ); break; case IVAS_FILTER_ORDER_4: diff --git a/lib_com/ivas_lfe_com.c b/lib_com/ivas_lfe_com.c index af6026ae6..def09b579 100644 --- a/lib_com/ivas_lfe_com.c +++ b/lib_com/ivas_lfe_com.c @@ -60,24 +60,6 @@ void ivas_lfe_lpf_select_filt_coeff( { switch ( order ) { -#ifndef NONBE_FIX_MC_LFE_LPF - case IVAS_FILTER_ORDER_2: - switch ( sampling_rate ) - { - case 16000: - *ppFilt_coeff = ivas_lpf_2_butter_16k; - break; - case 32000: - *ppFilt_coeff = ivas_lpf_2_butter_32k; - break; - case 48000: - *ppFilt_coeff = ivas_lpf_2_butter_48k; - break; - default: - break; - } - break; -#endif case IVAS_FILTER_ORDER_4: switch ( sampling_rate ) { diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 173edfd13..776a15f7d 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5523,11 +5523,7 @@ void ivas_lfe_enc( ivas_error ivas_create_lfe_dec( LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */ const int32_t output_Fs, /* i : output sampling rate */ -#ifdef NONBE_FIX_MC_LFE_LPF const int32_t delay_ns /* i : additional LFE delay to sync other channel outputs */ -#else - const int32_t binauralization_delay_ns /* i : additional LFE delay to sync with binaural renderer */ -#endif ); void ivas_lfe_dec_close( diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 357884efd..f6ad379e4 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -3129,22 +3129,6 @@ const float ivas_lpf_4_butter_48k_sos[IVAS_BIQUAD_FILT_LEN << 2] = 1.00000000471366f, 1.f , -1.98677297369091f, 0.987060670205863f }; -#ifndef NONBE_FIX_MC_LFE_LPF -const float ivas_lpf_2_butter_16k[IVAS_BIQUAD_FILT_LEN << 1] = -{ - 0.000628720643081143f, 0.00125744128616229f, 0.000628720643081143f, 1.f, -1.92783286977036f, 0.930347752342683f -}; - -const float ivas_lpf_2_butter_32k[IVAS_BIQUAD_FILT_LEN << 1] = -{ - 0.000159990787823749f, 0.000319981575647499f, 0.000159990787823749f, 1.f, -1.96390539174033f, 0.964545354891623f -}; - -const float ivas_lpf_2_butter_48k[IVAS_BIQUAD_FILT_LEN << 1] = -{ - 7.15317998432330e-05f, 0.000143063599686466f, 7.15317998432330e-05f, 1.f, -1.97593552482925f, 0.976221652028620f -}; -#endif const ivas_lfe_freq_models ivas_str_lfe_freq_models = { diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 90816bc2c..c57d7e9ca 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -356,11 +356,6 @@ extern const int16_t Param_ISM_band_grouping[MAX_PARAM_ISM_NBANDS + 1]; extern const float ivas_lpf_4_butter_16k_sos[IVAS_BIQUAD_FILT_LEN << 2]; extern const float ivas_lpf_4_butter_32k_sos[IVAS_BIQUAD_FILT_LEN << 2]; extern const float ivas_lpf_4_butter_48k_sos[IVAS_BIQUAD_FILT_LEN << 2]; -#ifndef NONBE_FIX_MC_LFE_LPF -extern const float ivas_lpf_2_butter_16k[IVAS_BIQUAD_FILT_LEN << 1]; -extern const float ivas_lpf_2_butter_32k[IVAS_BIQUAD_FILT_LEN << 1]; -extern const float ivas_lpf_2_butter_48k[IVAS_BIQUAD_FILT_LEN << 1]; -#endif extern const float ivas_lfe_window_coeff_48k[IVAS_LFE_FADE_LEN_48K]; extern const float ivas_lfe_window_coeff_32k[IVAS_LFE_FADE_LEN_32K]; diff --git a/lib_com/options.h b/lib_com/options.h index 432ac3e29..3601be902 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ #define FIX_1050_EFAP_ALLOC /* FhG: issue 1050: reduction of memory allocated to EFAP handle */ #define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ #define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index c94849a0c..2cf86440e 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1345,11 +1345,7 @@ ivas_error ivas_init_decoder( int16_t numCldfbAnalyses, numCldfbSyntheses; int16_t granularity, n_channels_transport_jbm; int32_t output_Fs, ivas_total_brate; -#ifdef NONBE_FIX_MC_LFE_LPF int32_t delay_ns; -#else - int32_t binauralization_delay_ns; -#endif AUDIO_CONFIG output_config; DECODER_CONFIG_HANDLE hDecoderConfig; ivas_error error; @@ -2433,39 +2429,6 @@ ivas_error ivas_init_decoder( } } -#ifndef NONBE_FIX_MC_LFE_LPF - /*-----------------------------------------------------------------* - * LFE handles for rendering after rendering to adjust LFE delay to filter delay - *-----------------------------------------------------------------*/ - - if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) - { - binauralization_delay_ns = st_ivas->binaural_latency_ns; - if ( st_ivas->hBinRenderer != NULL ) - { - if ( st_ivas->hBinRenderer->render_lfe ) - { - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - /* Account for filterbank delay */ - binauralization_delay_ns += IVAS_FB_DEC_DELAY_NS; - } - } - else - { - binauralization_delay_ns = 0; - } - } - - if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, output_Fs, binauralization_delay_ns ) ) != IVAS_ERR_OK ) - { - return error; - } - - set_zero( st_ivas->hLFE->prevsynth_buf, LFE_PLC_BUFLEN ); - set_zero( st_ivas->hLFE->prior_out_buffer, L_FRAME48k ); - } -#endif /*-----------------------------------------------------------------* * CLDFB handles for rendering @@ -2503,7 +2466,6 @@ ivas_error ivas_init_decoder( ivas_spar_get_cldfb_gains( st_ivas->hSpar, st_ivas->cldfbAnaDec[0], st_ivas->cldfbSynDec[0], hDecoderConfig ); } -#ifdef NONBE_FIX_MC_LFE_LPF /*-----------------------------------------------------------------* * LFE handles for rendering after rendering to adjust LFE delay to filter delay *-----------------------------------------------------------------*/ @@ -2553,7 +2515,6 @@ ivas_error ivas_init_decoder( set_zero( st_ivas->hLFE->prevsynth_buf, LFE_PLC_BUFLEN ); set_zero( st_ivas->hLFE->prior_out_buffer, L_FRAME48k ); } -#endif /*-----------------------------------------------------------------* * Allocate and initialize limiter struct diff --git a/lib_dec/ivas_lfe_dec.c b/lib_dec/ivas_lfe_dec.c index 11b8247c6..effb2708f 100644 --- a/lib_dec/ivas_lfe_dec.c +++ b/lib_dec/ivas_lfe_dec.c @@ -252,7 +252,6 @@ static int16_t ivas_lfe_dec_dequant( } -#ifdef NONBE_FIX_MC_LFE_LPF /*------------------------------------------------------------------------- * ivas_create_lfe_lpf_dec() * @@ -271,7 +270,6 @@ static void ivas_create_lfe_lpf_dec( return; } -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_lfe_dec() @@ -371,15 +369,9 @@ void ivas_lfe_dec( *-------------------------------------------------------------------------*/ ivas_error ivas_create_lfe_dec( -#ifdef NONBE_FIX_MC_LFE_LPF LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */ const int32_t output_Fs, /* i : output sampling rate */ const int32_t delay_ns /* i : additional LFE delay to sync other channel outputs */ -#else - LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */ - const int32_t output_Fs, /* i : output sampling rate */ - const int32_t binauralization_delay_ns /* i : additional LFE delay to sync with binaural renderer */ -#endif ) { float low_pass_delay_dec_out, block_offset_s; @@ -438,7 +430,6 @@ ivas_error ivas_create_lfe_dec( block_offset_s = BLOCK_OFFSET_MS * 0.001f; filt_order = 0; low_pass_delay_dec_out = 0; -#ifdef NONBE_FIX_MC_LFE_LPF if ( ( delay_ns / 1000000000.f ) > ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] ) { filt_order = 4; @@ -449,7 +440,6 @@ ivas_error ivas_create_lfe_dec( #endif ivas_create_lfe_lpf_dec( &( hLFE->filter_state ), output_Fs ); } -#endif hLFE->filter_state.order = filt_order; #ifndef NONBE_1360_LFE_DELAY hLFE->lfe_block_delay_s = hLFE->lfe_block_delay_s + low_pass_delay_dec_out; @@ -469,11 +459,7 @@ ivas_error ivas_create_lfe_dec( lfe_addl_delay_s = max( 0.0f, lfe_addl_delay_s ); #ifndef NONBE_1360_LFE_DELAY -#ifdef NONBE_FIX_MC_LFE_LPF add_delay_sa = (int16_t) roundf( (float) delay_ns * output_Fs / 1000000000.f ); -#else - add_delay_sa = (int16_t) roundf( (float) binauralization_delay_ns * output_Fs / 1000000000.f ); -#endif hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs ) + add_delay_sa; hLFE->lfe_block_delay_s += lfe_addl_delay_s + add_delay_sa / output_Fs; #else diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 482d6740f..87e79b4af 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1124,32 +1124,19 @@ static ivas_error ivas_mc_dec_reconfig( *-----------------------------------------------------------------*/ if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hLFE == NULL ) { -#ifdef NONBE_FIX_MC_LFE_LPF int32_t delay_ns = st_ivas->binaural_latency_ns; -#else - int32_t binauralization_delay_ns = st_ivas->binaural_latency_ns; -#endif if ( st_ivas->hBinRenderer != NULL ) { if ( st_ivas->hBinRenderer->render_lfe ) { /* Account for filterbank delay */ -#ifdef NONBE_FIX_MC_LFE_LPF delay_ns += IVAS_FB_DEC_DELAY_NS; -#else - binauralization_delay_ns += IVAS_FB_DEC_DELAY_NS; -#endif } else { -#ifdef NONBE_FIX_MC_LFE_LPF delay_ns = 0; -#else - binauralization_delay_ns = 0; -#endif } } -#ifdef NONBE_FIX_MC_LFE_LPF else { if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( st_ivas->cldfbSynDec[0] != NULL ) ) @@ -1157,13 +1144,8 @@ static ivas_error ivas_mc_dec_reconfig( delay_ns += IVAS_FB_DEC_DELAY_NS; } } -#endif -#ifdef NONBE_FIX_MC_LFE_LPF if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, st_ivas->hDecoderConfig->output_Fs, delay_ns ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, st_ivas->hDecoderConfig->output_Fs, binauralization_delay_ns ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1333,7 +1315,6 @@ static ivas_error ivas_mc_dec_reconfig( if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hLFE == NULL ) #endif { -#ifdef NONBE_FIX_MC_LFE_LPF #ifdef NONBE_1360_LFE_DELAY int32_t delay_ns; if ( st_ivas->hIntSetup.index_lfe[0] != -1 ) @@ -1346,31 +1327,19 @@ static ivas_error ivas_mc_dec_reconfig( } #else int32_t delay_ns = st_ivas->binaural_latency_ns; -#endif -#else - int32_t binauralization_delay_ns = st_ivas->binaural_latency_ns; #endif if ( st_ivas->hBinRenderer != NULL ) { if ( st_ivas->hBinRenderer->render_lfe ) { /* Account for filterbank delay */ -#ifdef NONBE_FIX_MC_LFE_LPF delay_ns += IVAS_FB_DEC_DELAY_NS; -#else - binauralization_delay_ns += IVAS_FB_DEC_DELAY_NS; -#endif } else { -#ifdef NONBE_FIX_MC_LFE_LPF delay_ns = 0; -#else - binauralization_delay_ns = 0; -#endif } } -#ifdef NONBE_FIX_MC_LFE_LPF else { if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( st_ivas->cldfbSynDec[0] != NULL ) ) @@ -1378,7 +1347,6 @@ static ivas_error ivas_mc_dec_reconfig( delay_ns += IVAS_FB_DEC_DELAY_NS; } } -#endif #ifdef NONBE_1360_LFE_DELAY if ( st_ivas->hLFE != NULL ) @@ -1394,11 +1362,7 @@ static ivas_error ivas_mc_dec_reconfig( if ( st_ivas->hLFE == NULL ) { #endif -#ifdef NONBE_FIX_MC_LFE_LPF if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, st_ivas->hDecoderConfig->output_Fs, delay_ns ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, st_ivas->hDecoderConfig->output_Fs, binauralization_delay_ns ) ) != IVAS_ERR_OK ) -#endif { return error; } -- GitLab From 2a121e15dd4d77d8da98bde3a6bcf2233b0079a6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:29:36 +0200 Subject: [PATCH 16/65] [cleanup] accept FIX_1050_EFAP_ALLOC --- lib_com/ivas_cnst.h | 8 -------- lib_com/options.h | 1 - lib_dec/ivas_ism_renderer.c | 4 ---- lib_rend/ivas_efap.c | 18 ------------------ lib_rend/ivas_rom_rend.c | 2 -- lib_rend/ivas_rom_rend.h | 2 -- lib_rend/ivas_stat_rend.h | 16 ---------------- 7 files changed, 51 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 1477e6d7e..e5bff8dcb 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1463,17 +1463,9 @@ typedef enum /*----------------------------------------------------------------------------------* * Amplitude Panning (EFAP, VBAP) constants *----------------------------------------------------------------------------------*/ -#ifndef FIX_1050_EFAP_ALLOC -#define PANNING_AZI_RESOLUTION 2 -#define PANNING_ELE_RESOLUTION 5 -#endif #define EFAP_MAX_CHAN_NUM 5 /* Maximum number of channels that constitute a polygon, 4 or 5 */ -#ifdef FIX_1050_EFAP_ALLOC #define EFAP_MAX_POLY_SET 54 /* Upper bound on number of polygons; found to be 54 in the worst case for a speaker setup of 16.0 */ -#else -#define EFAP_MAX_POLY_SET 50 /* Upper bound on number of polygons; with a Speaker setup of 16.0, we obtain 44 polygons/triangles in the matlab implementation. */ -#endif #define EFAP_MODE_EFAP 0 /* EFAP Panning */ #define EFAP_MODE_EFIP 1 /* EFIP Panning */ diff --git a/lib_com/options.h b/lib_com/options.h index 3601be902..fcef5f759 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define FIX_1050_EFAP_ALLOC /* FhG: issue 1050: reduction of memory allocated to EFAP handle */ #define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ #define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index f8e25682a..95bdd1d7c 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -66,14 +66,10 @@ ivas_error ivas_ism_renderer_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer\n" ) ); } -#ifdef FIX_1050_EFAP_ALLOC if ( st_ivas->hIntSetup.is_loudspeaker_setup && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hIntSetup.ls_azimuth != NULL && st_ivas->hIntSetup.ls_elevation != NULL && st_ivas->hEFAPdata == NULL ) -#else - if ( st_ivas->hIntSetup.is_loudspeaker_setup && st_ivas->hIntSetup.ls_azimuth != NULL && st_ivas->hIntSetup.ls_elevation != NULL && st_ivas->hEFAPdata == NULL ) -#endif { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 0310efa38..2a27d1277 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -38,9 +38,7 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_prot_rend.h" -#ifdef FIX_1050_EFAP_ALLOC #include "ivas_rom_rend.h" -#endif #include "ivas_stat_dec.h" #ifdef DEBUGGING #include "debug.h" @@ -54,12 +52,10 @@ #define EFAP_MAX_SIZE_TMP_BUFF 30 #define EFAP_MAX_GHOST_LS 5 /* Maximum number of ghost Loudspeakers, for memory allocation purpose */ #define POLY_THRESH 1e-4f -#ifdef FIX_1050_EFAP_ALLOC #ifdef DEBUG_EFAP_POLY_TOFILE #define PANNING_AZI_RESOLUTION 2 #define PANNING_ELE_RESOLUTION 5 #endif -#endif /*-----------------------------------------------------------------------* @@ -156,9 +152,7 @@ ivas_error efap_init_data( ) { /* Handle instance declaration */ -#ifdef FIX_1050_EFAP_ALLOC int8_t polyset_size; -#endif EFAP *efap; ivas_error error; @@ -202,7 +196,6 @@ ivas_error efap_init_data( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferS\n" ) ); } -#ifdef FIX_1050_EFAP_ALLOC /* get upper bound of number of polygons required */ polyset_size = efap_poly_limit[num_speaker_nodes - 1]; @@ -217,7 +210,6 @@ ivas_error efap_init_data( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferS\n" ) ); } -#endif /*-----------------------------------------------------------------* @@ -362,14 +354,12 @@ void efap_free_data( free( ( *hEFAPdata )->vtxData.vtxOrder ); ( *hEFAPdata )->vtxData.vtxOrder = NULL; -#ifdef FIX_1050_EFAP_ALLOC free( ( *hEFAPdata )->polyData.polysetArray ); ( *hEFAPdata )->vtxData.vtxOrder = NULL; free( ( *hEFAPdata )->polyData.triArray ); ( *hEFAPdata )->vtxData.vtxOrder = NULL; -#endif free( ( *hEFAPdata )->bufferLong ); ( *hEFAPdata )->bufferLong = NULL; @@ -438,11 +428,7 @@ static ivas_error poly_init( if ( efap->vtxData.vertexArray[n].ele > 90.0 - 1e-6 || efap->vtxData.vertexArray[n].ele < 1e-6 - 90.0 ) { -#ifdef FIX_1050_EFAP_ALLOC efap->vtxData.vertexArray[n].isNaN = true; -#else - efap->vtxData.vertexArray[n].isNaN = 1; -#endif } } @@ -1535,11 +1521,7 @@ static void add_vertex( vtxArray[pos].idx = (int16_t) idxAziTmp + 181 * (int16_t) idxEleTmp; /* Setting the nan flag to 0 */ -#ifdef FIX_1050_EFAP_ALLOC vtxArray[pos].isNaN = false; -#else - vtxArray[pos].isNaN = 0; -#endif /* Set the default downmix type */ vtxArray[pos].dmxType = dmxType; diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 216da82a4..bf6776ab0 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -388,7 +388,6 @@ const float ivas_reverb_default_DSR[IVAS_REVERB_DEFAULT_N_BANDS] = const float ls_azimuth_CICP1[1] = { 0.0f }; const float ls_elevation_CICP1[1] = { 0.0f }; -#ifdef FIX_1050_EFAP_ALLOC /*----------------------------------------------------------------------------------* * EFAP ROM tables *----------------------------------------------------------------------------------*/ @@ -396,7 +395,6 @@ const float ls_elevation_CICP1[1] = { 0.0f }; const int8_t efap_poly_limit[MAX_OUTPUT_CHANNELS] = {22, 22, 22, 26, 30, 34, 36, 42, 42, 44, 47, 51, 52, 54, 54, 54}; -#endif /*----------------------------------------------------------------------------------* * LS Renderer ROM tables *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index 5effed437..927287ecd 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -125,7 +125,6 @@ extern const float ls_azimuth_CICP1[1]; extern const float ls_elevation_CICP1[1]; -#ifdef FIX_1050_EFAP_ALLOC /*----------------------------------------------------------------------------------* * EFAP ROM tables *----------------------------------------------------------------------------------*/ @@ -133,7 +132,6 @@ extern const float ls_elevation_CICP1[1]; extern const int8_t efap_poly_limit[MAX_OUTPUT_CHANNELS]; -#endif /*----------------------------------------------------------------------------------* * LS Configuration Converter ROM tables *----------------------------------------------------------------------------------*/ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 7ba3cbbc0..06ea39419 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -577,11 +577,7 @@ typedef struct EFAP_VERTEX float ele; /* elevation of the loudspeaker */ float pos[3]; /* [x y z] cartesian coordinate vector */ int16_t idx; /* integer, that corresponds to the first index for the LS in the 1D output */ -#ifdef FIX_1050_EFAP_ALLOC bool isNaN; /* used to indicate if the vertex is a virtual speaker */ -#else - int16_t isNaN; /* used to indicate if the vertex is a virtual speaker */ -#endif EFAP_VTX_DMX_TYPE dmxType; /* virtual speaker downmix type */ } EFAP_VERTEX; @@ -597,11 +593,7 @@ typedef struct EFAP_VERTEX_DATA typedef struct EFAP_POLYSET { int16_t chan[EFAP_MAX_CHAN_NUM]; /* An array indicating the loudspeaker index of the polygon vertices */ -#ifdef FIX_1050_EFAP_ALLOC bool isNaN[EFAP_MAX_CHAN_NUM]; /* Indicates if one of the vertices isNaN */ -#else - int16_t isNaN[EFAP_MAX_CHAN_NUM]; /* Indicates if one of the vertices isNaN */ -#endif int16_t numChan; /* An integer between 0 and EFAP_MAX_CHAN_NUM corresponding to the number of vertices of the polygon */ float polyAzi[EFAP_MAX_CHAN_NUM]; /* An array (same length as "chan"), with the azimuth of the channels */ float polyEle[EFAP_MAX_CHAN_NUM]; /* An array (same length as "chan"), with the elevation of the channels */ @@ -616,17 +608,9 @@ typedef struct EFAP_LS_TRIANGLE typedef struct EFAP_POLYSET_DATA { -#ifdef FIX_1050_EFAP_ALLOC EFAP_POLYSET *polysetArray; /* Array of polygons */ -#else - EFAP_POLYSET polysetArray[EFAP_MAX_POLY_SET]; /* Array of polygons */ -#endif int16_t numPoly; /* Number of polygons */ -#ifdef FIX_1050_EFAP_ALLOC EFAP_LS_TRIANGLE *triArray; /* Array of triangles */ -#else - EFAP_LS_TRIANGLE triArray[EFAP_MAX_POLY_SET]; /* Array of triangles */ -#endif int16_t numTri; /* Number of triangles */ } EFAP_POLYSET_DATA; -- GitLab From 9259a3eb0bd9b6db7c42b8f1a957e044e77f27f9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:30:19 +0200 Subject: [PATCH 17/65] [cleanup] accept NONBE_FIX_1052_SBA_EXT --- lib_com/ivas_prot.h | 8 -------- lib_com/ivas_sba_config.c | 2 -- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 14 -------------- lib_dec/ivas_init_dec.c | 10 ---------- lib_dec/ivas_qmetadata_dec.c | 6 ------ lib_dec/ivas_spar_decoder.c | 12 ------------ lib_dec/ivas_spar_md_dec.c | 6 ------ lib_enc/ivas_cpe_enc.c | 2 -- lib_enc/ivas_dirac_enc.c | 6 ------ lib_enc/ivas_masa_enc.c | 4 ---- lib_enc/ivas_qmetadata_enc.c | 12 ------------ lib_enc/ivas_sce_enc.c | 2 -- lib_enc/ivas_spar_encoder.c | 7 ------- lib_enc/ivas_spar_md_enc.c | 6 ------ 15 files changed, 98 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 776a15f7d..61cb556ee 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3241,9 +3241,7 @@ void ivas_qmetadata_enc_sid_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure*/ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif const int16_t ivas_format /* i : ivas format */ ); @@ -3547,12 +3545,10 @@ int16_t ivas_sba_get_nchan_metadata( const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); -#ifdef NONBE_FIX_1052_SBA_EXT /*! r: number of bits in SBA SID frame */ int16_t ivas_sba_spar_sid_bitlen( const int16_t nchan_transport /* i : number of transport channels */ ); -#endif void ivas_sba_get_spar_hoa_ch_ind( const int16_t num_md_chs, /* i : number of MD channels */ @@ -3655,9 +3651,7 @@ ivas_error ivas_dirac_enc( const int16_t input_frame, /* i : input frame length */ const int16_t dtx_vad, /* i : DTX vad flag */ const IVAS_FORMAT ivas_format, /* i : ivas format */ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif const int16_t hodirac_flag /* i : hodirac flag */ ); @@ -3715,9 +3709,7 @@ void ivas_dirac_dec_read_BS( int16_t *nb_bits, /* o : number of bits read */ const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ); diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index a324343a5..ae040fd3d 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -159,7 +159,6 @@ int16_t ivas_sba_get_nchan( } -#ifdef NONBE_FIX_1052_SBA_EXT /*-------------------------------------------------------------------* * ivas_sba_spar_sid_bitlen() * @@ -181,7 +180,6 @@ int16_t ivas_sba_spar_sid_bitlen( return num_bits; } -#endif /*-------------------------------------------------------------------* * ivas_sba_get_nchan_metadata() diff --git a/lib_com/options.h b/lib_com/options.h index fcef5f759..190de4c93 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ #define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index b9ece009a..1082fc4a1 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -973,9 +973,7 @@ void ivas_dirac_dec_read_BS( int16_t *nb_bits, /* o : number of bits read */ const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ) { @@ -1009,11 +1007,7 @@ void ivas_dirac_dec_read_BS( } } -#ifdef NONBE_FIX_1052_SBA_EXT *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT ); -#else - *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT ); -#endif for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0]; @@ -1061,11 +1055,7 @@ void ivas_dirac_dec_read_BS( next_bit_pos_orig = st->next_bit_pos; /* subtract mode signaling bits, since bitstream was moved after mode reading */ -#ifdef NONBE_FIX_1052_SBA_EXT st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS - SBA_PLANAR_BITS - SBA_ORDER_BITS ); -#else - st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); -#endif /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; @@ -1087,11 +1077,7 @@ void ivas_dirac_dec_read_BS( } -#ifdef NONBE_FIX_1052_SBA_EXT *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT ); -#else - *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT ); -#endif for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 2cf86440e..5b6ab2b45 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -54,16 +54,13 @@ static ivas_error ivas_read_format( Decoder_Struct *st_ivas, int16_t *num_bits_r static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas ); -#ifdef NONBE_FIX_1052_SBA_EXT #ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( const int16_t sba_order ); #else static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order ); #endif -#endif -#ifdef NONBE_FIX_1052_SBA_EXT #ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /*-------------------------------------------------------------------* * ivas_set_audio_config_from_sba_order() @@ -105,7 +102,6 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord return output_config; } -#endif #ifdef FIX_1209_SID_SIGNALING @@ -561,7 +557,6 @@ ivas_error ivas_dec_setup( st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; #ifndef NONBE_FIX_1052_SBA_EXT_FIX -#ifdef NONBE_FIX_1052_SBA_EXT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { #ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER @@ -571,7 +566,6 @@ ivas_error ivas_dec_setup( #endif st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); } -#endif #endif num_bits_read += SBA_ORDER_BITS; if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate && ivas_total_brate > IVAS_SID_5k2 ) @@ -821,7 +815,6 @@ ivas_error ivas_dec_setup( } #ifndef NONBE_FIX_1052_SBA_EXT_FIX -#ifdef NONBE_FIX_1052_SBA_EXT if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { #ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER @@ -831,7 +824,6 @@ ivas_error ivas_dec_setup( #endif st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); } -#endif #endif if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == SBA_FORMAT ) { @@ -1092,7 +1084,6 @@ static ivas_error ivas_read_format( if ( st_ivas->ivas_format == SBA_FORMAT ) { -#ifdef NONBE_FIX_1052_SBA_EXT /* read Ambisonic (SBA) planar flag */ st_ivas->sba_planar = st_ivas->bit_stream[*num_bits_read]; *num_bits_read += SBA_PLANAR_BITS; @@ -1101,7 +1092,6 @@ static ivas_error ivas_read_format( st_ivas->sba_order = st_ivas->bit_stream[*num_bits_read + 1]; st_ivas->sba_order += 2 * st_ivas->bit_stream[*num_bits_read]; *num_bits_read += SBA_ORDER_BITS; -#endif if ( st_ivas->sba_analysis_order == 0 ) { st_ivas->sba_analysis_order = SBA_FOA_ORDER; diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index 5880c8c35..6b4dae19d 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -1203,9 +1203,7 @@ int16_t ivas_qmetadata_dec_sid_decode( float direction_vector[3]; int16_t metadata_sid_bits; /* bits allocated to SID for metadata */ int16_t bits_delta, bits_dir; -#ifdef NONBE_FIX_1052_SBA_EXT int16_t sba_spar_bitlen; -#endif #ifdef DEBUG_MODE_QMETADATA static FILE *pF = NULL; static FILE *pF_azi = NULL; @@ -1224,12 +1222,8 @@ int16_t ivas_qmetadata_dec_sid_decode( if ( ivas_format == SBA_FORMAT ) { -#ifdef NONBE_FIX_1052_SBA_EXT sba_spar_bitlen = ivas_sba_spar_sid_bitlen( nchan_transport ); metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - sba_spar_bitlen - SID_FORMAT_NBITS - SBA_ORDER_BITS - SBA_PLANAR_BITS - 1; /* -1 for inactive mode header bit*/ -#else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 2 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ -#endif } else { diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index ae43ad1e5..b0c3755c8 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -354,11 +354,7 @@ ivas_error ivas_spar_dec( /* read DirAC bitstream */ if ( st_ivas->hQMetaData != NULL ) { -#ifdef NONBE_FIX_1052_SBA_EXT ivas_dirac_dec_read_BS( hDecoderConfig->ivas_total_brate, st0, st_ivas->hDirAC, st_ivas->hSpatParamRendCom, st_ivas->hQMetaData, nb_bits_read, last_bit_pos, ivas_get_hodirac_flag( hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ), st_ivas->nchan_transport, st_ivas->hSpar->dirac_to_spar_md_bands ); -#else - ivas_dirac_dec_read_BS( hDecoderConfig->ivas_total_brate, st0, st_ivas->hDirAC, st_ivas->hSpatParamRendCom, st_ivas->hQMetaData, nb_bits_read, last_bit_pos, ivas_get_hodirac_flag( hDecoderConfig->ivas_total_brate, st_ivas->sba_analysis_order ), st_ivas->hSpar->dirac_to_spar_md_bands ); -#endif } if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -372,11 +368,7 @@ ivas_error ivas_spar_dec( if ( !st0->bfi && hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) { -#ifdef NONBE_FIX_1052_SBA_EXT last_bit_pos -= ( SID_FORMAT_NBITS + SBA_PLANAR_BITS + SBA_ORDER_BITS ); -#else - last_bit_pos -= SID_FORMAT_NBITS; -#endif } nb_bits_read_orig = *nb_bits_read; last_bit_pos -= nb_bits_read_orig; @@ -411,11 +403,7 @@ ivas_error ivas_spar_dec( if ( !st0->bfi && hDecoderConfig->ivas_total_brate == IVAS_SID_5k2 ) { int16_t zero_pad_bits; -#ifdef NONBE_FIX_1052_SBA_EXT *nb_bits_read += SID_FORMAT_NBITS + SBA_PLANAR_BITS + SBA_ORDER_BITS; -#else - *nb_bits_read += SID_FORMAT_NBITS; -#endif zero_pad_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - *nb_bits_read; assert( zero_pad_bits <= 1 ); *nb_bits_read += zero_pad_bits; diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 638efa9fc..fea1fcf76 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -2385,9 +2385,7 @@ static void ivas_parse_parameter_bitstream_dtx( float pr_min_max[2]; int16_t pr_q_lvls, pr, pd, pd_q_lvls, pr_pd_bits; int16_t zero_pad_bits, sid_bits_len; -#ifdef NONBE_FIX_1052_SBA_EXT int16_t sba_spar_bitlen; -#endif sid_bits_len = st0->next_bit_pos; pr_min_max[0] = pSpar_md->min_max[0]; @@ -2446,12 +2444,8 @@ static void ivas_parse_parameter_bitstream_dtx( } sid_bits_len = st0->next_bit_pos - sid_bits_len; -#ifdef NONBE_FIX_1052_SBA_EXT sba_spar_bitlen = ivas_sba_spar_sid_bitlen( num_dmx_per_band[0] ); zero_pad_bits = sba_spar_bitlen - sid_bits_len; -#else - zero_pad_bits = ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - sid_bits_len; -#endif assert( zero_pad_bits >= 0 ); if ( num_dmx_per_band[0] == 2 ) { diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 50f2c5a18..ad58f156d 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -636,7 +636,6 @@ ivas_error ivas_cpe_enc( ivas_write_format_sid( ivas_format, hCPE->element_mode, sts[0]->hBstr, hEncoderConfig->sba_order, hEncoderConfig->sba_planar ); #else ivas_write_format_sid( ivas_format, hCPE->element_mode, sts[0]->hBstr ); -#ifdef NONBE_FIX_1052_SBA_EXT if ( ivas_format == SBA_FORMAT ) { /* Write SBA planar flag */ @@ -645,7 +644,6 @@ ivas_error ivas_cpe_enc( /* Write SBA order */ push_indice( sts[0]->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_order, SBA_ORDER_BITS ); } -#endif #endif } diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 28d126560..a36566b91 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -291,9 +291,7 @@ ivas_error ivas_dirac_enc( const int16_t input_frame, /* i : input frame length */ const int16_t dtx_vad, /* i : DTX vad flag */ const IVAS_FORMAT ivas_format, /* i : ivas format */ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif const int16_t hodirac_flag /* i : hodirac flag */ ) { @@ -370,11 +368,7 @@ ivas_error ivas_dirac_enc( push_next_indice( hMetaData, 1, 1 ); /* encode SID parameters */ -#ifdef NONBE_FIX_1052_SBA_EXT ivas_qmetadata_enc_sid_encode( hMetaData, hQMetaData, -1, nchan_transport, SBA_FORMAT ); -#else - ivas_qmetadata_enc_sid_encode( hMetaData, hQMetaData, -1, SBA_FORMAT ); -#endif } for ( b = hQMetaData->q_direction->cfg.start_band; b < hQMetaData->q_direction->cfg.nbands; b++ ) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 616c8894d..a59eeea7c 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -645,11 +645,7 @@ ivas_error ivas_masa_encode( free( h_orig_metadata ); -#ifdef NONBE_FIX_1052_SBA_EXT ivas_qmetadata_enc_sid_encode( hMetaData, hQMetaData, masa_sid_descriptor, 0, ivas_format ); -#else - ivas_qmetadata_enc_sid_encode( hMetaData, hQMetaData, masa_sid_descriptor, ivas_format ); -#endif /* restore old values */ hMasa->config.numCodingBands = numCodingBands; diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 72fcc943d..4a9d1a89e 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -958,9 +958,7 @@ void ivas_qmetadata_enc_sid_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure */ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif const int16_t ivas_format /* i : IVAS format */ ) { @@ -974,18 +972,12 @@ void ivas_qmetadata_enc_sid_encode( float avg_elevation[MASA_MAXIMUM_CODING_SUBBANDS]; int16_t bits_dir, bits_diff, bits_delta; int16_t metadata_sid_bits; /* bits allocated to SID for metadata */ -#ifdef NONBE_FIX_1052_SBA_EXT int16_t sba_spar_bitlen; -#endif if ( ivas_format == SBA_FORMAT ) { -#ifdef NONBE_FIX_1052_SBA_EXT sba_spar_bitlen = ivas_sba_spar_sid_bitlen( nchan_transport ); metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - sba_spar_bitlen - SID_FORMAT_NBITS - SBA_ORDER_BITS - SBA_PLANAR_BITS - 1; /* -1 for inactive mode header bit*/ -#else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 2 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ -#endif } else { @@ -1264,11 +1256,7 @@ void reset_metadata_spatial( assert( hMetaData->ind_list[0].nb_bits == 1 ); #endif hMetaData->ind_list[0].value = 1; -#ifdef NONBE_FIX_1052_SBA_EXT metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS - SBA_PLANAR_BITS - SBA_ORDER_BITS; -#else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; -#endif while ( hMetaData->nb_bits_tot < metadata_sid_bits ) { diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 1abcc780a..c54b765e7 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -234,7 +234,6 @@ ivas_error ivas_sce_enc( ivas_write_format_sid( ivas_format, IVAS_SCE, st->hBstr, st_ivas->hEncoderConfig->sba_order, st_ivas->hEncoderConfig->sba_planar ); #else ivas_write_format_sid( ivas_format, IVAS_SCE, st->hBstr ); -#ifdef NONBE_FIX_1052_SBA_EXT if ( ivas_format == SBA_FORMAT ) { /* Write SBA planar flag */ @@ -243,7 +242,6 @@ ivas_error ivas_sce_enc( /* Write SBA order */ push_indice( st->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_order, SBA_ORDER_BITS ); } -#endif #endif } diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 1e7795abf..1d0459a33 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -695,17 +695,10 @@ static ivas_error ivas_spar_enc_process( hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ); -#ifdef NONBE_FIX_1052_SBA_EXT if ( ( error = ivas_dirac_enc( st_ivas->hDirAC, hQMetaData, hMetaData, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, dtx_vad, hEncoderConfig->ivas_format, nchan_transport, hodirac_flag ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_dirac_enc( st_ivas->hDirAC, hQMetaData, hMetaData, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, dtx_vad, hEncoderConfig->ivas_format, hodirac_flag ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /* Set Energy Ratio to 0.0 if the mono flag has been set */ if ( hQMetaData->dirac_mono_flag ) diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 8304e4dd8..ca9dfdea0 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -1720,9 +1720,7 @@ static void ivas_write_parameter_bitstream_dtx( int16_t idx; float pr_min_max[2]; int16_t zero_pad_bits, sid_bits_len; -#ifdef NONBE_FIX_1052_SBA_EXT int16_t sba_spar_bitlen; -#endif sid_bits_len = hMetaData->nb_bits_tot; pr_min_max[0] = pSpar_md->min_max[0]; pr_min_max[1] = pSpar_md->min_max[1]; @@ -1778,12 +1776,8 @@ static void ivas_write_parameter_bitstream_dtx( } sid_bits_len = hMetaData->nb_bits_tot - sid_bits_len; -#ifdef NONBE_FIX_1052_SBA_EXT sba_spar_bitlen = ivas_sba_spar_sid_bitlen( num_dmx[0] ); zero_pad_bits = sba_spar_bitlen - sid_bits_len; -#else - zero_pad_bits = ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - sid_bits_len; -#endif assert( zero_pad_bits >= 0 ); if ( num_dmx[0] == 2 ) { -- GitLab From 1ad97ddbebee5456d3bec4a9e852fc0bf8dd6318 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:31:11 +0200 Subject: [PATCH 18/65] [cleanup] accept FIX_1082_INSTRUM_FAILED_LC3PLUS --- lib_com/options.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 190de4c93..6adb361f8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ -- GitLab From 195afa1fc5dd11158fb976ca8d1dc273cd138e65 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:31:50 +0200 Subject: [PATCH 19/65] [cleanup] accept NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 10 ---------- lib_dec/ivas_masa_dec.c | 13 ------------- lib_enc/ivas_masa_enc.c | 27 --------------------------- 4 files changed, 51 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6adb361f8..6da239e90 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 5b6ab2b45..998ed7e22 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -600,7 +600,6 @@ ivas_error ivas_dec_setup( if ( st_ivas->nchan_ism > 0 ) { -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ /* info about the number of objects: '00' - MASA format at the encoder @@ -615,15 +614,6 @@ ivas_error ivas_dec_setup( st_ivas->nchan_ism = 1; } /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 and the corresponding bit is not used here*/ -#else - /* the input_ivas_format should be MASA_ISM_FORMAT, but we cannot initialize it now */ - if ( st_ivas->nchan_transport == 2 && st_ivas->nchan_ism == 3 ) - { - st_ivas->nchan_ism = 4; - } - - /* for MASA_ISM_FORMAT at input the number of MASA transport channels is always 2 */ -#endif st_ivas->nchan_transport = 2; element_mode_flag = 1; } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 07bafa790..ee6f4a487 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -151,7 +151,6 @@ ivas_error ivas_masa_decode( { if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR if ( ivas_format == MASA_FORMAT ) { /* re-read the number of objects, needed in case of bad frame */ @@ -196,7 +195,6 @@ ivas_error ivas_masa_decode( } else { -#endif if ( ivas_format != MASA_ISM_FORMAT ) { /* number of transport channels is always 2 for MASA_ISM format */ @@ -296,15 +294,6 @@ ivas_error ivas_masa_decode( } -#ifndef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR - /* read 2 bits: - '00' - MASA format at the encoder - '01' - MASA_ISM_FORMAT at the encoder, with 1 object - '10' - MASA_ISM_FORMAT at the encoder, with 2 objects - '11' - MASA_ISM_FORMAT at the encoder, with 3 or 4 objects - reading if 3 or 4 object is performed later - */ -#endif byteBuffer = st->bit_stream[( st->next_bit_pos )--]; byteBuffer = byteBuffer + 2 * st->bit_stream[( st->next_bit_pos )--]; @@ -322,9 +311,7 @@ ivas_error ivas_masa_decode( byteBuffer = st->bit_stream[( st->next_bit_pos )--]; ( *nb_bits_read )++; hMasa->config.numberOfDirections = (uint8_t) ( byteBuffer + 1 ); -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR } -#endif } else { diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index a59eeea7c..a88cff3a4 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -438,7 +438,6 @@ ivas_error ivas_masa_encode( { if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* use the MASA number of transport channels bit to signal if there are 1 or 2 objects */ if ( nchan_ism == 1 || nchan_ism == 2 ) { @@ -449,17 +448,6 @@ ivas_error ivas_masa_encode( /* for 3 or 4 objects write already the number of MASA directions */ push_next_indice( hMetaData, hQMetaData->no_directions - 1, MASA_TRANSP_BITS ); } -#else - /* use the MASA number of transport channels bit to signal if there are 3 or 4 objects */ - if ( nchan_ism == 4 ) - { - push_next_indice( hMetaData, 1, MASA_TRANSP_BITS ); - } - else - { - push_next_indice( hMetaData, 0, MASA_TRANSP_BITS ); - } -#endif } else { @@ -471,7 +459,6 @@ ivas_error ivas_masa_encode( if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR if ( nchan_ism >= 3 ) /* if 3 or 4 objects */ { push_next_indice( hMetaData, 5 - nchan_ism, MASA_HEADER_BITS ); @@ -480,16 +467,6 @@ ivas_error ivas_masa_encode( { push_next_indice( hMetaData, 3, MASA_HEADER_BITS ); } -#else - if ( nchan_ism <= 3 ) - { - push_next_indice( hMetaData, nchan_ism, MASA_HEADER_BITS ); - } - else - { - push_next_indice( hMetaData, nchan_ism - 1, MASA_HEADER_BITS ); - } -#endif hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; } else @@ -499,16 +476,12 @@ ivas_error ivas_masa_encode( push_next_indice( hMetaData, 0, MASA_HEADER_BITS ); hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; } -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR if ( !( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE && nchan_ism > 2 ) ) { -#endif /* write number of directions */ push_next_indice( hMetaData, hQMetaData->no_directions - 1, 1 ); hQMetaData->metadata_max_bits -= 1; -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR } -#endif /* write subframe mode */ push_next_indice( hMetaData, hQMetaData->q_direction[0].cfg.nblocks == 1 ? 1 : 0, MASA_SUBFRAME_BITS ); -- GitLab From 8d653774f762c40738c25cd2565d2d66bf70c3a3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:32:58 +0200 Subject: [PATCH 20/65] [cleanup] accept FIX_1222_OMASA_DEC_CHANNEL_BUFFERS --- lib_com/options.h | 1 - lib_dec/ivas_masa_dec.c | 4 ---- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 ---- lib_rend/ivas_output_init.c | 8 -------- 4 files changed, 17 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6da239e90..57f77fc59 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ #define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index ee6f4a487..fb05774b9 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1494,11 +1494,7 @@ ivas_error ivas_masa_dec_reconfigure( { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } else { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 74fde0dfc..887e9ca63 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -336,11 +336,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( nchan_to_allocate = 2 * BINAURAL_CHANNELS; if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } n_samples_granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index bec46053e..81ee0b5c8 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -289,12 +289,6 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifndef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); - } -#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); @@ -352,12 +346,10 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { nchan_out_buff = max( nchan_out_buff, BINAURAL_CHANNELS + st_ivas->nchan_ism ); } -#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); -- GitLab From 34fbaf41e488c8b829d093c5aa33dd31d19ed4af Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:33:31 +0200 Subject: [PATCH 21/65] [cleanup] accept FIX_1111_TDM_LSP_BUFFER --- lib_com/ivas_stereo_td_bit_alloc.c | 14 -------------- lib_com/options.h | 1 - lib_enc/ivas_core_enc.c | 8 -------- 3 files changed, 23 deletions(-) diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 26d410b22..456e8261d 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -459,19 +459,14 @@ void td_stereo_param_updt( { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC -#ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); } -#else - lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); -#endif #endif } else if ( flag_ACELP16k == 1 ) { -#ifdef FIX_1111_TDM_LSP_BUFFER #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( tdm_lspQ_PCh != NULL ) { @@ -488,24 +483,15 @@ void td_stereo_param_updt( lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC } -#endif -#else - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); - lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); #endif } else { #ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC -#ifdef FIX_1111_TDM_LSP_BUFFER if ( tdm_lspQ_PCh != NULL ) { mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); } -#else - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); -#endif #endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } diff --git a/lib_com/options.h b/lib_com/options.h index 57f77fc59..283c3d478 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ #define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ #define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ #define NONBE_FIX_1130_DIV_ZERO_LEV_DUR /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */ diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 060b85a1d..cb356e8ba 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -104,11 +104,7 @@ ivas_error ivas_core_enc( int16_t Voicing_flag[CPE_CHANNELS]; float pitch_buf[CPE_CHANNELS][NB_SUBFR16k]; int16_t unbits[CPE_CHANNELS]; -#ifdef FIX_1111_TDM_LSP_BUFFER float tdm_lsfQ_PCh[M]; -#else - float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; -#endif int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; int16_t diff_nBits; @@ -280,14 +276,10 @@ ivas_error ivas_core_enc( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { -#ifdef FIX_1111_TDM_LSP_BUFFER #ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); #else td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); #endif } } -- GitLab From df3612fee344aa89513e35bf958f41d34f7e0ddc Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:34:24 +0200 Subject: [PATCH 22/65] [cleanup] accept FIX_1157_OBSOLETE_DMX_TABLE --- lib_com/ivas_rom_com.c | 9 --------- lib_com/options.h | 1 - 2 files changed, 10 deletions(-) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index f6ad379e4..46a2e82ec 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1876,15 +1876,6 @@ const float ivas_param_mc_dmx_fac_CICP19_3tc[36] = 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f /*Ct*/ }; -#ifndef FIX_1157_OBSOLETE_DMX_TABLE -const float ivas_param_mc_dmx_fac_CICP19_4tc[48] = -{ - 1.0f, 0.0f, INV_SQRT2, INV_SQRT2, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*Lht*/ - 0.0f, 1.0f, INV_SQRT2, INV_SQRT2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*Rht*/ - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*Lut*/ - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, /*Rut*/ -}; -#endif /* Coefficient for Parametric MC ILD factorization */ const float ivas_param_mc_ild_fac_CICP6_2tc[6] = diff --git a/lib_com/options.h b/lib_com/options.h index 283c3d478..147da388d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ #define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ #define NONBE_FIX_1130_DIV_ZERO_LEV_DUR /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */ #define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ -- GitLab From 063c3be1e02feb3995694a39e6c9bb9d482a6ffe Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:35:00 +0200 Subject: [PATCH 23/65] [cleanup] accept NONBE_1325_TD_STEREO_QUANT_LSF_SEC --- lib_com/bits_alloc.c | 7 ------- lib_com/ivas_prot.h | 3 --- lib_com/ivas_stereo_td_bit_alloc.c | 28 ---------------------------- lib_com/options.h | 1 - lib_com/prot.h | 6 ------ lib_dec/acelp_core_dec.c | 23 ----------------------- lib_dec/acelp_core_switch_dec.c | 4 ---- lib_dec/evs_dec.c | 4 ---- lib_dec/gs_dec.c | 4 ---- lib_dec/init_dec.c | 4 ---- lib_dec/ivas_core_dec.c | 12 ------------ lib_dec/ivas_cpe_dec.c | 6 ------ lib_enc/acelp_core_enc.c | 19 ------------------- lib_enc/acelp_core_switch_enc.c | 4 ---- lib_enc/ivas_core_enc.c | 4 ---- lib_enc/transition_enc.c | 8 -------- 16 files changed, 137 deletions(-) diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index f4c7d5b8d..36161a6f5 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -552,9 +552,6 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const int16_t active_cnt, /* i : Active frame counter */ -#endif const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ @@ -772,11 +769,7 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) -#else - else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) -#endif { bits -= TDM_IC_LSF_PRED_BITS; } diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 61cb556ee..b640a8a5d 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -2126,9 +2126,6 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ -#endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 456e8261d..72eddca8f 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -443,9 +443,6 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ -#endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ @@ -458,41 +455,16 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( tdm_lspQ_PCh != NULL ) - { - lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); - } -#endif } else if ( flag_ACELP16k == 1 ) { -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( tdm_lspQ_PCh != NULL ) - { - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); - lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); - } - else - { -#endif float lsp_temp[M]; mvr2r( lsp_old_PCh, lsp_temp, M ); lsp_convert_poly( lsp_temp, L_FRAME, 0 ); lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } -#endif } else { -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( tdm_lspQ_PCh != NULL ) - { - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - } -#endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } diff --git a/lib_com/options.h b/lib_com/options.h index 147da388d..a4a8e5704 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ #define NONBE_FIX_1130_DIV_ZERO_LEV_DUR /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */ #define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ #define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 5ad14bf89..6d3e44931 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4507,9 +4507,6 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ const int16_t last_element_mode, /* i : last element mode */ @@ -9071,9 +9068,6 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel*/ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const int16_t idchan, /* i : channel id */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const int16_t active_cnt, /* i : Active frame counter */ -#endif const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 159702cfc..c5f862aee 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -67,9 +67,6 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ const int16_t last_element_mode, /* i : last element mode */ @@ -615,19 +612,11 @@ ivas_error acelp_core_dec( nb_bits = -1; } -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } } @@ -664,22 +653,10 @@ ivas_error acelp_core_dec( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( st->active_cnt != 1 ) - { -#endif int16_t beta_index; beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } - else - { - mvr2r( tdm_lspQ_PCh, lsp_new, M ); - mvr2r( tdm_lsfQ_PCh, lsf_new, M ); - } -#endif if ( st->rate_switching_reset ) { diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index 762de6e65..50b70ad1a 100644 --- a/lib_dec/acelp_core_switch_dec.c +++ b/lib_dec/acelp_core_switch_dec.c @@ -158,11 +158,7 @@ ivas_error acelp_core_switch_dec( * Excitation decoding *----------------------------------------------------------------*/ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#else - config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, st->active_cnt, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#endif decod_gen_voic_core_switch( st, L_frame_for_cs, 0, Aq, exc, cbrate ); diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index e3bdde2f5..464437d75 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -259,11 +259,7 @@ ivas_error evs_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 2902b4dab..693631cf3 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -111,11 +111,7 @@ void decod_audio( } /* set bit-allocation */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /*---------------------------------------------------------------* * Decode energy dynamics diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 7d0ca6dac..c2582a22d 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -293,11 +293,7 @@ ivas_error init_decoder( st->last_vad = 0; st->last_active_brate = ACELP_7k20; st->last_CNG_L_frame = L_FRAME; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC st->active_cnt = CNG_TYPE_HO; -#else - st->active_cnt = 20; -#endif if ( idchan == 0 && ( st->element_mode == EVS_MONO || st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) ) { diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 9a63526b9..9c146d5a5 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -83,11 +83,7 @@ ivas_error ivas_core_dec( int16_t unbits[CPE_CHANNELS]; int16_t sid_bw[CPE_CHANNELS]; FRAME_MODE frameMode[CPE_CHANNELS]; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lsfQ_PCh[M]; -#else - float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; -#endif int16_t tdm_LRTD_flag; int32_t element_brate, output_Fs; int32_t last_element_brate; @@ -352,11 +348,7 @@ ivas_error ivas_core_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hCPE == NULL ? NULL : hCPE->hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hCPE == NULL ? NULL : hCPE->hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -380,11 +372,7 @@ ivas_error ivas_core_dec( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif } } /* n_channels loop */ diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 87c480402..ebc295cb7 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -375,23 +375,17 @@ ivas_error ivas_cpe_dec( if ( sts[1] != NULL ) { sts[1]->active_cnt = 0; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( sts[1]->ini_frame == 0 ) { sts[1]->active_cnt = CNG_TYPE_HO; } -#endif } } else { sts[n]->VAD = 1; sts[n]->active_cnt++; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC sts[n]->active_cnt = min( sts[n]->active_cnt, 200 ); -#else - sts[n]->active_cnt = min( sts[n]->active_cnt, 100 ); -#endif } /* set CNA flag */ diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 2d57baa82..40fc8a601 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -375,11 +375,7 @@ ivas_error acelp_core_enc( if ( !nelp_mode && !ppp_mode ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*-----------------------------------------------------------------* @@ -419,10 +415,6 @@ ivas_error acelp_core_enc( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( st->active_cnt != 1 ) - { -#endif int16_t beta_index; float lsf_wgts[M]; @@ -431,9 +423,6 @@ ivas_error acelp_core_enc( Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } -#endif pt_interp_2 = interpol_frac_12k8; if ( tdm_low_rate_mode == 1 && st->coder_type > UNVOICED ) @@ -498,11 +487,7 @@ ivas_error acelp_core_enc( { tc_classif_enc( st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res ); -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*---------------------------------------------------------------* @@ -560,11 +545,7 @@ ivas_error acelp_core_enc( lsf_syn_mem_restore( st, tilt_code_bck, gc_threshold_bck, clip_var_bck, next_force_sf_bck, lsp_new, lsp_mid, clip_var, mem_AR, mem_MA, lsp_new_bck, lsp_mid_bck, Bin_E, Bin_E_old, mem_syn_bck, mem_w0_bck, streaklimit, pstreaklen ); /* Configure ACELP bit allocation */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /* redo LSF quantization */ lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL ); diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index 1b5f2f860..07717c609 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -132,11 +132,7 @@ void acelp_core_switch_enc( * Excitation encoding *----------------------------------------------------------------*/ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#endif encod_gen_voic_core_switch( st, st->last_L_frame, inp, Aq, A, T_op, st->voicing, exc, cbrate ); diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index cb356e8ba..483387cb3 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -276,11 +276,7 @@ ivas_error ivas_core_enc( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif } } diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index 804e9c0a4..cf05b43a1 100644 --- a/lib_enc/transition_enc.c +++ b/lib_enc/transition_enc.c @@ -178,11 +178,7 @@ void transition_enc( if ( *tc_subfr == TC_0_0 ) { /* this is called only to compute unused bits */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } *clip_gain = gp_clip( st->element_mode, st->core_brate, st->voicing, i_subfr, TRANSITION, xn, gp_cl ); @@ -278,11 +274,7 @@ void transition_enc( if ( i_subfr - *tc_subfr <= L_SUBFR ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } /*-----------------------------------------------------------------* -- GitLab From 7c5ff854b8cdf52350ed8339f2400a2a5b57c3b9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:35:34 +0200 Subject: [PATCH 24/65] [cleanup] accept NONBE_FIX_1130_DIV_ZERO_LEV_DUR --- lib_com/options.h | 1 - lib_enc/swb_tbe_enc.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a4a8e5704..560c5af28 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_FIX_1130_DIV_ZERO_LEV_DUR /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */ #define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ #define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ #define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index ff13c4cd3..b1363db10 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -281,13 +281,11 @@ void wb_tbe_enc( autocorr( hb_old_speech, R, LPC_SHB_ORDER_WB + 1, ( NS2SA( INT_FS_12k8, 5000000L ) + L_SUBFR + L_FRAME ) * 5 / 16, win_lpc_hb_wb, 0, 1, 1 ); -#ifdef NONBE_FIX_1130_DIV_ZERO_LEV_DUR if ( st->element_mode > EVS_MONO ) { /* Ensure R[0] isn't zero when entering Levinson-Durbin */ R[0] = max( R[0], 1.0e-8f ); } -#endif lev_dur( lpc_wb_temp, R, LPC_SHB_ORDER_WB, ervec_temp ); a2lsp( lsp_wb_temp, lpc_wb_temp, LPC_SHB_ORDER_WB ); -- GitLab From 935c16c2cc88e8134873d8f5e803e652cf6d3f89 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:36:12 +0200 Subject: [PATCH 25/65] [cleanup] accept NONBE_1329_FIX_OSBA_CRASH --- lib_com/options.h | 1 - lib_enc/ivas_stereo_mdct_stereo_enc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 560c5af28..6680325d2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ #define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ #define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc.c b/lib_enc/ivas_stereo_mdct_stereo_enc.c index 4fa7dc15b..e3ff04f86 100644 --- a/lib_enc/ivas_stereo_mdct_stereo_enc.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc.c @@ -411,7 +411,6 @@ void stereo_coder_tcx( nAvailBitsMS[k] = ( ( mct_on ? 2 * sts[0]->bits_frame_channel : sts[0]->bits_frame_nominal ) - sts[0]->side_bits_frame_channel - sts[1]->side_bits_frame_channel - ( nSubframes == 2 ? OFFSET_BITS_TCX10 : OFFSET_BITS_TCX20 ) ) / nSubframes; -#ifdef NONBE_1329_FIX_OSBA_CRASH if ( mct_on && nAvailBitsMS[k] <= 0 ) /*Force M/S when bit-budget is low for MCT*/ { hStereoMdct->mdct_stereo_mode[k] = 1; @@ -420,7 +419,6 @@ void stereo_coder_tcx( } else { -#endif MsStereoDecision( sfbConf, sts[0]->hTcxEnc->spectrum[k], sts[1]->hTcxEnc->spectrum[k], inv_spectrum[0][k], inv_spectrum[1][k], &hStereoMdct->mdct_stereo_mode[k], &ms_mask[k][0], nAvailBitsMS[k] ); if ( sts[0]->igf ) @@ -432,9 +430,7 @@ void stereo_coder_tcx( { hStereoMdct->IGFStereoMode[k] = hStereoMdct->mdct_stereo_mode[k]; } -#ifdef NONBE_1329_FIX_OSBA_CRASH } -#endif if ( hStereoMdct->mdct_stereo_mode[k] != SMDCT_DUAL_MONO || hStereoMdct->IGFStereoMode[k] != SMDCT_DUAL_MONO ) { -- GitLab From 4106b421e307ff35416c264b31d5b8459a9d98f6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:36:54 +0200 Subject: [PATCH 26/65] [cleanup] accept NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 36 ------------------------------------ lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 41 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6680325d2..93712e068 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ #define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_745_FIX_DATA_TYPE_CONVERSION /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 998ed7e22..bbcd66eb0 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -54,14 +54,9 @@ static ivas_error ivas_read_format( Decoder_Struct *st_ivas, int16_t *num_bits_r static ivas_error doSanityChecks_IVAS( Decoder_Struct *st_ivas ); -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( const int16_t sba_order ); -#else -static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order ); -#endif -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /*-------------------------------------------------------------------* * ivas_set_audio_config_from_sba_order() * @@ -72,9 +67,6 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( const int16_t sba_order /* i : Ambisonic (SBA) order */ ) -#else -static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order ) -#endif { AUDIO_CONFIG output_config; @@ -92,12 +84,8 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord output_config = IVAS_AUDIO_CONFIG_HOA3; break; default: -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER output_config = IVAS_AUDIO_CONFIG_INVALID; break; -#else - assert( 0 ); -#endif } return output_config; @@ -559,11 +547,7 @@ ivas_error ivas_dec_setup( #ifndef NONBE_FIX_1052_SBA_EXT_FIX if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER st_ivas->hDecoderConfig->output_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); -#else - st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order ); -#endif st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); } #endif @@ -807,11 +791,7 @@ ivas_error ivas_dec_setup( #ifndef NONBE_FIX_1052_SBA_EXT_FIX if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER st_ivas->hDecoderConfig->output_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); -#else - st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order ); -#endif st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); } #endif @@ -1361,11 +1341,7 @@ ivas_error ivas_init_decoder( else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) #endif { -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER hDecoderConfig->nchan_out = audioCfg2channels( ivas_set_audio_config_from_sba_order( st_ivas->sba_order ) ); -#else - hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); -#endif hDecoderConfig->nchan_out += st_ivas->nchan_ism; } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) @@ -1391,7 +1367,6 @@ ivas_error ivas_init_decoder( ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->transport_config ); st_ivas->intern_config = st_ivas->transport_config; } -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER #ifdef NONBE_FIX_1052_SBA_EXT_FIX else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) ) #else @@ -1401,7 +1376,6 @@ ivas_error ivas_init_decoder( st_ivas->intern_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->intern_config ); } -#endif else { ivas_output_init( &( st_ivas->hOutSetup ), output_config ); @@ -1415,16 +1389,6 @@ ivas_error ivas_init_decoder( st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( st_ivas->intern_config ); } -#ifndef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - st_ivas->hOutSetup.ambisonics_order = SBA_HOA3_ORDER; - st_ivas->intern_config = IVAS_AUDIO_CONFIG_HOA3; - st_ivas->hOutSetup.output_config = IVAS_AUDIO_CONFIG_HOA3; - st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); - } - -#endif /* Only initialize transport setup if it is used */ if ( st_ivas->transport_config != IVAS_AUDIO_CONFIG_INVALID ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index e2d1d8955..94655acf1 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -344,11 +344,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_FOA; } -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#endif { *internal_config = IVAS_AUDIO_CONFIG_HOA3; } -- GitLab From 4ae63946e6a8218062c25a4e1d1e137b9612ff6e Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:37:29 +0200 Subject: [PATCH 27/65] [cleanup] accept FIX_1138_SBA_EXT_ERROR_PRINTOUT --- lib_com/options.h | 1 - lib_rend/ivas_output_init.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 93712e068..f42d5d411 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_745_FIX_DATA_TYPE_CONVERSION /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 81ee0b5c8..0e3abb08e 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -305,11 +305,7 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef FIX_1138_SBA_EXT_ERROR_PRINTOUT else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - else -#endif { nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); -- GitLab From e5ccd353164bc062b183e186fbc221f3cd5f4807 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:38:21 +0200 Subject: [PATCH 28/65] [cleanup] accept NONBE_1244_FIX_SWB_BWE_MEMORY --- lib_com/options.h | 1 - lib_enc/swb_pre_proc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f42d5d411..ab8c4dd48 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,6 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_745_FIX_DATA_TYPE_CONVERSION /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ diff --git a/lib_enc/swb_pre_proc.c b/lib_enc/swb_pre_proc.c index 921e68bd2..27e58927d 100644 --- a/lib_enc/swb_pre_proc.c +++ b/lib_enc/swb_pre_proc.c @@ -442,11 +442,7 @@ void swb_pre_proc( if ( st->last_extl != SWB_BWE && st->last_extl != FB_BWE ) { /* resample 48 kHz to 32kHz */ -#ifdef NONBE_1244_FIX_SWB_BWE_MEMORY if ( ( st->last_bwidth == FB && st->element_mode == EVS_MONO ) || ( st->bwidth == FB && st->element_mode > EVS_MONO ) ) // note: once EVS i CR fixed, the condition will simplify to "if ( st->bwidth == FB )" only -#else - if ( st->last_bwidth == FB ) -#endif { inner_frame = L_FRAME48k; inner_Fs = 48000; -- GitLab From 1c9db51f95d8fca4be1e20ceed2f14b483953558 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:40:07 +0200 Subject: [PATCH 29/65] Revert "[cleanup] accept NONBE_1244_FIX_SWB_BWE_MEMORY" This reverts commit e5ccd353164bc062b183e186fbc221f3cd5f4807. --- lib_com/options.h | 1 + lib_enc/swb_pre_proc.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index ab8c4dd48..f42d5d411 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,6 +157,7 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ +#define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_745_FIX_DATA_TYPE_CONVERSION /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ diff --git a/lib_enc/swb_pre_proc.c b/lib_enc/swb_pre_proc.c index 27e58927d..921e68bd2 100644 --- a/lib_enc/swb_pre_proc.c +++ b/lib_enc/swb_pre_proc.c @@ -442,7 +442,11 @@ void swb_pre_proc( if ( st->last_extl != SWB_BWE && st->last_extl != FB_BWE ) { /* resample 48 kHz to 32kHz */ +#ifdef NONBE_1244_FIX_SWB_BWE_MEMORY if ( ( st->last_bwidth == FB && st->element_mode == EVS_MONO ) || ( st->bwidth == FB && st->element_mode > EVS_MONO ) ) // note: once EVS i CR fixed, the condition will simplify to "if ( st->bwidth == FB )" only +#else + if ( st->last_bwidth == FB ) +#endif { inner_frame = L_FRAME48k; inner_Fs = 48000; -- GitLab From db12a8ab87e4adf93fd8702ff3e10a9b40181f30 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:41:04 +0200 Subject: [PATCH 30/65] [cleanup] accept FIX_745_FIX_DATA_TYPE_CONVERSION --- apps/decoder.c | 48 ----------------------------------------------- lib_com/options.h | 1 - lib_dec/lib_dec.c | 44 ------------------------------------------- lib_dec/lib_dec.h | 19 ------------------- 4 files changed, 112 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 98628492f..3f339d8a7 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -128,11 +128,7 @@ typedef struct bool customLsOutputEnabled; char *customLsSetupFilename; int16_t orientation_tracking; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION bool non_diegetic_pan_enabled; -#else - int16_t Opt_non_diegetic_pan; -#endif float non_diegetic_pan_gain; bool renderConfigEnabled; char *renderConfigFilename; @@ -152,11 +148,7 @@ typedef struct #endif #endif AcousticEnvironmentSequence aeSequence; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION bool dpidEnabled; -#else - int16_t Opt_dpid_on; -#endif uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; } DecArguments; @@ -420,12 +412,7 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false ) -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && - arg.Opt_non_diegetic_pan == 0 ) -#endif { fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -446,13 +433,8 @@ int main( asked_frame_size = arg.renderFramesize; uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, - arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -625,13 +607,7 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false ) -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && - arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && - arg.Opt_non_diegetic_pan == 0 ) -#endif { fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" ); goto cleanup; @@ -1121,20 +1097,12 @@ static bool parseCmdlIVAS_dec( arg->renderConfigEnabled = false; arg->renderConfigFilename = NULL; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->dpidEnabled = false; -#else - arg->Opt_dpid_on = 0; -#endif arg->outputMdFilename = NULL; arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->non_diegetic_pan_enabled = false; -#else - arg->Opt_non_diegetic_pan = 0; -#endif arg->non_diegetic_pan_gain = 0.f; arg->tsmEnabled = false; arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; @@ -1473,11 +1441,7 @@ static bool parseCmdlIVAS_dec( else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 ) { i++; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->non_diegetic_pan_enabled = true; -#else - arg->Opt_non_diegetic_pan = 1; -#endif strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; to_upper( argv_to_upper ); @@ -1615,11 +1579,7 @@ static bool parseCmdlIVAS_dec( { int16_t id, tmp; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->dpidEnabled = true; -#else - arg->Opt_dpid_on = 1; -#endif ++i; tmp = 0; while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS ) @@ -1700,11 +1660,7 @@ static bool parseCmdlIVAS_dec( } i++; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( arg->non_diegetic_pan_enabled && arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) -#else - if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) ) -#endif { fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" ); usage_dec(); @@ -1722,11 +1678,7 @@ static bool parseCmdlIVAS_dec( arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_EVS; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( arg->non_diegetic_pan_enabled ) -#else - if ( ( arg->Opt_non_diegetic_pan ) ) -#endif { arg->outputConfig = IVAS_AUDIO_CONFIG_STEREO; } diff --git a/lib_com/options.h b/lib_com/options.h index f42d5d411..c326b28f0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define FIX_745_FIX_DATA_TYPE_CONVERSION /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index c0b4c39ca..027d997d2 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -400,7 +400,6 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Configure( -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ @@ -417,24 +416,6 @@ ivas_error IVAS_DEC_Configure( const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ const bool delayCompensationEnabled /* i : enable delay compensation */ -#else - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const uint32_t sampleRate, /* i : output sampling frequency */ - const IVAS_AUDIO_CONFIG outputConfig, /* i : audio configuration */ - const int16_t tsmEnabled, /* i : enable TSM */ - const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ - const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ - const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ - const int16_t enableExternalOrientation, /* i : enable external orientations */ - const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ - const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ - const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ - const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ - const int16_t Opt_dpid_on, /* i : enable directivity pattern option */ - const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ - const int16_t delayCompensationEnabled /* i : enable delay compensation */ -#endif ) { Decoder_Struct *st_ivas; @@ -451,13 +432,8 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == IVAS_AUDIO_CONFIG_MONO && !non_diegetic_pan_enabled ) || ( outputConfig == IVAS_AUDIO_CONFIG_STEREO && non_diegetic_pan_enabled ) ) ) -#else - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == IVAS_AUDIO_CONFIG_MONO && Opt_non_diegetic_pan == 0 ) || - ( outputConfig == IVAS_AUDIO_CONFIG_STEREO && Opt_non_diegetic_pan == 1 ) ) ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -485,37 +461,17 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); } -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_tsm = (int16_t) tsmEnabled; hDecoderConfig->Opt_LsCustom = (int16_t) customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = (int16_t) enableHeadRotation; -#else - hDecoderConfig->Opt_tsm = tsmEnabled; - hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; - hDecoderConfig->Opt_Headrotation = enableHeadRotation; -#endif hDecoderConfig->orientation_tracking = orientation_tracking; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_HRTF_binary = (int16_t) hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = (int16_t) renderConfigEnabled; hDecoderConfig->Opt_non_diegetic_pan = (int16_t) non_diegetic_pan_enabled; -#else - hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; - hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled; - hDecoderConfig->Opt_non_diegetic_pan = Opt_non_diegetic_pan; -#endif hDecoderConfig->non_diegetic_pan_gain = non_diegetic_pan_gain; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_delay_comp = (int16_t) delayCompensationEnabled; -#else - hDecoderConfig->Opt_delay_comp = delayCompensationEnabled; -#endif hDecoderConfig->Opt_ExternalOrientation = enableExternalOrientation; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_dpid_on = (int16_t) dpidEnabled; -#else - hDecoderConfig->Opt_dpid_on = Opt_dpid_on; -#endif hDecoderConfig->Opt_aeid_on = acousticEnvironmentId != 65535 ? TRUE : FALSE; if ( renderFramesize == IVAS_RENDER_FRAMESIZE_UNKNOWN ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 31d40bd78..205d68cda 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -118,7 +118,6 @@ ivas_error IVAS_DEC_Open( /*! r: error code */ ivas_error IVAS_DEC_Configure( -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ @@ -135,24 +134,6 @@ ivas_error IVAS_DEC_Configure( const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ const bool delayCompensationEnabled /* i : enable delay compensation */ -#else - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const uint32_t sampleRate, /* i : output sampling frequency */ - const IVAS_AUDIO_CONFIG outputConfig, /* i : audio configuration */ - const int16_t tsmEnabled, /* i : enable TSM */ - const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ - const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ - const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ - const int16_t enableExternalOrientation, /* i : enable external orientations */ - const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ - const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ - const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ - const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ - const int16_t Opt_dpid_on, /* i : enable directivity pattern option */ - const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ - const int16_t delayCompensationEnabled /* i : enable delay compensation */ -#endif ); void IVAS_DEC_Close( -- GitLab From fe705771599ce70ee0ab67a4bcdeccc7b2c23c67 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:41:43 +0200 Subject: [PATCH 31/65] [cleanup] accept NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART --- lib_com/options.h | 1 - lib_rend/ivas_dirac_dec_binaural_functions.c | 4 ---- lib_rend/lib_rend.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c326b28f0..e24834ec3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 887e9ca63..bcac78d0f 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -218,7 +218,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); @@ -233,9 +232,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); #endif } -#else - mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ if ( hDiracDecBin->hReverb != NULL && ( ( hDiracDecBin->hReverb->numBins != nBins ) || diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d417bf07a..6deec620b 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8472,7 +8472,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART if ( *inputMasa->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); @@ -8487,9 +8486,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init( pRoomAcoustics = &( hRendCfg->roomAcoustics ); #endif } -#else - mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -- GitLab From c47b320220034a6f91e73b0cbba2c98a2248c099 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:42:21 +0200 Subject: [PATCH 32/65] [cleanup] accept NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR --- lib_com/options.h | 1 - lib_enc/ivas_masa_enc.c | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e24834ec3..ca52208af 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ #define NONBE_1289_STEREO_SW_TO_MONO /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */ diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index a88cff3a4..37f13d57a 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -1766,14 +1766,7 @@ static void reduce_metadata_further( /* Copy spread coherence to the rest of subframes for the coherence coding algorithm. */ for ( sf = 1; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { -#ifdef NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[sf] = hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[0]; -#else - for ( band = 0; band < numCodingBands; band++ ) - { - hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[sf] = hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[0]; - } -#endif } /* Surround coherence is already merged through time */ -- GitLab From 44f25b9d0d508745b0773984ebec40c1e24110e5 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:42:57 +0200 Subject: [PATCH 33/65] [cleanup] accept NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC --- lib_com/ivas_prot.h | 4 ---- lib_com/options.h | 1 - lib_enc/ivas_mct_core_enc.c | 21 --------------------- lib_enc/ivas_mct_enc_mct.c | 4 ---- 4 files changed, 30 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index b640a8a5d..47f8ce3df 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3086,11 +3086,7 @@ void mctStereoIGF_enc( MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ Encoder_State **sts, /* i/o: encoder state structure */ float *orig_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : MDCT spectrum for ITF */ -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ -#else - float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ -#endif float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect. */ float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ diff --git a/lib_com/options.h b/lib_com/options.h index ca52208af..d95d28c64 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ #define NONBE_1289_STEREO_SW_TO_MONO /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */ #define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 2626cfe09..fa8c4d8b3 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -197,27 +197,17 @@ void ivas_mct_core_enc( int16_t i, cpe_id, n, nAvailBits; int16_t nCPE; float *orig_spectrum[MCT_MAX_CHANNELS][2]; /* Pointers to MDCT output for a short block (L/R) */ -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC float powerSpecMsInv_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS]; float inv_spectrum_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS]; float powerSpec_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS]; float powerSpec_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; float inv_spectrum_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */ float powerSpecMsInv_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */ -#else - float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k]; - float powerSpecMsInv_long[MCT_MAX_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */ -#endif -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC float *powerSpec[MCT_MAX_CHANNELS]; -#endif float *powerSpecMsInv[MCT_MAX_CHANNELS][2]; float *inv_mdst_spectrum[MCT_MAX_CHANNELS][2]; float *inv_spectrum[MCT_MAX_CHANNELS][2]; float *mdst_spectrum[MCT_MAX_CHANNELS][2]; -#ifndef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC - float inv_spectrum_long[MCT_MAX_CHANNELS][L_FRAME48k]; /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */ -#endif int16_t total_side_bits; int16_t chBitRatios[MCT_MAX_CHANNELS]; Encoder_State *sts[MCT_MAX_CHANNELS]; @@ -252,7 +242,6 @@ void ivas_mct_core_enc( nCPE++; } -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* point first CPE channels to longer buffers where switching from ACELP to TCX may occur in SBA with DTX (total memory saving)*/ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { @@ -264,22 +253,12 @@ void ivas_mct_core_enc( } for ( ch = CPE_CHANNELS; ch < nChannels; ch++ ) -#else - for ( ch = 0; ch < nChannels; ch++ ) -#endif { -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC inv_mdst_spectrum[ch][0] = powerSpecMsInv[ch][0] = powerSpecMsInv_long[ch - CPE_CHANNELS]; inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long[ch - CPE_CHANNELS] + N_TCX10_MAX; inv_spectrum[ch][0] = inv_spectrum_long[ch - CPE_CHANNELS]; inv_spectrum[ch][1] = inv_spectrum_long[ch - CPE_CHANNELS] + N_TCX10_MAX; powerSpec[ch] = powerSpec_long[ch - CPE_CHANNELS]; -#else - inv_mdst_spectrum[ch][0] = powerSpecMsInv[ch][0] = powerSpecMsInv_long[ch]; - inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long[ch] + N_TCX10_MAX; - inv_spectrum[ch][0] = inv_spectrum_long[ch]; - inv_spectrum[ch][1] = inv_spectrum_long[ch] + N_TCX10_MAX; -#endif } for ( cpe_id = 0, i = 0; cpe_id < nCPE; cpe_id++ ) diff --git a/lib_enc/ivas_mct_enc_mct.c b/lib_enc/ivas_mct_enc_mct.c index 8818baf67..0024e1a47 100644 --- a/lib_enc/ivas_mct_enc_mct.c +++ b/lib_enc/ivas_mct_enc_mct.c @@ -817,11 +817,7 @@ void mctStereoIGF_enc( MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ Encoder_State **sts, /* i/o: encoder state structure */ float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ -#else - float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ -#endif float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect.*/ float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ -- GitLab From d9a06fcaa74fc8db66df6ebafa3cc8f4b5a12560 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:43:31 +0200 Subject: [PATCH 34/65] [cleanup] accept NONBE_FIX_1052_SBA_EXT_FIX --- lib_com/ivas_prot.h | 4 ---- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 28 ---------------------------- lib_dec/ivas_output_config.c | 4 ---- lib_dec/ivas_spar_decoder.c | 12 ------------ lib_enc/ivas_cpe_enc.c | 12 ------------ lib_enc/ivas_init_enc.c | 6 ------ lib_enc/ivas_ism_enc.c | 4 ---- lib_enc/ivas_sce_enc.c | 12 ------------ 9 files changed, 83 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 47f8ce3df..347bed82b 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -84,13 +84,9 @@ void ivas_write_format( void ivas_write_format_sid( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t element_mode, /* i : element bitrate */ -#ifdef NONBE_FIX_1052_SBA_EXT_FIX BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int16_t sba_planar /* i : SBA planar flag */ -#else - BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ -#endif ); ivas_error create_sce_enc( diff --git a/lib_com/options.h b/lib_com/options.h index d95d28c64..4f0b6a462 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ #define NONBE_1289_STEREO_SW_TO_MONO /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */ #define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index bbcd66eb0..1f6f295f4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -544,13 +544,6 @@ ivas_error ivas_dec_setup( st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; -#ifndef NONBE_FIX_1052_SBA_EXT_FIX - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - st_ivas->hDecoderConfig->output_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); - st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); - } -#endif num_bits_read += SBA_ORDER_BITS; if ( st_ivas->ini_frame > 0 && ivas_total_brate != st_ivas->last_active_ivas_total_brate && ivas_total_brate > IVAS_SID_5k2 ) { @@ -788,13 +781,6 @@ ivas_error ivas_dec_setup( break; } -#ifndef NONBE_FIX_1052_SBA_EXT_FIX - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - st_ivas->hDecoderConfig->output_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); - st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); - } -#endif if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == SBA_FORMAT ) { int16_t nchan_transport_old, nchan_transport; @@ -1167,9 +1153,7 @@ ivas_error ivas_init_decoder_front( st_ivas->nSCE = 0; st_ivas->nCPE = 0; -#ifdef NONBE_FIX_1052_SBA_EXT_FIX st_ivas->nchan_ism = 0; -#endif st_ivas->nchan_transport = -1; st_ivas->ism_mode = ISM_MODE_NONE; @@ -1335,11 +1319,7 @@ ivas_error ivas_init_decoder( { hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->transport_config ); } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX else if ( st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) -#else - else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif { hDecoderConfig->nchan_out = audioCfg2channels( ivas_set_audio_config_from_sba_order( st_ivas->sba_order ) ); hDecoderConfig->nchan_out += st_ivas->nchan_ism; @@ -1367,11 +1347,7 @@ ivas_error ivas_init_decoder( ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->transport_config ); st_ivas->intern_config = st_ivas->transport_config; } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) ) -#else - else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif { st_ivas->intern_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->intern_config ); @@ -1575,11 +1551,7 @@ ivas_error ivas_init_decoder( return error; } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && !( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) -#else - if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) -#endif { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 94655acf1..3a7ad5bf4 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -322,15 +322,11 @@ void ivas_renderer_select( if ( ivas_format == SBA_FORMAT && ( output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO ) ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* 'internal_config' was already set in ivas_set_audio_config_from_sba_order() */ } else if ( output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_FOA ) -#else - if ( output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_FOA ) -#endif { *internal_config = output_config; } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index b0c3755c8..514965c6f 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -1557,11 +1557,7 @@ void ivas_spar_dec_upmixer_sf( } } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->ivas_total_brate < IVAS_24k4 && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) -#else - if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#endif { ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); } @@ -1571,11 +1567,7 @@ void ivas_spar_dec_upmixer_sf( md_idx = hSpar->render_to_md_map[ts + slot_idx_start]; ivas_spar_get_parameters( hSpar, hDecoderConfig, md_idx, numch_out, numch_in, num_spar_bands, mixer_mat ); -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->ivas_total_brate < IVAS_24k4 && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) -#else - if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#endif { for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) { @@ -1664,11 +1656,7 @@ void ivas_spar_dec_upmixer_sf( } } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && !( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) -#else - if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) -#endif { ivas_dirac_dec_render_sf( st_ivas, output, nchan_internal, cldfb_in_ts_re, cldfb_in_ts_im ); } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index ad58f156d..8f1e419d5 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -632,19 +632,7 @@ ivas_error ivas_cpe_enc( if ( sts[0]->core_brate == SID_2k40 ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX ivas_write_format_sid( ivas_format, hCPE->element_mode, sts[0]->hBstr, hEncoderConfig->sba_order, hEncoderConfig->sba_planar ); -#else - ivas_write_format_sid( ivas_format, hCPE->element_mode, sts[0]->hBstr ); - if ( ivas_format == SBA_FORMAT ) - { - /* Write SBA planar flag */ - push_indice( sts[0]->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_planar, SBA_PLANAR_BITS ); - - /* Write SBA order */ - push_indice( sts[0]->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_order, SBA_ORDER_BITS ); - } -#endif } /*----------------------------------------------------------------* diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 46566a543..1a5559fe0 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -138,13 +138,9 @@ void ivas_write_format( void ivas_write_format_sid( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t element_mode, /* i : element bitrate */ -#ifdef NONBE_FIX_1052_SBA_EXT_FIX BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int16_t sba_planar /* i : SBA planar flag */ -#else - BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ -#endif ) { int16_t ind = 0; /* to avoid compilation warning */ @@ -204,7 +200,6 @@ void ivas_write_format_sid( push_indice( hBstr, IND_IVAS_FORMAT, ind, SID_FORMAT_NBITS ); -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( ivas_format == SBA_FORMAT ) { /* Write SBA planar flag */ @@ -213,7 +208,6 @@ void ivas_write_format_sid( /* Write SBA order */ push_indice( hBstr, IND_SMODE, sba_order, SBA_ORDER_BITS ); } -#endif return; } diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index a69541346..3cb1d9816 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -292,11 +292,7 @@ ivas_error ivas_ism_enc( if ( sid_flag ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr, -1, -1 ); -#else - ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr ); -#endif } /*only metadata encoding is needed for this case*/ diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index c54b765e7..bac7ee783 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -230,19 +230,7 @@ ivas_error ivas_sce_enc( if ( st->core_brate == SID_2k40 ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX ivas_write_format_sid( ivas_format, IVAS_SCE, st->hBstr, st_ivas->hEncoderConfig->sba_order, st_ivas->hEncoderConfig->sba_planar ); -#else - ivas_write_format_sid( ivas_format, IVAS_SCE, st->hBstr ); - if ( ivas_format == SBA_FORMAT ) - { - /* Write SBA planar flag */ - push_indice( st->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_planar, SBA_PLANAR_BITS ); - - /* Write SBA order */ - push_indice( st->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_order, SBA_ORDER_BITS ); - } -#endif } /*----------------------------------------------------------------* -- GitLab From 42035e0cf8edd5c2c49463e502ad25a62ebfa1b6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:44:06 +0200 Subject: [PATCH 35/65] [cleanup] accept NONBE_1289_STEREO_SW_TO_MONO --- lib_com/options.h | 1 - lib_dec/ivas_stereo_switching_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4f0b6a462..2eaf20138 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_1289_STEREO_SW_TO_MONO /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */ #define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ #define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 6eeab0e24..67100a768 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -1141,11 +1141,7 @@ void synchro_synthesis( /* handling of TD->DFT switching */ for ( n = 0; n < hCPE->nchan_out; n++ ) { -#ifdef NONBE_1289_STEREO_SW_TO_MONO if ( ( !use_cldfb_for_last_dft && hCPE->last_element_mode != IVAS_CPE_DFT && !sba_dirac_stereo_flag && dft_mono_brate_switch != -1 ) || dft_mono_brate_switch == 1 ) -#else - if ( ( hCPE->last_element_mode != IVAS_CPE_DFT && !sba_dirac_stereo_flag && dft_mono_brate_switch != -1 ) || dft_mono_brate_switch == 1 ) -#endif { float *pPrev_synth; float inv_fade_len = 1.f / delay_diff; -- GitLab From debf58bbea20402e74522896679b2a06f451fb42 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:44:53 +0200 Subject: [PATCH 36/65] [cleanup] accept NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION --- lib_com/options.h | 1 - lib_dec/ivas_objectRenderer_internal.c | 4 ---- lib_rend/ivas_objectRenderer.c | 19 ------------------- lib_rend/ivas_objectRenderer_sources.c | 9 --------- lib_rend/ivas_prot_rend.h | 10 ---------- 5 files changed, 43 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 2eaf20138..65715e851 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -158,7 +158,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ #define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 8ad2b2790..f4fdefee6 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -204,11 +204,7 @@ ivas_error ivas_td_binaural_renderer_sf( /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index fd1a29368..e10770616 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -384,11 +384,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Render subframe */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -429,12 +425,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ -#endif ) { int16_t i; @@ -447,11 +438,6 @@ ivas_error TDREND_GetMix( float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; -#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - int16_t subframe_update_flag; - - subframe_update_flag = subframe_idx == ism_md_subframe_update; -#endif error = IVAS_ERR_OK; /* Clear the output buffer to accumulate rendered sources */ @@ -474,13 +460,8 @@ ivas_error TDREND_GetMix( /* Update rendering params if needed */ if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); -#else - TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, - Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_update_flag ); -#endif } /* Render source if needed */ diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 29546aff7..2b2b18ebd 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -285,13 +285,8 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_t *Src_p /* i/o: Source pointer */ ) -#else - TDREND_SRC_t *Src_p, /* i/o: Source pointer */ - const int16_t subframe_update_flag ) -#endif { TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; @@ -382,11 +377,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */ } -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( *intp_count > 0 ) ) -#else - if ( ( *intp_count > 0 ) && subframe_update_flag ) -#endif { /* Set deltas for interpolation */ v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 0675ee829..052fe997c 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -652,12 +652,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth/rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay metadata to sync with audio */ -#endif ); ivas_error TDREND_Update_listener_orientation( @@ -746,12 +741,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_t *Src_p /* i/o: Source pointer */ -#else - TDREND_SRC_t *Src_p, - const int16_t subframe_update_flag /* i : Flag to determine update subframe idx */ -#endif ); ivas_error TDREND_SRC_Alloc( -- GitLab From 0e9ba170ab6efbfcf9d7cdf005ce21fb27897a6a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:45:50 +0200 Subject: [PATCH 37/65] [cleanup] accept NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING --- lib_com/options.h | 1 - lib_dec/ivas_stereo_cng_dec.c | 2 -- lib_dec/ivas_stereo_switching_dec.c | 2 -- lib_enc/ivas_stereo_switching_enc.c | 2 -- 4 files changed, 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 65715e851..a877b134f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */ #define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */ diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 3d44edac6..2ff0c4ac3 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -923,9 +923,7 @@ void stereo_cna_update_params( } else { -#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING hFdCngDec->first_cna_noise_updated = 0; -#endif return; } diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 67100a768..a0565824a 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -1552,9 +1552,7 @@ void stereo_switching_dec( mvr2r( sts[0]->lsf_old, sts[1]->lsf_old, M ); mvr2r( sts[0]->lsp_old, sts[1]->lsp_old, M ); -#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING sts[1]->last_core_brate = sts[0]->last_core_brate; -#endif if ( hCPE->element_mode == IVAS_CPE_MDCT ) { diff --git a/lib_enc/ivas_stereo_switching_enc.c b/lib_enc/ivas_stereo_switching_enc.c index cc1f0b643..27a17e048 100644 --- a/lib_enc/ivas_stereo_switching_enc.c +++ b/lib_enc/ivas_stereo_switching_enc.c @@ -801,9 +801,7 @@ void stereo_switching_enc( mvr2r( sts[0]->lsf_old1, sts[1]->lsf_old1, M ); mvr2r( sts[0]->lsp_old1, sts[1]->lsp_old1, M ); -#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING sts[1]->last_core_brate = sts[0]->last_core_brate; -#endif sts[1]->GSC_noisy_speech = 0; if ( hCPE->element_mode == IVAS_CPE_MDCT ) -- GitLab From 26e6c82178375f008043fb83e7746327670acf10 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:46:31 +0200 Subject: [PATCH 38/65] [cleanup] accept FIX_1099_JBM_MD_HANDLE_ALLOC --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a877b134f..d18f2e1d8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */ #define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */ #define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 1f6f295f4..15c24f324 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2467,11 +2467,7 @@ ivas_error ivas_init_decoder( } #endif -#ifdef FIX_1099_JBM_MD_HANDLE_ALLOC if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->Opt_tsm ) -#else - if ( st_ivas->hJbmMetadata == NULL && st_ivas->hDecoderConfig->Opt_tsm ) -#endif { if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -- GitLab From 80e6f63eb23b27542a1c57615230ea207895a14b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:46:59 +0200 Subject: [PATCH 39/65] [cleanup] accept FIX_1121_MASA_DESCRIPTOR --- lib_com/ivas_rom_com.c | 2 -- lib_com/ivas_rom_com.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_masa_dec.c | 3 --- lib_rend/ivas_mcmasa_ana.c | 3 --- lib_util/masa_file_reader.c | 5 ----- 6 files changed, 16 deletions(-) diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 46a2e82ec..09e6703c0 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -2464,13 +2464,11 @@ const uint16_t ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_ * MASA ROM tables *----------------------------------------------------------------------------------*/ -#ifdef FIX_1121_MASA_DESCRIPTOR const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 /* "IVASMASA" */ }; -#endif const float diffuseness_reconstructions_hr[HR_MASA_ER_LEVELS] = { 0.00f, diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index c57d7e9ca..798ea4b8e 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -264,10 +264,8 @@ extern const uint16_t ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PA * MASA ROM tables *----------------------------------------------------------------------------------*/ -#ifdef FIX_1121_MASA_DESCRIPTOR extern const uint8_t ivasmasaFormatDescriptor[8]; /* "IVASMASA" */ -#endif extern const int16_t bits_direction_masa[DIRAC_DIFFUSE_LEVELS]; extern const int16_t no_theta_masa[NO_SPHERICAL_GRIDS - 2]; extern const int16_t no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; diff --git a/lib_com/options.h b/lib_com/options.h index d18f2e1d8..e816ad8bb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */ #define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */ #define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index fb05774b9..e31e68913 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1835,9 +1835,6 @@ static void create_masa_ext_out_meta( IVAS_QMETADATA_HANDLE hQMetaData, const int16_t nchan_transport ) { -#ifndef FIX_1121_MASA_DESCRIPTOR - const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ -#endif int16_t i, sf, b_old, b_new, dir; MASA_DECRIPTIVE_META *descMeta; int16_t *bandMap; diff --git a/lib_rend/ivas_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c index b3f968ea3..785192103 100644 --- a/lib_rend/ivas_mcmasa_ana.c +++ b/lib_rend/ivas_mcmasa_ana.c @@ -1069,9 +1069,6 @@ void ivas_create_masa_out_meta( float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : Estimated surround coherence */ ) { -#ifndef FIX_1121_MASA_DESCRIPTOR - const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ -#endif int16_t i, sf, band; uint8_t numFrequencyBands; uint8_t numDirections; diff --git a/lib_util/masa_file_reader.c b/lib_util/masa_file_reader.c index d5e7f6874..73396eeb6 100644 --- a/lib_util/masa_file_reader.c +++ b/lib_util/masa_file_reader.c @@ -35,9 +35,7 @@ #include "ivas_stat_com.h" #include #include -#ifdef FIX_1121_MASA_DESCRIPTOR #include "ivas_rom_com.h" /* load 'ivasmasaFormatDescriptor[8]' */ -#endif struct MasaFileReader @@ -114,9 +112,6 @@ ivas_error MasaFileReader_readNextFrame( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifndef FIX_1121_MASA_DESCRIPTOR - const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ -#endif uint16_t twoByteBuffer = 0; int16_t i, j, b; IVAS_MASA_METADATA_HANDLE hMeta; -- GitLab From 1b916d7c6b5201aad06a0ae48b1b2a00ddfe8428 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:47:42 +0200 Subject: [PATCH 40/65] [cleanup] accept NONBE_1894_OSBA_SCALING --- lib_com/ivas_prot.h | 2 -- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 11 ----------- lib_dec/ivas_osba_dec.c | 19 ------------------- 4 files changed, 33 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 347bed82b..2bc994564 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5607,7 +5607,6 @@ ivas_error ivas_osba_render_sf( float *output_f[] /* o : rendered time signal */ ); -#ifdef NONBE_1894_OSBA_SCALING void ivas_osba_stereo_add_channels( float *tc_f[], /* i : transport channels */ float *output_f[], /* i/o: output channels */ @@ -5616,7 +5615,6 @@ void ivas_osba_stereo_add_channels( const int16_t nchan_ism, /* i : number of ISM channels */ const int16_t n_samples_to_render /* i : output frame length per channel */ ); -#endif void ivas_osba_data_close( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ diff --git a/lib_com/options.h b/lib_com/options.h index e816ad8bb..f172e47a6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */ #define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 78a68a964..71c311c89 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1226,14 +1226,7 @@ ivas_error ivas_jbm_dec_render( ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); /* add already rendered SBA part */ -#ifdef NONBE_1894_OSBA_SCALING ivas_osba_stereo_add_channels( p_tc, p_output, 1.0f, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); -#else - for ( n = 0; n < nchan_out; n++ ) - { - v_add( p_output[n], p_tc[n + st_ivas->nchan_ism], p_output[n], *nSamplesRendered ); - } -#endif } else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { @@ -1265,12 +1258,10 @@ ivas_error ivas_jbm_dec_render( else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) { ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); -#ifdef NONBE_1894_OSBA_SCALING for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered ); } -#endif } else { @@ -1293,12 +1284,10 @@ ivas_error ivas_jbm_dec_render( set_zero( p_output[n], *nSamplesRendered ); } } -#ifdef NONBE_1894_OSBA_SCALING for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered ); } -#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index c9169abe7..1c73dcfea 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -182,20 +182,10 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( for ( b = 0; b < num_cldfb_bands; b++ ) { st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] = -#ifndef NONBE_1894_OSBA_SCALING - ( 0.5f * st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) + - ( 0.5f * Cldfb_RealBuffer[b] ); -#else st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] + Cldfb_RealBuffer[b]; -#endif st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] = -#ifndef NONBE_1894_OSBA_SCALING - ( 0.5f * st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) + - ( 0.5f * Cldfb_ImagBuffer[b] ); -#else st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] + Cldfb_ImagBuffer[b]; -#endif } } } @@ -212,11 +202,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( int16_t i; for ( i = 0; i < nSamplesAsked; i++ ) { -#ifndef NONBE_1894_OSBA_SCALING - output_f[n][i] = 0.5f * output_f[channel_offset + n][i] + 0.5f * p_sepobj[n][i]; -#else output_f[n][i] = output_f[channel_offset + n][i] + p_sepobj[n][i]; -#endif } } } @@ -306,15 +292,11 @@ ivas_error ivas_osba_render_sf( { v_add( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); } -#ifndef NONBE_1894_OSBA_SCALING - v_multc( p_output[n], 0.5f, p_output[n], *nSamplesRendered ); -#endif } return IVAS_ERR_OK; } -#ifdef NONBE_1894_OSBA_SCALING /*-------------------------------------------------------------------------* * ivas_osba_stereo_add_channels() * @@ -360,4 +342,3 @@ void ivas_osba_stereo_add_channels( return; } -#endif -- GitLab From c0773e1f4d565e8986716730118aa6e6f96304dd Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:48:24 +0200 Subject: [PATCH 41/65] [cleanup] accept NONBE_FIX_1141_OSBA_ROOM_RENDERING --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 43 ------------------------------------ lib_dec/ivas_ism_param_dec.c | 6 ----- lib_dec/ivas_stat_dec.h | 2 -- 4 files changed, 52 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f172e47a6..e909bea2d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ #define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_SVD_OPTIMIZATION /* FhG: port-2211-svd-optimization */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 1082fc4a1..1966aad64 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2223,40 +2223,22 @@ void ivas_dirac_dec_render_sf( /* render objects in combined format onto the CICP19 channels for BINAURAL_ROOM_IR */ if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - int16_t in_ch; - for ( in_ch = 0; in_ch < st_ivas->nchan_ism; in_ch++ ) - { -#endif int16_t j, k, l; -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - int16_t j2, lfe_index; -#endif int16_t num_objects, nchan_out_woLFE; int16_t az1, el1; int16_t n_slots_to_render; int16_t n_samples_to_render; -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - int16_t interp_offset; -#endif float gain, prev_gain; num_objects = st_ivas->nchan_ism; nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render; -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - interp_offset = st_ivas->hTcBuffer->n_samples_rendered; -#endif if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) { ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING st_ivas->hIsmRendererData->interp_offset = 0; -#else - interp_offset = 0; -#endif } for ( i = 0; i < num_objects; i++ ) @@ -2271,19 +2253,8 @@ void ivas_dirac_dec_render_sf( } } -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING for ( j = 0; j < nchan_out_woLFE; j++ ) -#else - lfe_index = 0; - for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) -#endif { -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) - { - ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; - } -#endif gain = st_ivas->hIsmRendererData->gains[i][j]; prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) @@ -2291,11 +2262,7 @@ void ivas_dirac_dec_render_sf( float *tc_re, *tc_im; float *w1, w2; -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING w1 = &st_ivas->hIsmRendererData->interpolator[st_ivas->hIsmRendererData->interp_offset]; -#else - w1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; -#endif tc_re = pppQMfFrame_ts_re[nchan_transport + i][0]; tc_im = pppQMfFrame_ts_im[nchan_transport + i][0]; @@ -2309,13 +2276,8 @@ void ivas_dirac_dec_render_sf( for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) { -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING Cldfb_RealBuffer[j][k][l] += g * *( tc_re++ ); Cldfb_ImagBuffer[j][k][l] += g * *( tc_im++ ); -#else - Cldfb_RealBuffer[j2][k][l] += g * *( tc_re++ ); - Cldfb_ImagBuffer[j2][k][l] += g * *( tc_im++ ); -#endif } w1 += hSpatParamRendCom->num_freq_bands; } @@ -2328,12 +2290,7 @@ void ivas_dirac_dec_render_sf( } } } -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - } -#endif -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING st_ivas->hIsmRendererData->interp_offset += hSpatParamRendCom->num_freq_bands * st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; -#endif } if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index ba878d4b6..117ae08c1 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -712,9 +712,7 @@ void ivas_ism_dec_digest_tc( if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#endif ) { st_ivas->hIsmRendererData->interpolator[0] = 0.0f; @@ -735,9 +733,7 @@ void ivas_ism_dec_digest_tc( { ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator ); } -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING st_ivas->hIsmRendererData->interp_offset = 0; -#endif /* also get the gains here */ for ( i = 0; i < st_ivas->nchan_ism; i++ ) @@ -757,9 +753,7 @@ void ivas_ism_dec_digest_tc( if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#endif ) && st_ivas->hCombinedOrientationData == NULL ) { diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index b470313fd..d16b68e8f 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -811,9 +811,7 @@ typedef struct renderer_struct float prev_gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; float *interpolator; int16_t interpolator_length; -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING int16_t interp_offset; -#endif float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; -- GitLab From 617913d1aa5cdd2cd65c8f346b03a48776317667 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:49:20 +0200 Subject: [PATCH 42/65] [cleanup] accept NONBE_1360_LFE_DELAY --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 4 --- lib_dec/ivas_lfe_dec.c | 26 ---------------- lib_dec/ivas_mc_paramupmix_dec.c | 8 ----- lib_dec/ivas_mct_dec.c | 52 -------------------------------- lib_dec/ivas_stat_dec.h | 4 --- 6 files changed, 95 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e909bea2d..45ac1653b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_SVD_OPTIMIZATION /* FhG: port-2211-svd-optimization */ #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 15c24f324..c1e735534 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2388,7 +2388,6 @@ ivas_error ivas_init_decoder( if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { -#ifdef NONBE_1360_LFE_DELAY if ( st_ivas->hIntSetup.index_lfe[0] != -1 ) { delay_ns = st_ivas->binaural_latency_ns; @@ -2397,9 +2396,6 @@ ivas_error ivas_init_decoder( { delay_ns = 0; } -#else - delay_ns = st_ivas->binaural_latency_ns; -#endif if ( st_ivas->hBinRenderer != NULL ) { if ( st_ivas->hBinRenderer->render_lfe ) diff --git a/lib_dec/ivas_lfe_dec.c b/lib_dec/ivas_lfe_dec.c index effb2708f..d8cf35934 100644 --- a/lib_dec/ivas_lfe_dec.c +++ b/lib_dec/ivas_lfe_dec.c @@ -379,11 +379,7 @@ ivas_error ivas_create_lfe_dec( LFE_DEC_HANDLE hLFE; float lfe_addl_delay_s; int16_t i, j; -#ifndef NONBE_1360_LFE_DELAY - int16_t add_delay_sa; -#else float lfe_block_delay_s; -#endif low_pass_delay_dec_out = 0; block_offset_s = 0; @@ -421,11 +417,7 @@ ivas_error ivas_create_lfe_dec( hLFE->cum_freq_models[1][3] = &ivas_str_lfe_freq_models.entropy_coder_model_coarse_sg4; /* delay calculation */ -#ifndef NONBE_1360_LFE_DELAY - hLFE->lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#else lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#endif block_offset_s = BLOCK_OFFSET_MS * 0.001f; filt_order = 0; @@ -433,39 +425,21 @@ ivas_error ivas_create_lfe_dec( if ( ( delay_ns / 1000000000.f ) > ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] ) { filt_order = 4; -#ifdef NONBE_1360_LFE_DELAY low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#else - low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] * 1000000000.f; -#endif ivas_create_lfe_lpf_dec( &( hLFE->filter_state ), output_Fs ); } hLFE->filter_state.order = filt_order; -#ifndef NONBE_1360_LFE_DELAY - hLFE->lfe_block_delay_s = hLFE->lfe_block_delay_s + low_pass_delay_dec_out; -#else lfe_block_delay_s = lfe_block_delay_s + low_pass_delay_dec_out; -#endif hLFE->lfe_prior_buf_len = NS2SA( output_Fs, IVAS_LFE_FADE_NS ); hLFE->bfi_count = 0; -#ifdef NONBE_1360_LFE_DELAY block_offset_s += delay_ns / 1000000000.f; lfe_addl_delay_s = block_offset_s - lfe_block_delay_s; -#else - lfe_addl_delay_s = block_offset_s - hLFE->lfe_block_delay_s; -#endif lfe_addl_delay_s = max( 0.0f, lfe_addl_delay_s ); -#ifndef NONBE_1360_LFE_DELAY - add_delay_sa = (int16_t) roundf( (float) delay_ns * output_Fs / 1000000000.f ); - hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs ) + add_delay_sa; - hLFE->lfe_block_delay_s += lfe_addl_delay_s + add_delay_sa / output_Fs; -#else hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs ); hLFE->delay_ns = delay_ns; -#endif if ( hLFE->lfe_addl_delay > 0 ) { if ( ( hLFE->lfe_delay_buf = (float *) malloc( hLFE->lfe_addl_delay * sizeof( float ) ) ) == NULL ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 448ac3673..87b6e2d12 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -841,38 +841,30 @@ static void ivas_mc_paramupmix_dec_sf( { for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) { -#ifdef NONBE_1360_LFE_DELAY /*delay is handled within LFE decoder*/ if ( st_ivas->hIntSetup.index_lfe[0] != ch ) { -#endif float tmp_buf[L_SUBFRAME5MS_48k]; mvr2r( &output_f[ch][n_samples_rendered - noparamupmix_delay], tmp_buf, noparamupmix_delay ); mvr2r( output_f[ch], &output_f[ch][noparamupmix_delay], n_samples_rendered - noparamupmix_delay ); mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], noparamupmix_delay ); mvr2r( tmp_buf, hMCParamUpmix->pcm_delay[ch], noparamupmix_delay ); -#ifdef NONBE_1360_LFE_DELAY } -#endif } } else { for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) { -#ifdef NONBE_1360_LFE_DELAY /*delay is handled within LFE decoder*/ if ( st_ivas->hIntSetup.index_lfe[0] != ch ) { -#endif float tmp_buf[L_SUBFRAME5MS_48k]; mvr2r( &output_f[ch][0], tmp_buf, n_samples_rendered ); mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], n_samples_rendered ); mvr2r( &hMCParamUpmix->pcm_delay[ch][n_samples_rendered], &hMCParamUpmix->pcm_delay[ch][0], noparamupmix_delay - n_samples_rendered ); mvr2r( tmp_buf, &hMCParamUpmix->pcm_delay[ch][noparamupmix_delay - n_samples_rendered], n_samples_rendered ); -#ifdef NONBE_1360_LFE_DELAY } -#endif } } } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 87e79b4af..4e8031e14 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1118,42 +1118,6 @@ static ivas_error ivas_mc_dec_reconfig( return error; } -#ifndef NONBE_1360_LFE_DELAY - /*-----------------------------------------------------------------* - * Allocate the LFE handle that is coded separately after the allocation of the core coders - *-----------------------------------------------------------------*/ - if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hLFE == NULL ) - { - int32_t delay_ns = st_ivas->binaural_latency_ns; - if ( st_ivas->hBinRenderer != NULL ) - { - if ( st_ivas->hBinRenderer->render_lfe ) - { - /* Account for filterbank delay */ - delay_ns += IVAS_FB_DEC_DELAY_NS; - } - else - { - delay_ns = 0; - } - } - else - { - if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( st_ivas->cldfbSynDec[0] != NULL ) ) - { - delay_ns += IVAS_FB_DEC_DELAY_NS; - } - } - - if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, st_ivas->hDecoderConfig->output_Fs, delay_ns ) ) != IVAS_ERR_OK ) - { - return error; - } - - set_zero( st_ivas->hLFE->prevsynth_buf, LFE_PLC_BUFLEN ); - set_zero( st_ivas->hLFE->prior_out_buffer, L_FRAME48k ); - } -#endif /*-----------------------------------------------------------------* * Reconfigure renderers @@ -1305,17 +1269,11 @@ static ivas_error ivas_mc_dec_reconfig( return error; } -#ifdef NONBE_1360_LFE_DELAY /*-----------------------------------------------------------------* * Allocate the LFE handle that is coded separately after the allocation of the core coders *-----------------------------------------------------------------*/ -#ifdef NONBE_1360_LFE_DELAY if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) -#else - if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hLFE == NULL ) -#endif { -#ifdef NONBE_1360_LFE_DELAY int32_t delay_ns; if ( st_ivas->hIntSetup.index_lfe[0] != -1 ) { @@ -1325,9 +1283,6 @@ static ivas_error ivas_mc_dec_reconfig( { delay_ns = 0; } -#else - int32_t delay_ns = st_ivas->binaural_latency_ns; -#endif if ( st_ivas->hBinRenderer != NULL ) { if ( st_ivas->hBinRenderer->render_lfe ) @@ -1348,7 +1303,6 @@ static ivas_error ivas_mc_dec_reconfig( } } -#ifdef NONBE_1360_LFE_DELAY if ( st_ivas->hLFE != NULL ) { if ( st_ivas->hLFE->delay_ns != delay_ns ) @@ -1356,12 +1310,9 @@ static ivas_error ivas_mc_dec_reconfig( ivas_lfe_dec_close( &( st_ivas->hLFE ) ); } } -#endif -#ifdef NONBE_1360_LFE_DELAY if ( st_ivas->hLFE == NULL ) { -#endif if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, st_ivas->hDecoderConfig->output_Fs, delay_ns ) ) != IVAS_ERR_OK ) { return error; @@ -1369,11 +1320,8 @@ static ivas_error ivas_mc_dec_reconfig( set_zero( st_ivas->hLFE->prevsynth_buf, LFE_PLC_BUFLEN ); set_zero( st_ivas->hLFE->prior_out_buffer, L_FRAME48k ); -#ifdef NONBE_1360_LFE_DELAY } -#endif } -#endif /*-----------------------------------------------------------------* * JBM TC buffers diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index d16b68e8f..8d3e8aee9 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -786,11 +786,7 @@ typedef struct ivas_lfe_dec_data_structure LFE_WINDOW_HANDLE pWindow_state; const uint16_t *cum_freq_models[IVAS_MAX_NUM_QUANT_STRATS][IVAS_MAX_NUM_DCT_COEF_GROUPS]; int16_t lfe_dec_indices_coeffs_tbl[IVAS_MAX_NUM_QUANT_STRATS][IVAS_MAX_NUM_DCT_COEF_GROUPS]; -#ifdef NONBE_1360_LFE_DELAY int32_t delay_ns; -#else - float lfe_block_delay_s; -#endif int16_t lfe_prior_buf_len; float prior_out_buffer[L_FRAME48k]; -- GitLab From 8e55b360e5fbe60638f22cfd2d865a3c2d88b5f5 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:49:54 +0200 Subject: [PATCH 43/65] [cleanup] accept NONBE_1229_FIX_ISM1_DPID --- lib_com/options.h | 1 - lib_util/render_config_reader.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 45ac1653b..178908fcf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_SVD_OPTIMIZATION /* FhG: port-2211-svd-optimization */ #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ #define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 149204ba1..b06e92a23 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -3032,11 +3032,7 @@ ivas_error RenderConfigReader_getDirectivity( } } /* case when -dpid is not specified, select first directivity pattern from config file */ -#ifdef NONBE_1229_FIX_ISM1_DPID if ( last_specified_id == 65535 ) -#else - if ( n == 0 ) -#endif { last_specified_id = (uint16_t) pRenderConfigReader->pDP[0].id; } -- GitLab From c8863ea5486a6036f1d2e97f9025edaa3b50eaee Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:50:28 +0200 Subject: [PATCH 44/65] [cleanup] accept NONBE_SVD_OPTIMIZATION --- lib_com/options.h | 1 - lib_dec/ivas_svd_dec.c | 163 ----------------------------------------- 2 files changed, 164 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 178908fcf..104aa9f76 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_SVD_OPTIMIZATION /* FhG: port-2211-svd-optimization */ #define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ #define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ #define NONBE_1250_MCMASA_LS_OUTPUT /* VA: issue 1250: fix crash in McMASA to custom LS output decoding */ diff --git a/lib_dec/ivas_svd_dec.c b/lib_dec/ivas_svd_dec.c index 0f9c7523b..5d15910c1 100644 --- a/lib_dec/ivas_svd_dec.c +++ b/lib_dec/ivas_svd_dec.c @@ -57,13 +57,8 @@ *-----------------------------------------------------------------------*/ static float GivensRotation( const float x, const float z ); -#ifdef NONBE_SVD_OPTIMIZATION static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g ); static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g ); -#else -static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); -static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); -#endif static void singularVectorsAccumulationLeft( float singularVectors_Left[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC ); @@ -491,26 +486,16 @@ static void HouseholderReduction( float *eps_x ) { int16_t nCh; -#ifdef NONBE_SVD_OPTIMIZATION float g_left = 0.0f; float g_right = 0.0f; -#else - float sig_x = 0.0f; - float g = 0.0f; -#endif /* Bidiagonal Reduction for every channel */ for ( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */ { -#ifdef NONBE_SVD_OPTIMIZATION secDiag[nCh] = g_right; /* from the previous channel */ biDiagonalReductionLeft( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_left ); singularValues[nCh] = g_left; biDiagonalReductionRight( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_right ); -#else - biDiagonalReductionLeft( singularVectors_Left, singularValues, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); - biDiagonalReductionRight( singularVectors_Left, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); -#endif *eps_x = max( *eps_x, ( fabsf( singularValues[nCh] ) + fabsf( secDiag[nCh] ) ) ); } @@ -523,7 +508,6 @@ static void HouseholderReduction( } -#ifdef NONBE_SVD_OPTIMIZATION /*------------------------------------------------------------------------- * biDiagonalReductionLeft() * @@ -633,160 +617,13 @@ static void biDiagonalReductionRight( return; } -#else - -/*------------------------------------------------------------------------- - * biDiagonalReductionLeft() - * - * - *-------------------------------------------------------------------------*/ -static void biDiagonalReductionLeft( - float singularVectors[][MAX_OUTPUT_CHANNELS], - float singularValues[MAX_OUTPUT_CHANNELS], - float secDiag[MAX_OUTPUT_CHANNELS], - const int16_t nChannelsL, - const int16_t nChannelsC, - const int16_t currChannel, - float *sig_x, - float *g ) -{ - int16_t iCh, jCh, idx; - float norm_x, f, r; - - secDiag[currChannel] = ( *sig_x ) * ( *g ); - - /* Setting values to 0 */ - ( *sig_x ) = 0.0f; - ( *g ) = 0.0f; - - if ( currChannel < nChannelsL ) /* i <= m */ - { - idx = currChannel; - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - ( *sig_x ) += fabsf( singularVectors[jCh][currChannel] ); - } - - if ( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ - { - norm_x = 0.0f; - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][currChannel] = ( singularVectors[jCh][currChannel] / maxWithSign( ( *sig_x ) ) ); - norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][currChannel] ); - } - ( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x ); - r = ( *g ) * singularVectors[currChannel][idx] - norm_x; - singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) ); - - for ( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ - { - norm_x = 0.0f; - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][iCh] ); - } - - f = norm_x / maxWithSign( r ); - - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][iCh] += ( f * singularVectors[jCh][currChannel] ); - } - } - - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][currChannel] = ( singularVectors[jCh][currChannel] * ( *sig_x ) ); - } - } - - singularValues[currChannel] = ( ( *sig_x ) * ( *g ) ); - } - - return; -} -#endif /*------------------------------------------------------------------------- * biDiagonalReductionRight() * * *-------------------------------------------------------------------------*/ -#ifdef NONBE_SVD_OPTIMIZATION - -#else -static void biDiagonalReductionRight( - float singularVectors[][MAX_OUTPUT_CHANNELS], - float secDiag[MAX_OUTPUT_CHANNELS], - const int16_t nChannelsL, - const int16_t nChannelsC, - const int16_t currChannel, - float *sig_x, - float *g ) -{ - int16_t iCh, jCh, idx; - float norm_x, r; - - /* Setting values to 0 */ - ( *sig_x ) = 0.0f; - ( *g ) = 0.0f; - if ( currChannel < nChannelsL && currChannel != ( nChannelsC - 1 ) ) /* i <=m && i !=n */ - { - idx = currChannel + 1; - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - ( *sig_x ) += fabsf( singularVectors[currChannel][jCh] ); - } - - if ( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ - { - norm_x = 0.0f; - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */ - { - singularVectors[currChannel][jCh] = ( singularVectors[currChannel][jCh] / maxWithSign( ( *sig_x ) ) ); - norm_x += ( singularVectors[currChannel][jCh] * singularVectors[currChannel][jCh] ); - } - ( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x ); - r = ( *g ) * singularVectors[currChannel][idx] - norm_x; - singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) ); - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - secDiag[jCh] = singularVectors[currChannel][jCh] / maxWithSign( r ); - } - for ( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /* nChannelsL */ - { - norm_x = 0.0f; - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - norm_x += ( singularVectors[iCh][jCh] * singularVectors[currChannel][jCh] ); - } - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - singularVectors[iCh][jCh] += ( norm_x * secDiag[jCh] ); - } - } - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - singularVectors[currChannel][jCh] = ( singularVectors[currChannel][jCh] * ( *sig_x ) ); - } - } - } - - return; -} - -#endif /*------------------------------------------------------------------------- * singularVectorsAccumulationLeft() * -- GitLab From 67c7dba9b19ed162d1ab73279c330ce80687ea57 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:51:01 +0200 Subject: [PATCH 45/65] [cleanup] accept FIX_1135_EXT_RENDERER_HANDLES --- apps/renderer.c | 14 ------------ lib_com/options.h | 1 - lib_dec/lib_dec.c | 6 ------ lib_rend/lib_rend.c | 52 --------------------------------------------- lib_rend/lib_rend.h | 2 -- 5 files changed, 75 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index f20d8a91f..059443e39 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -168,10 +168,8 @@ typedef struct char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientation_tracking; -#ifdef FIX_1135_EXT_RENDERER_HANDLES int16_t Opt_Headrotation; int16_t Opt_ExternalOrientation; -#endif int16_t nonDiegeticPan; float nonDiegeticPanGain; IVAS_REND_COMPLEXITY_LEVEL complexityLevel; @@ -888,11 +886,7 @@ int main( const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) ); goto cleanup; @@ -2632,10 +2626,8 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES args.Opt_Headrotation = 0; args.Opt_ExternalOrientation = 0; -#endif args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; @@ -2726,9 +2718,7 @@ static void parseOption( break; case CmdLnOptionId_trajFile: assert( numOptionValues == 1 ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_Headrotation = 1; -#endif strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_outputMetadata: @@ -2749,9 +2739,7 @@ static void parseOption( break; case CmdLnOptionId_exteriorOrientationFile: assert( numOptionValues == 1 ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_ExternalOrientation = 1; -#endif strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_customHrtfFile: @@ -2876,12 +2864,10 @@ static CmdlnArgs parseCmdlnArgs( exit( -1 ); /* Error printout handled by failing function */ } -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { args.Opt_Headrotation = 1; } -#endif return args; } diff --git a/lib_com/options.h b/lib_com/options.h index 104aa9f76..5dcef706a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ #define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ #define NONBE_1250_MCMASA_LS_OUTPUT /* VA: issue 1250: fix crash in McMASA to custom LS output decoding */ #define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 027d997d2..a04741e97 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -487,12 +487,6 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->render_framesize = renderFramesize; } -#ifndef FIX_1135_EXT_RENDERER_HANDLES - if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - hDecoderConfig->Opt_Headrotation = TRUE; - } -#endif /* Set decoder parameters to initial values */ if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 6deec620b..2b2969a98 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1108,11 +1108,7 @@ static ivas_error initHeadRotation( static void closeHeadRotation( IVAS_REND_HANDLE hIvasRend ) { -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( hIvasRend != NULL && hIvasRend->headRotData.headRotEnabled && hIvasRend->headRotData.hOrientationTracker != NULL ) -#else - if ( ( hIvasRend != NULL ) && ( hIvasRend->headRotData.hOrientationTracker != NULL ) ) -#endif { free( hIvasRend->headRotData.hOrientationTracker ); } @@ -2770,10 +2766,8 @@ ivas_error IVAS_REND_Open( const bool asHrtfBinary, const int16_t nonDiegeticPan, const float nonDiegeticPanGain, -#ifdef FIX_1135_EXT_RENDERER_HANDLES const int16_t Opt_Headrotation, const int16_t Opt_ExternalOrientation, -#endif const int16_t num_subframes ) { int16_t i; @@ -2828,46 +2822,34 @@ ivas_error IVAS_REND_Open( } /* Initialize headrotation data */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES hIvasRend->headRotData.headRotEnabled = 0; if ( Opt_Headrotation ) { -#endif if ( ( error = initHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif /* Initialize external orientation data */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES hIvasRend->hExternalOrientationData = NULL; if ( Opt_ExternalOrientation ) { -#endif if ( ( error = ivas_external_orientation_open( &( hIvasRend->hExternalOrientationData ), num_subframes ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif /* Initilize combined orientation data */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES hIvasRend->hCombinedOrientationData = NULL; if ( Opt_Headrotation || Opt_ExternalOrientation ) { -#endif if ( ( error = ivas_combined_orientation_open( &( hIvasRend->hCombinedOrientationData ), outputSampleRate, num_subframes ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif /* Initialize EFAP */ if ( ( error = initEfap( &hIvasRend->efapOutWrapper, outConfig, &hIvasRend->customLsOut ) ) != IVAS_ERR_OK ) @@ -2976,17 +2958,13 @@ ivas_error IVAS_REND_Open( } } -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#endif if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif return IVAS_ERR_OK; } @@ -3911,11 +3889,7 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( hIvasRend->splitRendWrapper != NULL && hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) -#else - if ( hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) -#endif { if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { @@ -4606,12 +4580,10 @@ ivas_error IVAS_REND_SetOrientationTrackingMode( const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ ) { -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( hIvasRend->headRotData.headRotEnabled == 0 ) { return IVAS_ERR_OK; } -#endif return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, orientation_tracking ); } @@ -5243,11 +5215,7 @@ static ivas_error renderIsmToBinauralRoom( hCombinedOrientationData = ismInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -5862,11 +5830,7 @@ static ivas_error renderMcToBinaural( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -5956,11 +5920,7 @@ static ivas_error renderMcToBinauralRoom( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6052,11 +6012,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6666,11 +6622,7 @@ static ivas_error renderSbaToBinaural( hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6747,11 +6699,7 @@ static ivas_error renderSbaToBinauralRoom( hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index eb014f0dc..8e3353b1b 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -113,10 +113,8 @@ ivas_error IVAS_REND_Open( const bool asHrtfBinary, /* i : load hrtf binary file */ const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES const int16_t Opt_Headrotation, /* i : indicates whether head-rotation is used */ const int16_t Opt_ExternalOrientation, /* i : indicates whether external orientations are used */ -#endif const int16_t num_subframes /* i : number of subframes */ ); -- GitLab From 8a5fdcb94d0715e441bb9e4e8e2044927a74775d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:51:38 +0200 Subject: [PATCH 46/65] [cleanup] accept FIX_1209_SID_SIGNALING --- lib_com/bitstream.c | 8 -------- lib_com/ivas_cnst.h | 4 ---- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 14 -------------- lib_enc/ivas_init_enc.c | 5 ----- 5 files changed, 32 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index b52f2fa17..323364a35 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -4549,11 +4549,6 @@ ivas_error preview_indices( case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; break; -#ifndef FIX_1209_SID_SIGNALING - case SID_MULTICHANNEL: - st_ivas->ivas_format = MC_FORMAT; - break; -#endif case SID_SBA_1TC: st_ivas->ivas_format = SBA_FORMAT; st_ivas->element_mode_init = IVAS_SCE; @@ -4578,9 +4573,6 @@ ivas_error preview_indices( } break; default: -#ifndef FIX_1209_SID_SIGNALING - /* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ -#endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format ); } } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index e5bff8dcb..cb3e80711 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -236,11 +236,7 @@ typedef enum #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ #define SID_MASA_1TC 0x3 /* 1| 1| 0 */ -#ifdef FIX_1209_SID_SIGNALING /*reserved*/ /*0x4*/ /* 0| 0| 1 */ -#else -#define SID_MULTICHANNEL 0x4 /* 0| 0| 1 */ -#endif #define SID_SBA_1TC 0x5 /* 1| 0| 1 */ #define SID_SBA_2TC 0x6 /* 0| 1| 1 */ #define SID_MASA_2TC 0x7 /* 1| 1| 1 */ diff --git a/lib_com/options.h b/lib_com/options.h index 5dcef706a..5f512d486 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ #define NONBE_1250_MCMASA_LS_OUTPUT /* VA: issue 1250: fix crash in McMASA to custom LS output decoding */ #define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index c1e735534..096c403f3 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -92,7 +92,6 @@ static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( } -#ifdef FIX_1209_SID_SIGNALING /*---------------------------------------------------------------------* * ivas_dec_get_format( ) * @@ -455,7 +454,6 @@ ivas_error ivas_dec_get_format( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* @@ -488,14 +486,10 @@ ivas_error ivas_dec_setup( * Read IVAS format *-------------------------------------------------------------------*/ -#ifdef FIX_1209_SID_SIGNALING if ( ( error = ivas_read_format( st_ivas, &num_bits_read ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_read_format( st_ivas, &num_bits_read ); -#endif /*-------------------------------------------------------------------* * Read other signling (ISM/MC mode, number of channels, etc.) @@ -1002,11 +996,6 @@ static ivas_error ivas_read_format( case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; break; -#ifndef FIX_1209_SID_SIGNALING - case SID_MULTICHANNEL: - st_ivas->ivas_format = MC_FORMAT; - break; -#endif case SID_SBA_1TC: st_ivas->ivas_format = SBA_FORMAT; st_ivas->element_mode_init = IVAS_SCE; @@ -1031,9 +1020,6 @@ static ivas_error ivas_read_format( } break; default: -#ifndef FIX_1209_SID_SIGNALING -/* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ -#endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format ); } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 1a5559fe0..f7d0cc9f9 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -164,11 +164,6 @@ void ivas_write_format_sid( case ISM_FORMAT: ind = SID_ISM; break; -#ifndef FIX_1209_SID_SIGNALING - case MC_FORMAT: - ind = SID_MULTICHANNEL; - break; -#endif case SBA_FORMAT: switch ( element_mode ) { -- GitLab From 3863ef31befb3194589359745b4ec91563fc6bde Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:52:13 +0200 Subject: [PATCH 47/65] [cleanup] accept NONBE_1250_MCMASA_LS_OUTPUT --- lib_com/options.h | 1 - lib_dec/ivas_dirac_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5f512d486..0ebed27a4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1250_MCMASA_LS_OUTPUT /* VA: issue 1250: fix crash in McMASA to custom LS output decoding */ #define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 1966aad64..7f6857298 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -2388,14 +2388,10 @@ void ivas_dirac_dec_render_sf( /* Move the separated and the LFE channels to temporary variables as spatial synthesis may overwrite current channels */ mvr2r( &( output_f[st_ivas->hOutSetup.separateChannelIndex][subframe_start_sample] ), tmp_separated, num_samples_subframe ); -#ifdef NONBE_1250_MCMASA_LS_OUTPUT if ( hDirACRend->hOutSetup.num_lfe > 0 ) { mvr2r( &( output_f[LFE_CHANNEL][subframe_start_sample] ), tmp_lfe, num_samples_subframe ); } -#else - mvr2r( &( output_f[LFE_CHANNEL][subframe_start_sample] ), tmp_lfe, num_samples_subframe ); -#endif for ( ch = 0; ch < outchannels; ch++ ) { -- GitLab From 453f80f409e183f0dfe391eafc31da4c3aed9408 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:52:49 +0200 Subject: [PATCH 48/65] [cleanup] accept FIX_1158_FASTCONV_REVERB_HRTF --- apps/decoder.c | 23 ----------------------- lib_com/options.h | 1 - lib_dec/ivas_output_config.c | 4 ---- 3 files changed, 28 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 3f339d8a7..e9c921d17 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -404,27 +404,6 @@ int main( } } -#ifndef FIX_1158_FASTCONV_REVERB_HRTF - /*------------------------------------------------------------------------------------------* - * Open renderer configuration reader file - *------------------------------------------------------------------------------------------*/ - - if ( arg.renderConfigEnabled ) - { - /* sanity check */ - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false ) - { - fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); - goto cleanup; - } - - if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); - goto cleanup; - } - } -#endif /*------------------------------------------------------------------------------------------* * Configure the decoder @@ -619,13 +598,11 @@ int main( goto cleanup; } -#ifdef FIX_1158_FASTCONV_REVERB_HRTF if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); goto cleanup; } -#endif if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { diff --git a/lib_com/options.h b/lib_com/options.h index 0ebed27a4..6f2b6611a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */ #define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 3a7ad5bf4..f7cfa6f0a 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -141,11 +141,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; -#ifdef FIX_1158_FASTCONV_REVERB_HRTF if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; } -- GitLab From fce8abd355432870106afc7e92a7cfe89fec3d3f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:53:23 +0200 Subject: [PATCH 49/65] [cleanup] accept NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR --- lib_com/options.h | 1 - lib_rend/ivas_objectRenderer_sfx.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6f2b6611a..7d64ccd3c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ #define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */ #define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index daa9137db..d00a8e25d 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -261,13 +261,8 @@ void TDREND_firfilt( /* Handle memory */ p_signal = buffer + filterlength - 1; mvr2r( mem, buffer, filterlength - 1 ); /* Insert memory */ -#ifdef NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR mvr2r( signal, p_signal, subframe_length ); /* Insert current frame */ mvr2r( p_signal + subframe_length - filterlength + 1, mem, filterlength - 1 ); /* Update memory for next frame */ -#else - mvr2r( signal, buffer + filterlength - 1, subframe_length ); /* Insert current frame */ - mvr2r( signal + subframe_length - filterlength + 1, mem, filterlength - 1 ); /* Update memory for next frame */ -#endif /* Convolution */ for ( i = 0; i < subframe_length; i++ ) -- GitLab From fc8ff1141611fcd7f9696f583c23eaf9965b5424 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:54:13 +0200 Subject: [PATCH 50/65] [cleanup] accept NONBE_1131_ACELP_OOB --- lib_com/options.h | 1 - lib_dec/acelp_core_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7d64ccd3c..76c0cf665 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */ #define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ #define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index c5f862aee..3e6197c87 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -689,11 +689,7 @@ ivas_error acelp_core_dec( old_exc_s = st->old_exc + L_EXC_MEM_DEC - st->L_frame; tmpF = *old_exc_s; st->mem_deemph = old_exc_s[st->L_frame - 1]; -#ifdef NONBE_1131_ACELP_OOB preemph( old_exc_s, st->preemph_fac, st->L_frame, &tmpF ); -#else - preemph( old_exc_s, st->preemph_fac, L_FRAME16k, &tmpF ); -#endif mvr2r( old_exc_s + st->L_frame - M, st->mem_syn2, M ); residu( Aq, M, old_exc_s, old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame ); } -- GitLab From 92b24a01f033ccab729371d82871332aa2ad36eb Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:54:57 +0200 Subject: [PATCH 51/65] [cleanup] accept NONBE_1240_FIX_CORE_SELECTION_ISM_SW --- lib_com/options.h | 1 - lib_enc/ivas_decision_matrix_enc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 76c0cf665..b01c0dc5e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ #define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ #define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ #define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index d84f73a7d..65a98f87d 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -183,12 +183,8 @@ void ivas_decision_matrix_enc( st->core = ACELP_CORE; } -#ifdef NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* sanity check: highest bitrates in ISM */ if ( st->is_ism_format && st->tcxonly && st->total_brate > MAX_ACELP_BRATE_ISM ) -#else - if ( st->is_ism_format && st->tcxonly ) -#endif { st->core = TCX_20_CORE; } -- GitLab From 5c280fe20cf84c65539731b6e4c82c9ff1bb0ad2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:55:56 +0200 Subject: [PATCH 52/65] [cleanup] accept FIX_1101_CLEANING_JBM_CALL --- lib_com/ivas_cnst.h | 3 --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 11 ---------- lib_dec/ivas_jbm_dec.c | 45 ----------------------------------------- 4 files changed, 60 deletions(-) diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index cb3e80711..d2c4a1768 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -179,9 +179,6 @@ typedef enum typedef enum { -#ifndef FIX_1101_CLEANING_JBM_CALL - TC_BUFFER_MODE_NONE = 0, -#endif TC_BUFFER_MODE_RENDERER, TC_BUFFER_MODE_BUFFER } TC_BUFFER_MODE; diff --git a/lib_com/options.h b/lib_com/options.h index b01c0dc5e..de85b9559 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ #define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ #define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ #define FIX_VOIP_FUNCTIONS /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 096c403f3..11a2c614b 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2438,17 +2438,6 @@ ivas_error ivas_init_decoder( } } -#ifndef FIX_1101_CLEANING_JBM_CALL - if ( st_ivas->hTcBuffer == NULL ) - { - /* we need the handle anyway, but without the buffer*/ - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_NONE, 0, 0, 0, 1 ) ) != IVAS_ERR_OK ) - { - return error; - } - } - -#endif if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->Opt_tsm ) { if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 71c311c89..90c48aab6 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -103,15 +103,6 @@ ivas_error ivas_jbm_dec_tc( } } -#ifndef FIX_1101_CLEANING_JBM_CALL - if ( !st_ivas->hDecoderConfig->Opt_tsm ) - { - for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) - { - st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n]; - } - } -#endif /*----------------------------------------------------------------* * Decoding + pre-rendering *----------------------------------------------------------------*/ @@ -799,7 +790,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( p_data_f[n] = &data_f[n][0]; } -#ifdef FIX_1101_CLEANING_JBM_CALL if ( !st_ivas->hDecoderConfig->Opt_tsm ) { for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) @@ -808,7 +798,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f ); @@ -2301,18 +2290,6 @@ ivas_error ivas_jbm_dec_tc_buffer_open( set_s( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); -#ifndef FIX_1101_CLEANING_JBM_CALL - if ( hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_NONE ) - { - hTcBuffer->tc_buffer = NULL; - - for ( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = NULL; - } - } - else -#endif { int16_t n_samp_full, n_samp_residual; int32_t offset; @@ -2739,9 +2716,6 @@ void ivas_jbm_dec_copy_tc_no_tsm( const int16_t output_frame /* i : output frame size */ ) { -#ifndef FIX_1101_CLEANING_JBM_CALL - int16_t n_ch_full_copy; -#endif int16_t n_ch_cldfb; int16_t ch_idx; DECODER_TC_BUFFER_HANDLE hTcBuffer; @@ -2749,25 +2723,10 @@ void ivas_jbm_dec_copy_tc_no_tsm( hTcBuffer = st_ivas->hTcBuffer; hTcBuffer->n_samples_buffered = output_frame; hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; -#ifndef FIX_1101_CLEANING_JBM_CALL - n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); -#endif n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; -#ifdef FIX_1101_CLEANING_JBM_CALL #ifdef DEBUGGING assert( st_ivas->hDecoderConfig->Opt_tsm == 0 ); -#endif -#else - /* copy full tcs*/ - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - for ( ch_idx = 0; ch_idx < n_ch_full_copy; ch_idx++ ) - { - mvr2r( tc[ch_idx], st_ivas->hTcBuffer->tc[ch_idx], hTcBuffer->n_samples_buffered ); - } - } - ch_idx = 0; #endif /* CLDFB ana for ParamMC/ParamISM */ if ( n_ch_cldfb > 0 ) @@ -2800,11 +2759,7 @@ void ivas_jbm_dec_copy_tc_no_tsm( } #endif /* CLDFB Analysis*/ -#ifdef FIX_1101_CLEANING_JBM_CALL for ( ch_idx = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ ) -#else - for ( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ ) -#endif { for ( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ ) { -- GitLab From 32ba6e99e73dc5660f3f6a6d73947d51f4c2649b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:56:29 +0200 Subject: [PATCH 53/65] [cleanup] accept NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND --- apps/renderer.c | 2 -- lib_com/options.h | 1 - 2 files changed, 3 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 059443e39..e9a372d73 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1071,7 +1071,6 @@ int main( fprintf( stderr, "\nFailed to read renderer configuration from file %s\n", args.renderConfigFilePath ); goto cleanup; } -#ifdef NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, args.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", args.directivityPatternId[0], args.directivityPatternId[1], args.directivityPatternId[2], args.directivityPatternId[3] ); @@ -1082,7 +1081,6 @@ int main( fprintf( stderr, "Failed to get Distance Attenuation \n\n" ); goto cleanup; } -#endif if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535; diff --git a/lib_com/options.h b/lib_com/options.h index de85b9559..9945406f0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ #define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ #define FIX_VOIP_FUNCTIONS /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */ #define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC /* VA: issue 1298: Memory saving in ivas_core_enc() */ -- GitLab From 4cc94006a76e6d8b3d799b069af15a268e05eb41 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:56:58 +0200 Subject: [PATCH 54/65] [cleanup] accept FIX_1348_OVERFLOW --- lib_com/options.h | 1 - lib_dec/hq_lr_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 9945406f0..eebf3e5b6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ #define FIX_VOIP_FUNCTIONS /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */ #define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC /* VA: issue 1298: Memory saving in ivas_core_enc() */ #define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ diff --git a/lib_dec/hq_lr_dec.c b/lib_dec/hq_lr_dec.c index c338f238c..9cbadc26d 100644 --- a/lib_dec/hq_lr_dec.c +++ b/lib_dec/hq_lr_dec.c @@ -260,14 +260,10 @@ void hq_lr_dec( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef FIX_1348_OVERFLOW #ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */ #else Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif -#else - Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ #endif Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); } -- GitLab From 766c0b5aa14d6c615ea28fd639e5d228f168b9b6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:57:33 +0200 Subject: [PATCH 55/65] [cleanup] accept FIX_VOIP_FUNCTIONS --- apps/decoder.c | 4 ---- lib_com/options.h | 1 - lib_dec/lib_dec.c | 32 -------------------------------- lib_dec/lib_dec.h | 4 ---- 4 files changed, 41 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index e9c921d17..6cdea851a 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -566,15 +566,11 @@ int main( } } #else -#ifdef FIX_VOIP_FUNCTIONS if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#else - IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ); -#endif #endif /*-------------------------------------------------------------------* diff --git a/lib_com/options.h b/lib_com/options.h index eebf3e5b6..d6766bcaf 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_VOIP_FUNCTIONS /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */ #define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC /* VA: issue 1298: Memory saving in ivas_core_enc() */ #define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ #define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a04741e97..4f33fec56 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1080,12 +1080,10 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( int16_t ro_md_flag; IVAS_QUATERNION Quaternion; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif error = IVAS_ERR_OK; st_ivas = hIvasDec->st_ivas; @@ -1517,13 +1515,11 @@ ivas_error IVAS_DEC_GetFormat( IVAS_DEC_BS_FORMAT *format /* o : format detected from bitstream fed to the decoder */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->hasDecodedFirstGoodFrame ) { *format = mapIvasFormat( hIvasDec->st_ivas->ivas_format ); @@ -1617,13 +1613,11 @@ ivas_error IVAS_DEC_GetNumOutputChannels( int16_t *numOutputChannels /* o : number of PCM output channels */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->hasDecodedFirstGoodFrame ) { *numOutputChannels = hIvasDec->st_ivas->hDecoderConfig->nchan_out; @@ -2456,13 +2450,11 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( int16_t partialCopyFrameType, partialCopyOffset; int16_t result; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL || au == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( auSize == 0 ) { return IVAS_ERR_OK; /* ignore empty/NO_DATA frame - shouldn't be transmitted in RTP */ @@ -2541,12 +2533,10 @@ ivas_error IVAS_DEC_VoIP_SetScale( const int16_t scale /* i : TSM scale to set in percent of the default frame size */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm == false ) { @@ -2580,13 +2570,11 @@ ivas_error IVAS_DEC_TSM_SetQuality( const float quality /* i : target TSM quality */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( !hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { return IVAS_ERR_TSM_NOT_ENABLED; @@ -2630,13 +2618,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( int16_t nSamplesRendered; uint8_t nOutChannels; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->hVoIP == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; @@ -2840,13 +2826,11 @@ ivas_error IVAS_DEC_Flush( uint16_t nSamplesToRender; uint16_t nSamplesFlushedLocal; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); nSamplesToRender = (uint16_t) *nSamplesFlushed; @@ -2876,13 +2860,11 @@ bool IVAS_DEC_VoIP_IsEmpty( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesAsked ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->nSamplesAvailableNext < nSamplesAsked ) ); } @@ -2988,11 +2970,7 @@ ivas_error IVAS_DEC_GetJbmData( IVAS_JBM_TRACE_DATA *JbmTraceData /* o : JBM Trace data */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL || JbmTraceData == NULL ) -#else - if ( hIvasDec->hVoIP == NULL ) -#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -3217,29 +3195,19 @@ static ivas_error printConfigInfo_dec( * Print decoder set-up info *---------------------------------------------------------------------*/ -#ifdef FIX_VOIP_FUNCTIONS ivas_error IVAS_DEC_PrintConfig( -#else -void IVAS_DEC_PrintConfig( -#endif const IVAS_DEC_HANDLE hIvasDec, const bool quietModeEnabled, const bool voipMode ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif printConfigInfo_dec( hIvasDec->st_ivas, hIvasDec->bitstreamformat, voipMode, quietModeEnabled ); -#ifdef FIX_VOIP_FUNCTIONS return IVAS_ERR_OK; -#else - return; -#endif } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 205d68cda..a35b33174 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -483,11 +483,7 @@ const char *IVAS_DEC_GetErrorMessage( ivas_error error /* i : decoder error code enum */ ); -#ifdef FIX_VOIP_FUNCTIONS ivas_error IVAS_DEC_PrintConfig( -#else -void IVAS_DEC_PrintConfig( -#endif const IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ const bool quietModeEnabled, /* i : quiet mode flag: if true, reduces the amount of config info printed */ const bool voipMode -- GitLab From 06cfbbe8b980dd5670f104a6d9ca61bf936730fe Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:58:07 +0200 Subject: [PATCH 56/65] [cleanup] accept FIX_1298_MEMORY_OPT_IVAS_CORE_ENC --- lib_com/options.h | 1 - lib_enc/ivas_core_enc.c | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d6766bcaf..a40c8a15d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC /* VA: issue 1298: Memory saving in ivas_core_enc() */ #define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ #define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 483387cb3..b3e8addc7 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -90,13 +90,8 @@ ivas_error ivas_core_enc( float *inp[CPE_CHANNELS]; float new_inp_resamp16k[CPE_CHANNELS][L_FRAME16k]; /* new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */ float old_syn_12k8_16k[CPE_CHANNELS][L_FRAME16k]; /* ACELP core synthesis at 12.8kHz or 16kHz to be used by the SWB BWE */ -#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC float *shb_speech; float *hb_speech; -#else - float shb_speech[L_FRAME16k]; - float hb_speech[L_FRAME16k / 4]; -#endif float *new_swb_speech; float new_swb_speech_buffer[L_FRAME48k + STEREO_DFT_OVL_MAX]; float bwe_exc_extended[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET]; @@ -159,9 +154,6 @@ ivas_error ivas_core_enc( input_Fs = sts[0]->input_Fs; input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); -#ifndef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC - set_f( new_swb_speech_buffer, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); -#endif for ( n = 0; n < n_CoreChannels; n++ ) { @@ -342,9 +334,7 @@ ivas_error ivas_core_enc( * WB BWE encoding *---------------------------------------------------------------------*/ -#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC hb_speech = new_swb_speech_buffer; /* reuse existing buffer: hb_speech[L_FRAME16k/4]; */ -#endif if ( input_Fs >= 16000 && st->bwidth < SWB && st->hBWE_TD != NULL ) { @@ -369,10 +359,8 @@ ivas_error ivas_core_enc( *---------------------------------------------------------------------*/ new_swb_speech = new_swb_speech_buffer + STEREO_DFT_OVL_MAX; -#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC set_f( new_swb_speech_buffer, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); shb_speech = new_inp_resamp16k[n]; /* reuse existing buffer: shb_speech[L_FRAME16k] */ -#endif if ( !st->Opt_SC_VBR && input_Fs >= 32000 && st->hBWE_TD != NULL ) { -- GitLab From ec3e611e880cc305c106c4188c27fd5492a850a3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:58:45 +0200 Subject: [PATCH 57/65] [cleanup] accept FIX_587_DEFAULT_REVERB --- apps/decoder.c | 3 --- apps/renderer.c | 3 --- lib_com/common_api_types.h | 3 --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 6 ------ lib_dec/lib_dec.c | 6 ------ lib_rend/ivas_dirac_dec_binaural_functions.c | 10 ---------- lib_rend/ivas_render_config.c | 3 --- lib_rend/ivas_reverb.c | 7 ------- lib_rend/lib_rend.c | 16 ---------------- 10 files changed, 58 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 6cdea851a..740ea25bf 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -658,9 +658,6 @@ int main( fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); goto cleanup; } -#ifndef FIX_587_DEFAULT_REVERB - renderConfig.roomAcoustics.override = true; -#endif } /* ISAR frame size is set from command line, not renderer config file. diff --git a/apps/renderer.c b/apps/renderer.c index e9a372d73..a01cb40c2 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1097,9 +1097,6 @@ int main( fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", aeID ); goto cleanup; } -#ifndef FIX_587_DEFAULT_REVERB - renderConfig.roomAcoustics.override = 1; -#endif } /* ISAR frame size is set from command line, not renderer config file. diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 3b4877a67..5fb7b349c 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -300,9 +300,6 @@ typedef enum typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { -#ifndef FIX_587_DEFAULT_REVERB - int16_t override; -#endif int16_t nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX]; /* Center frequencies for which following values are provided: */ float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX]; /* - The room's T60 per center frequency */ diff --git a/lib_com/options.h b/lib_com/options.h index a40c8a15d..30da6f39b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ #define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ #define FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX /* VA: issue 1249: remove obsolete code around ALLRAD decoder matrix */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 1e5d2c42b..03363b9ab 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1046,9 +1046,7 @@ ivas_error ivas_binRenderer_open( BINAURAL_RENDERER_HANDLE hBinRenderer; int16_t convBand, k; ivas_error error; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif error = IVAS_ERR_OK; @@ -1188,7 +1186,6 @@ ivas_error ivas_binRenderer_open( /* Allocate memories needed for reverb module */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ? &( st_ivas->hRenderConfig->roomAcoustics ) : NULL; if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, @@ -1203,9 +1200,6 @@ ivas_error ivas_binRenderer_open( NULL #endif ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 4f33fec56..a21a9feed 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2079,9 +2079,6 @@ static ivas_error copyRendererConfigStruct( hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; break; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; #endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; @@ -2167,9 +2164,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( { hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; #endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index bcac78d0f..1c98299dc 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -142,9 +142,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t num_poses, pos_idx; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif num_poses = 1; if ( st_ivas->hSplitBinRend != NULL ) { @@ -221,16 +219,12 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = NULL; -#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); -#endif } /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ @@ -242,7 +236,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, @@ -256,9 +249,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->earlyPartEneCorrection #endif ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 8f86e8012..887538a11 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -111,9 +111,6 @@ ivas_error ivas_render_config_init_from_rom( } #ifdef DEBUGGING ( *hRenderConfig )->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; -#endif -#ifndef FIX_587_DEFAULT_REVERB - ( *hRenderConfig )->roomAcoustics.override = FALSE; #endif ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; ( *hRenderConfig )->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_PRE_DELAY; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index c41b2492a..00b8f58e8 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1134,9 +1134,6 @@ ivas_error ivas_reverb_open( /* set reverb acoustic configuration based on renderer config */ #ifdef DEBUGGING pState->pConfig.renderer_type_override = hRenderConfig->renderer_type_override; -#endif -#ifndef FIX_587_DEFAULT_REVERB - pState->pConfig.roomAcoustics.override = hRenderConfig->roomAcoustics.override; #endif pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands; @@ -1905,11 +1902,7 @@ ivas_error ivas_binaural_reverb_init( error = IVAS_ERR_OK; -#ifdef FIX_587_DEFAULT_REVERB if ( roomAcoustics != NULL ) -#else - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) -#endif { #ifndef FIX_1139_REV_COLORATION_SHORT_T60 revTimes = t60; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2b2969a98..f478f0de1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4189,9 +4189,6 @@ int16_t IVAS_REND_GetRenderConfig( hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; break; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; #endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; @@ -4248,9 +4245,6 @@ int16_t IVAS_REND_FeedRenderConfig( hRenderConfig->renderer_type_override = renderConfig.renderer_type_override; #endif -#ifndef FIX_587_DEFAULT_REVERB - hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; -#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; hRenderConfig->roomAcoustics.inputPreDelay = renderConfig.roomAcoustics.inputPreDelay; @@ -8342,9 +8336,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t pos_idx; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif error = IVAS_ERR_OK; @@ -8423,21 +8415,16 @@ static ivas_error ivas_masa_ext_rend_parambin_init( if ( *inputMasa->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = NULL; -#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = &( hRendCfg->roomAcoustics ); -#endif } if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, @@ -8451,9 +8438,6 @@ static ivas_error ivas_masa_ext_rend_parambin_init( hDiracDecBin->earlyPartEneCorrection #endif ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif { return error; } -- GitLab From c3878f4200a389bd9c8fac18300d3911e2f8d2e7 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:59:21 +0200 Subject: [PATCH 58/65] [cleanup] accept NONBE_1214_PLC_LSF_MEMORY --- lib_com/options.h | 1 - lib_dec/core_switching_dec.c | 5 ----- lib_enc/core_switching_enc.c | 4 ---- 3 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 30da6f39b..192650e77 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ #define FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX /* VA: issue 1249: remove obsolete code around ALLRAD decoder matrix */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index eed017087..c6e7fe24c 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -263,14 +263,9 @@ ivas_error core_switching_pre_dec( st->uv_count = 0; } -#ifdef NONBE_1214_PLC_LSF_MEMORY if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) /* EVS and HQ -> ACELP */ || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 && st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) || ( st->core == ACELP_CORE && st->last_L_frame > L_FRAME16k ) /* TCX @ 25.6/32 kHz -> ACELP */ ) -#else - if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 && - st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) ) -#endif { if ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) { diff --git a/lib_enc/core_switching_enc.c b/lib_enc/core_switching_enc.c index 999e4e472..8edbd7587 100644 --- a/lib_enc/core_switching_enc.c +++ b/lib_enc/core_switching_enc.c @@ -171,13 +171,9 @@ void core_switching_pre_enc( st->uv_count = 0; } -#ifdef NONBE_1214_PLC_LSF_MEMORY if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) /* EVS and HQ -> ACELP */ || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && active_cnt == 1 ) || ( st->core == ACELP_CORE && st->last_L_frame > L_FRAME16k ) /* TCX @ 25.6/32 kHz -> ACELP */ ) -#else - if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && active_cnt == 1 ) ) -#endif { /* Reset the ACELP core in case of HQ->ACELP core switching */ -- GitLab From 43290a103a747cf2e0280d212a8e6ed53fcef7ce Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 20:59:53 +0200 Subject: [PATCH 59/65] [cleanup] accept NONBE_1293_SR_HRTF --- apps/decoder.c | 4 ---- lib_com/options.h | 1 - 2 files changed, 5 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 740ea25bf..b32d9d92c 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -285,11 +285,7 @@ int main( if ( arg.hrtfReaderEnabled ) { /* sanity check */ -#ifdef NONBE_1293_SR_HRTF if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { arg.hrtfReaderEnabled = false; fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 192650e77..c441a4a68 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ #define FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX /* VA: issue 1249: remove obsolete code around ALLRAD decoder matrix */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ -- GitLab From afa1b0bbee9280bf1d10d0c96740ba824741945c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 21:00:25 +0200 Subject: [PATCH 60/65] [cleanup] accept FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX --- lib_com/options.h | 1 - lib_dec/ivas_init_dec.c | 18 ------------------ lib_dec/ivas_output_config.c | 17 ----------------- 3 files changed, 36 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c441a4a68..baf799891 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX /* VA: issue 1249: remove obsolete code around ALLRAD decoder matrix */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ #define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 11a2c614b..1b53d7fc4 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -1521,15 +1521,6 @@ ivas_error ivas_init_decoder( { return error; } -#ifndef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->hOutSetup.is_loudspeaker_setup ) - { - if ( ( error = ivas_sba_get_hoa_dec_matrix( st_ivas->hOutSetup, &st_ivas->hoa_dec_mtx, st_ivas->hIntSetup.ambisonics_order ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ) != IVAS_ERR_OK ) @@ -1676,15 +1667,6 @@ ivas_error ivas_init_decoder( { return error; } -#ifndef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->hOutSetup.is_loudspeaker_setup ) - { - if ( ( error = ivas_sba_get_hoa_dec_matrix( st_ivas->hOutSetup, &st_ivas->hoa_dec_mtx, st_ivas->hIntSetup.ambisonics_order ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index f7cfa6f0a..d9d661c4e 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -326,21 +326,10 @@ void ivas_renderer_select( { *internal_config = output_config; } -#ifdef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX else { *internal_config = IVAS_AUDIO_CONFIG_HOA3; } -#else - else if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) - { - *internal_config = IVAS_AUDIO_CONFIG_FOA; - } - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) - { - *internal_config = IVAS_AUDIO_CONFIG_HOA3; - } -#endif *renderer_type = RENDERER_SBA_LINEAR_DEC; } else if ( ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || @@ -360,12 +349,6 @@ void ivas_renderer_select( { *renderer_type = RENDERER_DISABLE; } -#ifndef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX - else if ( ivas_format == SBA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO ) - { - *renderer_type = RENDERER_SBA_LINEAR_DEC; - } -#endif else if ( ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_OSBA_STEREO; -- GitLab From 308cadad77d6f4647e3c555be0b8660646f0ca5f Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 21:01:01 +0200 Subject: [PATCH 61/65] [cleanup] accept NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 23 ----------------------- lib_dec/ivas_objectRenderer_internal.c | 4 ---- lib_dec/ivas_omasa_dec.c | 12 ------------ 4 files changed, 40 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index baf799891..a43ba13bb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ #define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 90c48aab6..a09017758 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1645,11 +1645,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( ism_mode_old == ISM_MASA_MODE_DISC ) { -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *tc_local[MAX_NUM_OBJECTS]; -#else - float *tc_local[MAX_TRANSPORT_CHANNELS]; -#endif for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { @@ -1657,29 +1653,10 @@ ivas_error ivas_jbm_dec_flush_renderer( mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); } -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( st_ivas->nchan_ism > 0 ) - { - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - for ( ch_idx = 0; ch_idx < st_ivas->hDecoderConfig->nchan_out; ch_idx++ ) - { - set_zero( p_output[ch_idx], (int16_t) ( *nSamplesRendered ) ); - } - st_ivas->hTcBuffer->slots_rendered += 1; - st_ivas->hTcBuffer->subframes_rendered += 1; - } -#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index f4fdefee6..4ce42e01d 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -92,11 +92,7 @@ ivas_error ivas_td_binaural_renderer_sf( int16_t nchan_ism_internal, nchan_ism, ch_offset; /* Set the number of ISMs */ -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { nchan_ism_internal = st_ivas->nchan_ism; nchan_ism = st_ivas->nchan_ism; diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 594227665..24d5b05bc 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -738,26 +738,14 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ) { int16_t n; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float data_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; -#else - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#endif ivas_error error; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *p_sepobj[BINAURAL_CHANNELS]; -#else - float *p_sepobj[MAX_NUM_OBJECTS]; -#endif int16_t slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH for ( n = 0; n < BINAURAL_CHANNELS; n++ ) -#else - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) -#endif { p_sepobj[n] = &data_separated_objects[n][0]; } -- GitLab From 6bcd2667aa7b2c54919119e083f14ff9d8146b72 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 21:01:36 +0200 Subject: [PATCH 62/65] [cleanup] accept FIX_1369_HQ_LR_OVERFLOW --- lib_com/options.h | 1 - lib_enc/hq_lr_enc.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index a43ba13bb..f6d0e86ab 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ #define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ diff --git a/lib_enc/hq_lr_enc.c b/lib_enc/hq_lr_enc.c index c0b43f779..a66fa37d0 100644 --- a/lib_enc/hq_lr_enc.c +++ b/lib_enc/hq_lr_enc.c @@ -334,14 +334,10 @@ void hq_lr_enc( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef FIX_1369_HQ_LR_OVERFLOW #ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */ #else Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif -#else - Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ #endif Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); } -- GitLab From 2e3a8f0f3ee927f468419a16ef21b2ca393cdfec Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 21:02:22 +0200 Subject: [PATCH 63/65] [cleanup] accept NONBE_1118_EVS_LR_HQ_BITERROR --- lib_com/options.h | 1 - lib_dec/hq_lr_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index f6d0e86ab..d95f3b5f7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ diff --git a/lib_dec/hq_lr_dec.c b/lib_dec/hq_lr_dec.c index 9cbadc26d..730955e9a 100644 --- a/lib_dec/hq_lr_dec.c +++ b/lib_dec/hq_lr_dec.c @@ -612,7 +612,6 @@ void hq_lr_dec( IF( sub( i, highband ) >= 0 ) { -#ifdef NONBE_1118_EVS_LR_HQ_BITERROR /* safety check in case of bit errors */ if ( Ep_fx[i] > 536788991 /* max(Q30) */ ) { @@ -621,12 +620,10 @@ void hq_lr_dec( return; } -#endif enerH_fx = L_add( enerH_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ } ELSE IF( sub( i, lowband ) >= 0 ) { -#ifdef NONBE_1118_EVS_LR_HQ_BITERROR /* safety check in case of bit errors */ if ( Ep_fx[i] > 536788991 /* max(Q30) */ ) { @@ -635,7 +632,6 @@ void hq_lr_dec( return; } -#endif enerL_fx = L_add( enerL_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ } } -- GitLab From 56ee22a242dc7076df820a3a2fb1731142571f22 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 21:03:00 +0200 Subject: [PATCH 64/65] [cleanup] accept FIX_1139_REV_COLORATION_SHORT_T60 --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 2 -- lib_dec/lib_dec.c | 4 --- lib_rend/ivas_dirac_dec_binaural_functions.c | 2 -- lib_rend/ivas_prot_rend.h | 2 -- lib_rend/ivas_reverb.c | 29 -------------------- lib_rend/lib_rend.c | 6 ---- 7 files changed, 46 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d95f3b5f7..39bd30048 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 03363b9ab..08f3f33e6 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1195,10 +1195,8 @@ ivas_error ivas_binRenderer_open( st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a21a9feed..f8fb823fb 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2216,10 +2216,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; @@ -2238,10 +2236,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 1c98299dc..e8a29a519 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -244,10 +244,8 @@ ivas_error ivas_dirac_dec_init_binaural_data( output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , hDiracDecBin->earlyPartEneCorrection -#endif ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 052fe997c..1e8ffa6bc 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -917,10 +917,8 @@ ivas_error ivas_binaural_reverb_init( const int32_t sampling_rate, /* i : sampling rate */ const float *defaultTimes, /* i : default reverberation times */ const float *defaultEne /* i : default reverberation energies */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , float *earlyEne /* i/o: Early part energies to be modified */ -#endif ); diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 00b8f58e8..f3df5809a 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -56,9 +56,7 @@ #define CLDFB_SLOTS_PER_SECOND 800 /* Used for initializing reverb */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 #define REV_TIME_THRESHOLD ( 0.2f ) -#endif #define INNER_BLK_SIZE 80 /* size of data blocks used for more efficient delay line and IIR filter processing */ /* should be a divisor of the frame length at any sampling rate and an even number*/ @@ -258,7 +256,6 @@ static void ivas_binaural_reverb_setReverbTimes( } currentEnergy *= attenuationFactorPerSampleSq; } -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 /* In some configurations with small T60s it is possible the number of taps randomizes to zero. Ensure at least 1 filter tap. */ if ( tap == 0 ) @@ -269,7 +266,6 @@ static void ivas_binaural_reverb_setReverbTimes( tap = 1; actualizedEnergy = 1; } -#endif hReverb->taps[bin][ch] = tap; /* Number of taps determined at the above random procedure */ } @@ -1881,39 +1877,21 @@ ivas_error ivas_binaural_reverb_init( const int32_t sampling_rate, /* i : sampling rate */ const float *defaultTimes, /* i : default reverberation times */ const float *defaultEne /* i : default reverberation energies */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , float *earlyEne /* i/o: Early part energies to be modified */ -#endif ) { ivas_error error; -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 int16_t preDelay, bin; float revTimes[CLDFB_NO_CHANNELS_MAX]; float revEne[CLDFB_NO_CHANNELS_MAX]; -#else - const float *revTimes; - const float *revEne; - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; - int16_t preDelay; -#endif error = IVAS_ERR_OK; if ( roomAcoustics != NULL ) { -#ifndef FIX_1139_REV_COLORATION_SHORT_T60 - revTimes = t60; - revEne = ene; -#endif -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfStatistics, sampling_rate, revTimes, revEne ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfStatistics, sampling_rate, t60, ene ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1921,20 +1899,14 @@ ivas_error ivas_binaural_reverb_init( } else { -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) { revTimes[bin] = defaultTimes[bin]; revEne[bin] = defaultEne[bin]; } -#else - revTimes = defaultTimes; - revEne = defaultEne; -#endif preDelay = 10; } -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) { /* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid @@ -1966,7 +1938,6 @@ ivas_error ivas_binaural_reverb_init( } } } -#endif error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index f478f0de1..c60570099 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4311,10 +4311,8 @@ int16_t IVAS_REND_FeedRenderConfig( *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; @@ -4331,10 +4329,8 @@ int16_t IVAS_REND_FeedRenderConfig( *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , NULL -#endif ) ) != IVAS_ERR_OK ) { return error; @@ -8433,10 +8429,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , hDiracDecBin->earlyPartEneCorrection -#endif ) ) != IVAS_ERR_OK ) { return error; -- GitLab From 09bff3259efb329e1cf4d21d3b517c79171df8c9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 26 Aug 2025 21:06:19 +0200 Subject: [PATCH 65/65] formatting --- lib_com/bits_alloc.c | 6 +- lib_com/ivas_stereo_td_bit_alloc.c | 14 +-- lib_com/options.h | 1 - lib_com/prot.h | 22 ++-- lib_dec/acelp_core_dec.c | 22 ++-- lib_dec/ivas_binRenderer_internal.c | 7 +- lib_dec/ivas_dirac_dec.c | 102 +++++++++---------- lib_dec/ivas_ism_param_dec.c | 8 +- lib_dec/lib_dec.c | 12 +-- lib_enc/acelp_core_enc.c | 16 +-- lib_enc/ivas_dirac_enc.c | 4 +- lib_enc/ivas_init_enc.c | 6 +- lib_enc/ivas_masa_enc.c | 2 +- lib_enc/ivas_mct_enc_mct.c | 8 +- lib_enc/ivas_qmetadata_enc.c | 4 +- lib_rend/ivas_dirac_dec_binaural_functions.c | 14 +-- lib_rend/ivas_efap.c | 4 +- lib_rend/ivas_objectRenderer.c | 16 +-- lib_rend/ivas_objectRenderer_sfx.c | 2 +- lib_rend/ivas_objectRenderer_sources.c | 2 +- lib_rend/ivas_reverb.c | 6 +- lib_rend/ivas_stat_rend.h | 18 ++-- lib_rend/lib_rend.c | 18 ++-- lib_util/hrtf_file_reader.c | 10 +- lib_util/masa_file_writer.c | 7 +- lib_util/masa_file_writer.h | 2 +- lib_util/render_config_reader.c | 2 +- 27 files changed, 156 insertions(+), 179 deletions(-) diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index 36161a6f5..4b1266187 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -552,9 +552,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ) { int16_t i, bits, nb_subfr; diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 72eddca8f..7c2c004d6 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -440,9 +440,9 @@ void tdm_bit_alloc( *-------------------------------------------------------------------*/ void td_stereo_param_updt( - const float lsp_old_PCh[], /* i : primary channel old LSPs */ - const float lsf_old_PCh[], /* i : primary channel old LSFs */ - const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ + const float lsp_old_PCh[], /* i : primary channel old LSPs */ + const float lsf_old_PCh[], /* i : primary channel old LSFs */ + const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ @@ -458,10 +458,10 @@ void td_stereo_param_updt( } else if ( flag_ACELP16k == 1 ) { - float lsp_temp[M]; - mvr2r( lsp_old_PCh, lsp_temp, M ); - lsp_convert_poly( lsp_temp, L_FRAME, 0 ); - lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); + float lsp_temp[M]; + mvr2r( lsp_old_PCh, lsp_temp, M ); + lsp_convert_poly( lsp_temp, L_FRAME, 0 ); + lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } else { diff --git a/lib_com/options.h b/lib_com/options.h index 39bd30048..eae06258d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,7 +159,6 @@ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ - #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 6d3e44931..b917d41dc 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4507,14 +4507,14 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ); void bass_psfilter_init( @@ -9068,9 +9068,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel*/ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const int16_t idchan, /* i : channel id */ - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ); /*! r: ACELP16k flag */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 3e6197c87..c5ae6c1ae 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -67,14 +67,14 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ) { float old_exc[L_EXC_DEC], *exc; /* excitation signal buffer */ @@ -653,10 +653,10 @@ ivas_error acelp_core_dec( else { const float *pt_interp_2; - int16_t beta_index; + int16_t beta_index; - beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); - tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); + beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); + tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); if ( st->rate_switching_reset ) { diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 08f3f33e6..61ff16144 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1194,14 +1194,11 @@ ivas_error ivas_binRenderer_open( pRoomAcoustics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, - st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections - , - NULL - ) ) != IVAS_ERR_OK ) + st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections, + NULL ) ) != IVAS_ERR_OK ) { return error; } - } else { diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 7f6857298..4ea1e1160 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -973,8 +973,8 @@ void ivas_dirac_dec_read_BS( int16_t *nb_bits, /* o : number of bits read */ const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ - const int16_t nchan_transport, /* i : number of transport channels */ - int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ + const int16_t nchan_transport, /* i : number of transport channels */ + int16_t *dirac_to_spar_md_bands /* o : DirAC->SPAR MD bands */ ) { int16_t i, j, b, dir, orig_dirac_bands; @@ -2223,73 +2223,73 @@ void ivas_dirac_dec_render_sf( /* render objects in combined format onto the CICP19 channels for BINAURAL_ROOM_IR */ if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { - int16_t j, k, l; - int16_t num_objects, nchan_out_woLFE; - int16_t az1, el1; - int16_t n_slots_to_render; - int16_t n_samples_to_render; - float gain, prev_gain; + int16_t j, k, l; + int16_t num_objects, nchan_out_woLFE; + int16_t az1, el1; + int16_t n_slots_to_render; + int16_t n_samples_to_render; + float gain, prev_gain; - num_objects = st_ivas->nchan_ism; - nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; - n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; - n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render; + num_objects = st_ivas->nchan_ism; + nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; + n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; + n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render; - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) - { - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); - st_ivas->hIsmRendererData->interp_offset = 0; - } + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) + { + ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); + st_ivas->hIsmRendererData->interp_offset = 0; + } - for ( i = 0; i < num_objects; i++ ) + for ( i = 0; i < num_objects; i++ ) + { + /* Combined rotation: rotate the object positions depending the head and external orientations */ + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) { - /* Combined rotation: rotate the object positions depending the head and external orientations */ - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) + rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &az1, &el1, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); + if ( st_ivas->hEFAPdata != NULL ) { - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &az1, &el1, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); - if ( st_ivas->hEFAPdata != NULL ) - { - efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], az1, el1, EFAP_MODE_EFAP ); - } + efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], az1, el1, EFAP_MODE_EFAP ); } + } - for ( j = 0; j < nchan_out_woLFE; j++ ) + for ( j = 0; j < nchan_out_woLFE; j++ ) + { + gain = st_ivas->hIsmRendererData->gains[i][j]; + prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; + if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) { - gain = st_ivas->hIsmRendererData->gains[i][j]; - prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; - if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) - { - float *tc_re, *tc_im; - float *w1, w2; + float *tc_re, *tc_im; + float *w1, w2; - w1 = &st_ivas->hIsmRendererData->interpolator[st_ivas->hIsmRendererData->interp_offset]; + w1 = &st_ivas->hIsmRendererData->interpolator[st_ivas->hIsmRendererData->interp_offset]; - tc_re = pppQMfFrame_ts_re[nchan_transport + i][0]; - tc_im = pppQMfFrame_ts_im[nchan_transport + i][0]; + tc_re = pppQMfFrame_ts_re[nchan_transport + i][0]; + tc_im = pppQMfFrame_ts_im[nchan_transport + i][0]; - for ( k = 0; k < n_slots_to_render; k++ ) - { - float g; + for ( k = 0; k < n_slots_to_render; k++ ) + { + float g; - w2 = 1.0f - *w1; - g = ( *w1 * gain + w2 * prev_gain ); + w2 = 1.0f - *w1; + g = ( *w1 * gain + w2 * prev_gain ); - for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) - { - Cldfb_RealBuffer[j][k][l] += g * *( tc_re++ ); - Cldfb_ImagBuffer[j][k][l] += g * *( tc_im++ ); - } - w1 += hSpatParamRendCom->num_freq_bands; + for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) + { + Cldfb_RealBuffer[j][k][l] += g * *( tc_re++ ); + Cldfb_ImagBuffer[j][k][l] += g * *( tc_im++ ); } + w1 += hSpatParamRendCom->num_freq_bands; } + } - /* update here only in case of head rotation */ - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) - { - st_ivas->hIsmRendererData->prev_gains[i][j] = gain; - } + /* update here only in case of head rotation */ + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) + { + st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } } + } st_ivas->hIsmRendererData->interp_offset += hSpatParamRendCom->num_freq_bands * st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; } diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 117ae08c1..4845004dc 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -711,9 +711,7 @@ void ivas_ism_dec_digest_tc( if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_OSBA_AMBI || - st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV - || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - ) + st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) { st_ivas->hIsmRendererData->interpolator[0] = 0.0f; for ( i = 1; i < interpolator_length; i++ ) @@ -752,9 +750,7 @@ void ivas_ism_dec_digest_tc( if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_LS || - st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM - || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) - ) && + st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) && st_ivas->hCombinedOrientationData == NULL ) { if ( st_ivas->hIntSetup.is_planar_setup ) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index f8fb823fb..df0aed1eb 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2215,10 +2215,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -2235,10 +2233,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 40fc8a601..dfa6766d4 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -415,14 +415,14 @@ ivas_error acelp_core_enc( else { const float *pt_interp_2; - int16_t beta_index; - float lsf_wgts[M]; - - /* intra_frame prediction for the LSFs */ - lsp2lsf( lsp_new, lsf_new, M, 12800 ); - Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); - tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); - push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); + int16_t beta_index; + float lsf_wgts[M]; + + /* intra_frame prediction for the LSFs */ + lsp2lsf( lsp_new, lsf_new, M, 12800 ); + Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); + tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); + push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); pt_interp_2 = interpol_frac_12k8; if ( tdm_low_rate_mode == 1 && st->coder_type > UNVOICED ) diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index a36566b91..1a6290580 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -291,8 +291,8 @@ ivas_error ivas_dirac_enc( const int16_t input_frame, /* i : input frame length */ const int16_t dtx_vad, /* i : DTX vad flag */ const IVAS_FORMAT ivas_format, /* i : ivas format */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t hodirac_flag /* i : hodirac flag */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t hodirac_flag /* i : hodirac flag */ ) { int16_t orig_dirac_bands; diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index f7d0cc9f9..89d4d6ddf 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -138,9 +138,9 @@ void ivas_write_format( void ivas_write_format_sid( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t element_mode, /* i : element bitrate */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int16_t sba_planar /* i : SBA planar flag */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + const int16_t sba_order, /* i : Ambisonic (SBA) order */ + const int16_t sba_planar /* i : SBA planar flag */ ) { int16_t ind = 0; /* to avoid compilation warning */ diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 37f13d57a..7a4a250fe 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -2702,7 +2702,7 @@ void ivas_merge_masa_metadata( hMeta->directional_meta[merge_dest].elevation[sf][band] = hOMasaMeta->directional_meta[0].elevation[sf][band]; /* limit with the earlier direct-energy ratio */ - dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hOmasaEnergy->energy_ism[sf][band] ); /* new dir ratio */ + dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hOmasaEnergy->energy_ism[sf][band] ); /* new dir ratio */ hMeta->directional_meta[merge_dest].energy_ratio[sf][band] = min( dir_sum, hOMasaMeta->directional_meta[0].energy_ratio[sf][band] ); /* clip with original ISM dir */ hMeta->common_meta.diffuse_to_total_ratio[sf][band] = 1.0f - hMeta->directional_meta[merge_dest].energy_ratio[sf][band]; diff --git a/lib_enc/ivas_mct_enc_mct.c b/lib_enc/ivas_mct_enc_mct.c index 0024e1a47..feefd008e 100644 --- a/lib_enc/ivas_mct_enc_mct.c +++ b/lib_enc/ivas_mct_enc_mct.c @@ -814,10 +814,10 @@ void write_mct_bitstream( *--------------------------------------------------------------------*/ void mctStereoIGF_enc( - MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ - Encoder_State **sts, /* i/o: encoder state structure */ - float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ - float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ + MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ + Encoder_State **sts, /* i/o: encoder state structure */ + float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ + float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect.*/ float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 4a9d1a89e..09a209840 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -958,8 +958,8 @@ void ivas_qmetadata_enc_sid_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure */ - const int16_t nchan_transport, /* i : number of transport channels */ - const int16_t ivas_format /* i : IVAS format */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t ivas_format /* i : IVAS format */ ) { int16_t b, m; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index e8a29a519..a5031b66d 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -129,7 +129,7 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR *------------------------------------------------------------------------*/ ivas_error ivas_dirac_dec_init_binaural_data( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ ) { @@ -243,10 +243,8 @@ ivas_error ivas_dirac_dec_init_binaural_data( pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections - , - hDiracDecBin->earlyPartEneCorrection - ) ) != IVAS_ERR_OK ) + ( *phHrtfParambin )->parametricReverberationEneCorrections, + hDiracDecBin->earlyPartEneCorrection ) ) != IVAS_ERR_OK ) { return error; } @@ -2418,8 +2416,7 @@ static void getDirectPartGains( float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { float aziRad, eleRad; float y, mappedX, aziRadMapped, A, A2, A3; @@ -2492,8 +2489,7 @@ static void hrtfShGetHrtf( float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { int16_t k; float( *hrtfShCoeffsReInt )[16][60]; diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 2a27d1277..13baefbd7 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -151,7 +151,7 @@ ivas_error efap_init_data( const int16_t efap_mode /* i : indicates whether EFAP or EFIP is used */ ) { -/* Handle instance declaration */ + /* Handle instance declaration */ int8_t polyset_size; EFAP *efap; ivas_error error; @@ -1520,7 +1520,7 @@ static void add_vertex( /* Final Idx */ vtxArray[pos].idx = (int16_t) idxAziTmp + 181 * (int16_t) idxEleTmp; -/* Setting the nan flag to 0 */ + /* Setting the nan flag to 0 */ vtxArray[pos].isNaN = false; /* Set the default downmix type */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index e10770616..1b5a7d049 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -60,13 +60,13 @@ static void angles_to_vec( const float radius, const float azimuth, const float *---------------------------------------------------------------------*/ ivas_error ivas_td_binaural_open_unwrap( - TDREND_HRFILT_FiltSet_t **hHrtfTD, /* i/o: HR filter model (from file or NULL) */ - const int32_t output_Fs, /* i : Output sampling rate */ - const int16_t nchan_transport, /* i : Number of channels */ - const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ - const AUDIO_CONFIG transport_config, /* i : Transport configuration */ - const float *directivity, /* i : Directivity pattern (used for ISM) */ - const float *distAtt, /* i : Distance attenuation (used for ISM) */ + TDREND_HRFILT_FiltSet_t **hHrtfTD, /* i/o: HR filter model (from file or NULL) */ + const int32_t output_Fs, /* i : Output sampling rate */ + const int16_t nchan_transport, /* i : Number of channels */ + const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ + const AUDIO_CONFIG transport_config, /* i : Transport configuration */ + const float *directivity, /* i : Directivity pattern (used for ISM) */ + const float *distAtt, /* i : Distance attenuation (used for ISM) */ const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -425,7 +425,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ - const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ) { int16_t i; diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index d00a8e25d..8414394ba 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -260,7 +260,7 @@ void TDREND_firfilt( /* Handle memory */ p_signal = buffer + filterlength - 1; - mvr2r( mem, buffer, filterlength - 1 ); /* Insert memory */ + mvr2r( mem, buffer, filterlength - 1 ); /* Insert memory */ mvr2r( signal, p_signal, subframe_length ); /* Insert current frame */ mvr2r( p_signal + subframe_length - filterlength + 1, mem, filterlength - 1 ); /* Update memory for next frame */ diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 2b2b18ebd..90b975204 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -285,7 +285,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ - TDREND_SRC_t *Src_p /* i/o: Source pointer */ + TDREND_SRC_t *Src_p /* i/o: Source pointer */ ) { TDREND_MIX_Listener_t *Listener_p; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index f3df5809a..af357ae22 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -107,9 +107,9 @@ typedef struct ivas_reverb_params_t float *pFc; /* Center frequencies for FFT filter design */ float *pRt60; /* RT60 values at these frequencies */ float *pDsr; /* DSR values at these frequencies */ - const float *pHrtf_avg_pwr_response_l_const; /* The HRTF set's average left ear power response */ - const float *pHrtf_avg_pwr_response_r_const; /* The HRTF set's average right ear power response */ - const float *pHrtf_inter_aural_coherence_const; /* The HRTF set's inter-aural coherence for diffuse sound */ + const float *pHrtf_avg_pwr_response_l_const; /* The HRTF set's average left ear power response */ + const float *pHrtf_avg_pwr_response_r_const; /* The HRTF set's average right ear power response */ + const float *pHrtf_inter_aural_coherence_const; /* The HRTF set's inter-aural coherence for diffuse sound */ int16_t do_corr_filter; /* Flag indicating whether correlation filters should be used. */ /* Correlation only supported and needed for binaural playback (i.e. */ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 06ea39419..ee062c547 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -573,11 +573,11 @@ typedef struct ivas_binaural_rendering_conv_module_struct typedef struct EFAP_VERTEX { - float azi; /* azimuth of the loudspeaker */ - float ele; /* elevation of the loudspeaker */ - float pos[3]; /* [x y z] cartesian coordinate vector */ - int16_t idx; /* integer, that corresponds to the first index for the LS in the 1D output */ - bool isNaN; /* used to indicate if the vertex is a virtual speaker */ + float azi; /* azimuth of the loudspeaker */ + float ele; /* elevation of the loudspeaker */ + float pos[3]; /* [x y z] cartesian coordinate vector */ + int16_t idx; /* integer, that corresponds to the first index for the LS in the 1D output */ + bool isNaN; /* used to indicate if the vertex is a virtual speaker */ EFAP_VTX_DMX_TYPE dmxType; /* virtual speaker downmix type */ } EFAP_VERTEX; @@ -592,8 +592,8 @@ typedef struct EFAP_VERTEX_DATA typedef struct EFAP_POLYSET { - int16_t chan[EFAP_MAX_CHAN_NUM]; /* An array indicating the loudspeaker index of the polygon vertices */ - bool isNaN[EFAP_MAX_CHAN_NUM]; /* Indicates if one of the vertices isNaN */ + int16_t chan[EFAP_MAX_CHAN_NUM]; /* An array indicating the loudspeaker index of the polygon vertices */ + bool isNaN[EFAP_MAX_CHAN_NUM]; /* Indicates if one of the vertices isNaN */ int16_t numChan; /* An integer between 0 and EFAP_MAX_CHAN_NUM corresponding to the number of vertices of the polygon */ float polyAzi[EFAP_MAX_CHAN_NUM]; /* An array (same length as "chan"), with the azimuth of the channels */ float polyEle[EFAP_MAX_CHAN_NUM]; /* An array (same length as "chan"), with the elevation of the channels */ @@ -609,9 +609,9 @@ typedef struct EFAP_LS_TRIANGLE typedef struct EFAP_POLYSET_DATA { EFAP_POLYSET *polysetArray; /* Array of polygons */ - int16_t numPoly; /* Number of polygons */ + int16_t numPoly; /* Number of polygons */ EFAP_LS_TRIANGLE *triArray; /* Array of triangles */ - int16_t numTri; /* Number of triangles */ + int16_t numTri; /* Number of triangles */ } EFAP_POLYSET_DATA; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c60570099..68d5d4558 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4310,10 +4310,8 @@ int16_t IVAS_REND_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -4328,10 +4326,8 @@ int16_t IVAS_REND_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, - NULL - , - NULL - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -8428,10 +8424,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections - , - hDiracDecBin->earlyPartEneCorrection - ) ) != IVAS_ERR_OK ) + ( *phHrtfParambin )->parametricReverberationEneCorrections, + hDiracDecBin->earlyPartEneCorrection ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index c23d28cbb..8943f2460 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1049,9 +1049,9 @@ static ivas_error create_HRTF_from_rawdata( static ivas_error create_fastconv_HRTF_from_rawdata( - HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ - char *hrtf_data, /* i : pointer to binary file */ - HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ + HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ + char *hrtf_data, /* i : pointer to binary file */ + HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ BINAURAL_INPUT_AUDIO_CONFIG input_cfg /* i : Input binaural config */ ) { @@ -1083,7 +1083,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( hrtf_data_rptr = hrtf_data; -/* HRIR */ + /* HRIR */ if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { ( *hHRTF )->FASTCONV_HRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); @@ -1311,7 +1311,7 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -/* BRIR */ + /* BRIR */ else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { ( *hHRTF )->FASTCONV_BRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index 0f5d5ec2b..f3431a2b6 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -88,9 +88,8 @@ static void getExtMasaMetadataFileName( static void delayMasaMetadata( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */ - MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ - uint8_t delayNsf -) + MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ + uint8_t delayNsf ) { int16_t dir, sf, band; uint8_t currentNumberOfDirections; @@ -234,7 +233,7 @@ ivas_error MasaFileWriter_open( *---------------------------------------------------------------------*/ ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ ) diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index 7b7497232..74d098388 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -47,7 +47,7 @@ ivas_error MasaFileWriter_open( ); ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ ); diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index b06e92a23..b26003f52 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -124,7 +124,7 @@ struct RenderConfigReader AcousticEnv *pAE; /* Acoustic environments */ uint32_t nDP; /* Number of directivity patterns */ DirectrivityPat *pDP; /* Directivity Pattern */ - float distAtt[3]; /* [MaxDist, RefDist, Rolloff] */ + float distAtt[3]; /* [MaxDist, RefDist, Rolloff] */ }; -- GitLab