diff --git a/apps/decoder.c b/apps/decoder.c index 09b40cda9c1dde8462669a93d8a6e275ceea9c4f..2cd7608cbcb39827245b4c9e0c69d25ae579d897 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -43,9 +43,7 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION #include "aeid_file_reader.h" -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" #endif @@ -93,7 +91,6 @@ static * Local structure for storing cmdln arguments *------------------------------------------------------------------------------------------*/ -#ifdef FIX_1053_REVERB_RECONFIGURATION typedef struct { uint16_t *pID; @@ -102,7 +99,6 @@ typedef struct uint16_t selected; uint16_t frameCounter; } AcousticEnvironmentSequence; -#endif typedef struct { @@ -155,11 +151,7 @@ typedef struct uint16_t tsmScale; #endif #endif -#ifdef FIX_1053_REVERB_RECONFIGURATION AcousticEnvironmentSequence aeSequence; -#else - uint16_t acousticEnvironmentId; -#endif int16_t Opt_dpid_on; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; @@ -456,14 +448,9 @@ int main( *------------------------------------------------------------------------------------------*/ asked_frame_size = arg.renderFramesize; -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; 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 ) -#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 ) ); goto cleanup; @@ -663,13 +650,11 @@ int main( fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); 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 #ifdef SPLIT_REND_WITH_HEAD_ROT if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { @@ -698,11 +683,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 ) { @@ -712,11 +693,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; } renderConfig.roomAcoustics.override = true; @@ -931,13 +908,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 ); @@ -1153,15 +1128,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; @@ -1545,7 +1516,6 @@ static bool parseCmdlIVAS_dec( if ( !is_digits_only( argv[i] ) ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION aeidFileReader *aeidReader = NULL; if ( aeidFileReader_open( argv[i], &aeidReader ) != IVAS_ERR_OK ) @@ -1565,13 +1535,7 @@ static bool parseCmdlIVAS_dec( aeidFileReader_close( &aeidReader ); i++; -#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 */ @@ -1586,9 +1550,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 ) { @@ -1834,13 +1795,9 @@ 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 | File : Acoustic environment ID (number > 0)\n" ); fprintf( stdout, " alternatively, it can be a text file where each line contains \"ID duration\"\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 +2226,6 @@ static ivas_error decodeG192( } #endif -#ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; @@ -2293,7 +2249,6 @@ static ivas_error decodeG192( goto cleanup; } } -#endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { @@ -2504,7 +2459,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 ) { @@ -2535,7 +2489,6 @@ static ivas_error decodeG192( } } } -#endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmScaleFileEnabled ) @@ -2974,9 +2927,7 @@ static ivas_error decodeG192( cleanup: -#ifdef FIX_1053_REVERB_RECONFIGURATION RenderConfigReader_close( &renderConfigReader ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT split_rend_reader_writer_close( &splitRendWriter ); #endif diff --git a/apps/renderer.c b/apps/renderer.c index 42ed96ce73c847ebf388c1aafd472f3df2ef8a6a..613d4da656b4e55ffc35890bcb77048caa02330f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -45,9 +45,7 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION #include "aeid_file_reader.h" -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT #include "split_render_file_read_write.h" #include "split_rend_bfi_file_reader.h" @@ -145,7 +143,6 @@ typedef struct IVAS_CUSTOM_LS_DATA outSetupCustom; } OutputConfig; -#ifdef FIX_1053_REVERB_RECONFIGURATION typedef struct { uint16_t *pID; @@ -154,7 +151,6 @@ typedef struct uint16_t selected; uint16_t frameCounter; } AcousticEnvironmentSequence; -#endif typedef struct { @@ -195,11 +191,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 @@ -402,11 +394,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) alternatively, it can be a text file where each line contains \"ID duration\" for BINAURAL_ROOM_REVERB output configuration.", -#else - .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration", -#endif }, }; @@ -740,10 +728,8 @@ int main( int16_t zeroPadToWrite = 0; int32_t delayTimeScale = 0; int16_t i, numChannels; -#ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; uint16_t aeID; -#endif ivas_error error = IVAS_ERR_OK; #ifdef WMOPS @@ -1058,9 +1044,6 @@ int main( if ( args.renderConfigFilePath[0] != '\0' ) { -#ifndef FIX_1053_REVERB_RECONFIGURATION - IVAS_RENDER_CONFIG_DATA renderConfig; -#endif /* sanity check */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1095,12 +1078,8 @@ int main( 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 ) { @@ -1110,11 +1089,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", args.acousticEnvironmentId ); -#endif exit( -1 ); } renderConfig.roomAcoustics.override = 1; @@ -1545,16 +1520,11 @@ 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 ) { if ( ++args.aeSequence.frameCounter >= args.aeSequence.pValidity[args.aeSequence.selected] ) { -#ifndef FIX_1053_REVERB_RECONFIGURATION - IVAS_RENDER_CONFIG_DATA renderConfig; - -#endif if ( ++args.aeSequence.selected >= args.aeSequence.count ) { args.aeSequence.selected = 0; @@ -1580,7 +1550,6 @@ int main( } } } -#endif numSamplesRead = 0; /* Read the input data */ @@ -2079,13 +2048,11 @@ cleanup: } #endif -#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] ); @@ -2554,7 +2521,6 @@ static bool parseLfePositionConfig( } -#ifdef FIX_1053_REVERB_RECONFIGURATION static bool parseAcousticEnvironmentIds( const char *value, AcousticEnvironmentSequence *aeSequence ) @@ -2597,7 +2563,6 @@ static bool parseAcousticEnvironmentIds( return true; } -#endif static bool checkRequiredArgs( @@ -2708,15 +2673,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; } @@ -2888,19 +2849,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/common_api_types.h b/lib_com/common_api_types.h index 0d596030ce1e810c4e11d17dbca57546e2f44921..80529cd40b17457c5bf66f0c84e5e416fe07e159 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -335,9 +335,7 @@ typedef struct _IVAS_RENDER_CONFIG ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; #endif float directivity[IVAS_MAX_NUM_OBJECTS * 3]; -#ifdef CONF_DISTATT float distAtt[3]; -#endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index b803c9860a4b925dff01c59baa9489b08ce52ee9..8b01d70b56fc6a1395bbd1f154f239dd1e1f7dcb 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1424,9 +1424,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; @@ -1458,17 +1455,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/ivas_filters.c b/lib_com/ivas_filters.c index 2c60e8743dfd7ab77e6d9c5c45e9ae0ac6488381..cf5a0cc049b7c6f27ea46f349ac52ad68ff6d5b7 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 34e3a9925c2134f988b55752d398c346e6add446..0e29fcc7d6e333536e11386cd2f3801e7d3f45a8 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 258a8b0f9187638629d9ec0c664e5210420276cd..e3f77a046cf48635116ad8f4140c56f8ccebbb4c 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3207,9 +3207,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 */ ); @@ -3518,12 +3516,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 SPAR 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 */ @@ -3626,9 +3622,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 */ ); @@ -3684,9 +3678,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 */ ); @@ -5517,11 +5509,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 c0c8de6ad5141392f4e4f3966c6899ca9165fc78..ffd5d578de259c6679e12d2c6af3dc5e88102f84 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -3079,22 +3079,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 = { { 16384, 14924, 13463, 12003, 10542, 9082, 7622, 6161, diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index a87d186465c880a6ddcb0e15cedd4ee4f1fba317..59830626488ac34efaf94539acae805bc4c1c309 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -348,11 +348,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/ivas_sba_config.c b/lib_com/ivas_sba_config.c index a622d8f88fc69249d77eba8c4055f588bb8b68fc..4c5313de3ba57f41df793afed36af6726ead402d 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -158,7 +158,6 @@ int16_t ivas_sba_get_nchan( return ( nb_channels ); } -#ifdef NONBE_FIX_1052_SBA_EXT /*-------------------------------------------------------------------* * ivas_sba_spar_sid_bitlen() * @@ -180,7 +179,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 2a276156810a4c8ba2bffdf0fe62b8ca1daac5a8..ea4a4576ec2b3782d3db9ee4ed312d1f8c78d708 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,15 +167,9 @@ //#define FIX_CREND_FIX_POINT_HRTF_FILE_FORMAT /* Orange issue 1031 : new fix point hrtf binary file format */ //#define FIX_CREND_SIMPLIFY_CODE /* Ora : simplify line code in crend */ #define FLOAT_FIX_POINT_HRTF_FILE_FORMAT /* allows reading floation or fix point hrtf binary file format */ -#define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ -#define CONF_DISTATT /* Eri: Make distance attenuation configurable */ #define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ -#define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ -#define FIX_989_TD_REND_ROM /* Eri: Clean-up for TD renderer and completion of ROM generation tool */ -#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_1050_EFAP_ALLOC /* FhG: issue 1050: reduction of memory allocated to EFAP handle */ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ @@ -185,15 +179,7 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */ #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 NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ -#define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ -#define NONBE_FIX_1069_SVD_TUNING /* FhG: issue 1069: tune SVD constants */ -#define NONBE_FIX_1087_OOB_SBA_DTX_RS /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */ -#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 NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ -#define NONBE_FIX_1096_NAN_VALUES_IN_DIRAC_TO_STEREO /* FhG: avoid sidegain DFT-Stereo param to be larger than 1 when converting from Dirac parameters */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 7258a684892176fd74a48ee916a4b3436121ef71..6eed547360ba08a53bfce4b48193d9ec03c147ab 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() @@ -905,11 +903,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++ ) { @@ -1118,11 +1112,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; error = IVAS_ERR_OK; @@ -1277,19 +1267,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]; - } - } - } -#endif } else { diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index 5f5e787c9407a72f4d6061cc9294fd8e1d4d911d..b8eee14f61c1faba18895011d407fb8a6ec02f58 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_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 692782bda8ecee2306615c87796f397c4ebe9af4..2c91532b038226e29416096f4dbc1834c1609ff1 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -1012,10 +1012,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 */ -#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 */ + 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; @@ -1048,11 +1046,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++ ) { @@ -1101,11 +1095,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 )--]; ( *nb_bits )++; @@ -1125,11 +1115,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]; diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index 00d7b2b7760194cef062e42b2e7b4ed1b0345019..1e90b6f3ba5d4ccb275b990bd46a82a481ef174d 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() @@ -584,11 +582,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 ) { svd_s_buffer[i] = ( ( svd_s_buffer[i] > limit ) ? svd_s_buffer[i] : limit ); diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index fec8a22206a8a8f37e7182c9aebf510e2dea7fe9..2663bf7a6c3094c8b51b7d373aedb0f025566735 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -54,12 +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_1052_SBA_EXT static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order ); -#endif -#ifdef NONBE_FIX_1052_SBA_EXT static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order ) { AUDIO_CONFIG output_config; @@ -80,7 +77,6 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord } return output_config; } -#endif /*-------------------------------------------------------------------* * ivas_dec_setup() @@ -168,13 +164,11 @@ ivas_error ivas_dec_setup( /* read Ambisonic (SBA) order */ st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; -#ifdef NONBE_FIX_1052_SBA_EXT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->hDecoderConfig->output_config = ivas_set_output_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 ) @@ -214,7 +208,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 @@ -229,15 +222,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; } @@ -346,23 +330,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; } @@ -459,13 +435,11 @@ ivas_error ivas_dec_setup( break; } -#ifdef NONBE_FIX_1052_SBA_EXT if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->hDecoderConfig->output_config = ivas_set_output_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 ) { @@ -729,7 +703,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; @@ -738,7 +711,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; @@ -983,11 +955,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; @@ -1009,7 +977,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; @@ -1019,9 +986,6 @@ ivas_error ivas_init_decoder( hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->transport_config ); } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) -#else - if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif { hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); hDecoderConfig->nchan_out += st_ivas->nchan_ism; @@ -1044,7 +1008,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 ); @@ -1054,9 +1017,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 ) { @@ -1453,16 +1413,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; } @@ -2059,41 +2015,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 ) - { -#ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif - { - /* 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 *-----------------------------------------------------------------*/ @@ -2130,7 +2051,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 *-----------------------------------------------------------------*/ @@ -2171,7 +2091,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 @@ -3006,16 +2925,11 @@ 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 /* Verify output configuration for other formats */ else { @@ -3024,39 +2938,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); } } -#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 #ifdef SPLIT_REND_WITH_HEAD_ROT 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_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 743a99275c1ca97ead6d075dac7f00e4f15a47c5..11b8c5a2029854c41c3ac70ebe1cda90a000f23d 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_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 38c98ffba39ae31dc45d04f3ca8fef45504af44b..2a0b051924f27de8b8da25b3aac86a37b25aa174 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -681,11 +681,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_lfe_dec.c b/lib_dec/ivas_lfe_dec.c index f672fe75ec292a085238bda5db82b31ebf93dc83..28469f47d1e4978f2eb8f6f63ad3d60b2e2e5415 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 /*-----------------------------------------------------------------------------------------* @@ -372,15 +370,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; @@ -431,14 +423,12 @@ 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; low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] * 1000000000.f; ivas_create_lfe_lpf_dec( &( hLFE->filter_state ), output_Fs ); } -#endif hLFE->filter_state.order = filt_order; hLFE->lfe_block_delay_s = hLFE->lfe_block_delay_s + low_pass_delay_dec_out; @@ -448,11 +438,7 @@ ivas_error ivas_create_lfe_dec( lfe_addl_delay_s = block_offset_s - hLFE->lfe_block_delay_s; lfe_addl_delay_s = max( 0.0f, lfe_addl_delay_s ); -#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; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index afe78367fad74e0a3beb431adbd4362208b175b7..af6cdd849b0635cb1d1660000816b166be7318d3 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 */ @@ -295,14 +293,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 )--]; @@ -320,9 +310,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 { @@ -447,11 +435,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 ); } @@ -671,11 +655,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 ) { @@ -1106,9 +1086,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 5742d41f70787533576fcfe6e5f31201515dbed0..9cbf73b16cf8ca928f577abf2a4ed96c8464d598 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 39b74728e1b4eb0c6e606a7fc734b83ba0ab4fec..63bd44e49171ce09a11c97ced1cdac8cbc87e006 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -87,9 +87,7 @@ ivas_error ivas_mct_dec( STnsData tnsData[MCT_MAX_BLOCKS][CPE_CHANNELS][NB_DIV]; Decoder_State **sts; float synth[CPE_CHANNELS][L_FRAME_PLUS]; -#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS float *p_output_orig[2]; -#endif float output_lfe_ch[L_FRAME48k]; int32_t ivas_total_brate; ivas_error error; @@ -151,7 +149,6 @@ ivas_error ivas_mct_dec( /* MCT side bits decoder */ ivas_mct_side_bits( hMCT, st_ivas->hCPE, nCPE, st_ivas->hCPE[0]->hCoreCoder[0], st_ivas->bfi, st_ivas->hCPE[0]->hCoreCoder[0]->bit_stream, ivas_total_brate, nb_bits_metadata ); -#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS /* in case of switching from an SID frame (with ACELP core) to MCT, buffer of L_FRAME_PLUS samples is needed -> use synth[] as a temporary buffer */ if ( st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE ) { @@ -161,7 +158,6 @@ ivas_error ivas_mct_dec( output[n] = synth[n]; } } -#endif for ( cpe_id = 0; cpe_id < nCPE; cpe_id++ ) { @@ -247,7 +243,6 @@ ivas_error ivas_mct_dec( ivas_mdct_core_reconstruct( hCPE, x, synth, fUseTns[cpe_id], 1 ); -#ifdef NONBE_FIX_1087_OOB_SBA_DTX_RS /* set pointers back */ if ( cpe_id == 0 && st_ivas->hCPE[0]->hCoreCoder[0]->last_core == ACELP_CORE ) { @@ -257,7 +252,6 @@ ivas_error ivas_mct_dec( } } -#endif /*----------------------------------------------------------------* * CoreCoder Post-processing and updates *----------------------------------------------------------------*/ @@ -698,7 +692,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 @@ -706,7 +699,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 ); @@ -714,11 +706,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 { #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( error = ivas_mc_dec_reconfig( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) @@ -1154,32 +1142,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 ) ) @@ -1187,13 +1162,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; } @@ -1254,12 +1224,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 } #ifdef SPLIT_REND_WITH_HEAD_ROT diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 4f0bd1044b33b08efca1d1785091839a772aee15..d0fbca11c1e5730a381310d641e1893c29c9a596 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 } @@ -276,9 +271,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/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index f49adaccfec0cee5a44e0d1b5379e91d7d4f5e1b..24df92d4e764e5509b65388696d58203c1117567 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -155,9 +155,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 #ifdef SPLIT_REND_WITH_HEAD_ROT 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_output_config.c b/lib_dec/ivas_output_config.c index 86ec1cd02ad45ee237b733d87398dfcb5e3774da..68a1b72e602a0ab081ea32b049c8e8253e62d0d4 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -433,11 +433,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 ) { @@ -451,11 +447,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 ) { @@ -480,14 +472,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_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index dd3316daae02db91fcfa80bc6c9ea7e9e1f0b17d..ef5da3cb5db9d8510a35f401d439b68886d334d3 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_rom_dec.c b/lib_dec/ivas_rom_dec.c index 920af84ff7d61a3ee3a612e451c5977e7f7b4bb5..8f4037773b64f20a077daddf7e89561d898a9a8c 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 81463cd9b8b99a06e1c1f6aaf25c0907c7719164..5f3730470a8c40276afcb9e71c73218375cf2b41 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -96,14 +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/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index a83a51db1db5c9d979544be46a7239f6c345a69f..aa672c15950f11d75513fa3a8f49b7c73959c532 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++ ) { @@ -128,9 +124,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; @@ -150,11 +144,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; } @@ -461,9 +451,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 ) @@ -533,12 +521,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 ) { @@ -553,25 +537,16 @@ 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_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index b277df73520b56d6b519533ff811d67c31ba538f..1782262cb3817685c54abc0fc931496f3117de9a 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -395,7 +395,6 @@ static void map_params_dirac_to_stereo( } } -#ifdef NONBE_FIX_1096_NAN_VALUES_IN_DIRAC_TO_STEREO /* Clamp values here. [-1, 1] is the allowed range, but due to precision issues they can be slightly off which can cause problems later. */ side_gain[b] *= sqrtf( 1.f - diffuseness[b] ); side_gain[b] = max( min( side_gain[b], 1 ), -1 ); @@ -406,12 +405,6 @@ static void map_params_dirac_to_stereo( res_pred_gain[b] = max( min( res_pred_gain[b], 1 ), 0 ); res_pred_gain[b + STEREO_DFT_BAND_MAX] = diffuseness[b] * ( 1.0f - surrCoh[b] ); res_pred_gain[b + STEREO_DFT_BAND_MAX] = max( min( res_pred_gain[b + STEREO_DFT_BAND_MAX], 1 ), 0 ); -#else - side_gain[b] *= sqrtf( 1.f - diffuseness[b] ); - side_gain[b + STEREO_DFT_BAND_MAX] *= sqrtf( 1.f - diffuseness[b] ); - res_pred_gain[b] = diffuseness[b] * ( 1.0f - surrCoh[b] ); - res_pred_gain[b + STEREO_DFT_BAND_MAX] = diffuseness[b] * ( 1.0f - surrCoh[b] ); -#endif } } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index cb81db28aae362adf39f630db8a2e17b437c2e20..840a5c609bfb8015a025aa45924b5b01ef2bd604 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 02f3ead6321ea8279128514e537d9430038f3ac3..b920d4d019e65c5c8064be5e8f35cf9ad4fe8eba 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_dec/ivas_svd_dec.c b/lib_dec/ivas_svd_dec.c index 775960fa3ee1245b17a8982b9db5d7ac9569431a..ebef0644ee3dfbf60bc89cdb20ceb4d8600f8708 100644 --- a/lib_dec/ivas_svd_dec.c +++ b/lib_dec/ivas_svd_dec.c @@ -48,17 +48,10 @@ *-----------------------------------------------------------------------*/ /* The SVD is sensitive to changes to the following constants, so please be careful when trying to tune things */ -#ifdef NONBE_FIX_1069_SVD_TUNING #define SVD_MINIMUM_VALUE 1e-32f /* minimum value */ #define CONVERGENCE_FACTOR 1.0e-04f /* factor for SVD convergence */ #define SVD_MAX_NUM_ITERATION 75 /* maximum number of interations before exiting the SVD */ #define SVD_ZERO_FLUSH_THRESHOLD 0.0f -#else -#define SVD_MINIMUM_VALUE 1e-32f /* minimum value */ -#define CONVERGENCE_FACTOR 1.19209290e-07f /* factor for SVD convergence */ -#define SVD_MAX_NUM_ITERATION 75 /* maximum number of interations before exiting the SVD */ -#define SVD_ZERO_FLUSH_THRESHOLD 1.0e-20f -#endif /*-----------------------------------------------------------------------* diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index c11dcb78bc60ea4b329ca23d7477276851ffccc8..bfe52a1ee7cf66e46f0bd13a74fbc5fee29a8dc6 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -2210,13 +2210,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; -#ifdef FIX_1053_REVERB_RECONFIGURATION ivas_error error; -#else -#ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_error error; -#endif -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hRenderConfig == NULL ) { @@ -2255,7 +2249,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 */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2324,12 +2317,9 @@ ivas_error IVAS_DEC_FeedRenderConfig( return error; } } -#endif mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 * MAX_NUM_OBJECTS ); -#ifdef CONF_DISTATT mvr2r( renderConfig.distAtt, hRenderConfig->distAtt, 3 ); -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT hRenderConfig->split_rend_config = renderConfig.split_rend_config; diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index c7768972f61aae109dfc34a4a87cabb59f9f6916..b58f208b4c6b10986f54754d4584be6587f338e1 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -446,11 +446,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_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 3fdf6e9f5e3dbabf1e649ada5807907980dd1772..a3119193c7216bc42d9413996db37302dc163532 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -600,7 +600,6 @@ ivas_error ivas_cpe_enc( if ( sts[0]->core_brate == SID_2k40 ) { 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 */ @@ -609,7 +608,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 } /*----------------------------------------------------------------* diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index cd4dbe6438244f944c8956a3e713ca2b326840df..75e0ec27f710a27f8c6e5eea34e273faa6899ae9 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -291,10 +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 */ -#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 */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t hodirac_flag /* i : hodirac flag */ ) { int16_t orig_dirac_bands; @@ -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_init_enc.c b/lib_enc/ivas_init_enc.c index 0371378d73e0d2e5e621732fc6128260989115c3..a24007b21ae36cd4248dca34ba8f6705c3a6afbf 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -674,14 +674,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 ) { @@ -737,16 +730,12 @@ ivas_error ivas_init_encoder( { /* 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++ ) { if ( ( error = create_cpe_enc( st_ivas, cpe_id, ( ivas_total_brate / st_ivas->nchan_transport ) * CPE_CHANNELS ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 2c5e2bb5b241c43eb3a599250f772aab115276aa..54691e864e63e6cc5b2af98591b2616953961814 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -420,7 +420,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 ) { @@ -431,17 +430,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 { @@ -453,7 +441,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 ); @@ -462,16 +449,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 @@ -481,16 +458,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 ); hQMetaData->metadata_max_bits -= MASA_SUBFRAME_BITS; @@ -626,11 +599,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_osba_enc.c b/lib_enc/ivas_osba_enc.c index 38f927b10925938601ee6e68ede3219d3138fb3e..b00396bfab311a4b0f18a85aae8efadb19bff3b5 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -186,9 +186,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; @@ -343,40 +330,25 @@ 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 ) diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index dc4806ed19e166a18831adbcbe267e2d0f6b5d62..1260e115dc6a17e693664467a80fc7d04f508ca4 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -955,10 +955,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 */ -#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 */ + const int16_t nchan_transport, /* i : number of transport channels */ + const int16_t ivas_format /* i : IVAS format */ ) { int16_t b, m; @@ -971,18 +969,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 { @@ -1261,11 +1253,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 b8319618111c7af9c584d7de832bd476ffe62c9d..e1355c1b7a81ed2f138e76a41f9d87fce5ac0e29 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -224,7 +224,6 @@ ivas_error ivas_sce_enc( if ( st->core_brate == SID_2k40 ) { 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 */ @@ -233,7 +232,6 @@ ivas_error ivas_sce_enc( /* Write SBA order */ push_indice( st->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_order, SBA_ORDER_BITS ); } -#endif } /*----------------------------------------------------------------* diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 0a6f44b1d0117f86b41b850793674395999066f8..a74a7f6587e8414714069892f1357db28b240595 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 */ diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 83ff86b68b17a26f397839e7b9912276bb09b9df..a259670f71b2b38134c8f8425daeeac78c799c3d 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -1716,9 +1716,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]; @@ -1774,12 +1772,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 ) { diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 5be932d60f8fa13bf1d8890f7d0dd5ee07dcd299..9ca3615a992fafd010dce1e52831347c03c523cd 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 /*-----------------------------------------------------------------* * Initialize values @@ -361,14 +353,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; @@ -437,11 +427,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 } } @@ -1533,12 +1519,8 @@ static void add_vertex( /* Final Idx */ vtxArray[pos].idx = (int16_t) idxAziTmp + 181 * (int16_t) idxEleTmp; -/* Setting the nan flag to 0 */ -#ifdef FIX_1050_EFAP_ALLOC + /* Setting the nan flag to 0 */ 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_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 4aac09eafadb74e801436de0227ad18a247e76ec..30b0a4b3c7e68485d6890076a46652a1aaf2195b 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -60,15 +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) */ -#ifdef CONF_DISTATT - const float *distAtt, /* i : Distance attenuation (used for ISM) */ -#endif + 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 */ @@ -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 } } @@ -678,9 +666,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 ) @@ -710,16 +696,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_mix.c b/lib_rend/ivas_objectRenderer_mix.c index cd8b59cf253d440e7f21ac8d1bb5a4a6aea21b5d..5f1a49ed966b64edcdd52ddc0c032aaab318741c 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -39,9 +39,7 @@ #include "wmc_auto.h" #include "ivas_rom_rend.h" #include "ivas_rom_binaural_crend_head.h" -#ifdef FIX_989_TD_REND_ROM #include -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -389,9 +387,7 @@ static ivas_error DefaultBSplineModel( ModelParamsITD_t *modelITD; int16_t i, j; ivas_error error; -#ifdef FIX_989_TD_REND_ROM float azimSegSamples; -#endif HrFiltSet_p->FilterMethod = TDREND_HRFILT_Method_BSplineModel; model = &( HrFiltSet_p->ModelParams ); @@ -402,7 +398,6 @@ static ivas_error DefaultBSplineModel( model->modelROM = TRUE; /* int16_t parameters */ -#ifdef FIX_989_TD_REND_ROM model->UseItdModel = defaultHRIR_rom_model_configuration[0]; model->elevDim3 = defaultHRIR_rom_model_configuration[1]; model->AlphaN = defaultHRIR_rom_model_configuration[2]; @@ -410,25 +405,6 @@ static ivas_error DefaultBSplineModel( model->elevSegSamples = defaultHRIR_rom_model_configuration[4]; model->elevBsLen = defaultHRIR_rom_elevBsLen; model->elevBsStart = defaultHRIR_rom_elevBsStart; -#else - model->UseItdModel = 1; - model->SplineDegree = 4; - model->elevDim2 = 17; - model->elevDim3 = 15; - model->AlphaN = 470; - model->num_unique_azim_splines = 1; - model->elevSegSamples = 4; - model->elevBsLen[0] = 5; - model->elevBsLen[1] = 9; - model->elevBsLen[2] = 13; - model->elevBsLen[3] = 9; - model->elevBsStart[0] = 0; - model->elevBsStart[1] = 5; - model->elevBsStart[2] = 14; - model->elevBsStart[3] = 27; - - model->azimDim2 = defaultHRIR_rom_azimDim2; -#endif model->azimDim3 = defaultHRIR_rom_azimDim3; model->azim_start_idx = defaultHRIR_rom_azim_start_idx; model->azimSegSamples = defaultHRIR_rom_azimSegSamples; @@ -445,15 +421,10 @@ static ivas_error DefaultBSplineModel( } model->azimBsShape[0] = (const float *) defaultHRIR_rom_azimBsShape; -#ifdef FIX_989_TD_REND_ROM if ( ( model->azimKSeq = (float **) malloc( model->elevDim3 * sizeof( float * ) ) ) == NULL ) -#else - if ( ( model->azimKSeq = (float **) malloc( 18 * sizeof( float * ) ) ) == NULL ) -#endif { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); } -#ifdef FIX_989_TD_REND_ROM for ( i = 0; i < model->elevDim3; i++ ) { if ( ( model->azimKSeq[i] = (float *) malloc( ( model->azimDim3[i] + 1 ) * sizeof( float * ) ) ) == NULL ) @@ -474,32 +445,6 @@ static ivas_error DefaultBSplineModel( model->azimKSeq[i][j] = azimSegSamples * j; } } -#else - if ( ( model->azimKSeq[0] = (float *) malloc( 2 * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); - } - if ( ( model->azimKSeq[model->elevDim3 - 1] = (float *) malloc( 2 * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); - } - model->azimKSeq[0][0] = 0.0f; - model->azimKSeq[model->elevDim3 - 1][0] = 0.0f; - model->azimKSeq[0][1] = 360.0f; - model->azimKSeq[model->elevDim3 - 1][1] = 360.0f; - - for ( i = 1; i < model->elevDim3 - 1; i++ ) - { - if ( ( model->azimKSeq[i] = (float *) malloc( model->azimDim2[i] * sizeof( float * ) ) ) == NULL ) /* azimDim2[i] = 91, i=2..15 */ - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); - } - for ( j = 0; j < model->azimDim2[i]; j++ ) - { - model->azimKSeq[i][j] = (float) defaultHRIR_rom_azimSegSamples[0] * j; - } - } -#endif switch ( output_Fs ) { @@ -508,11 +453,7 @@ static ivas_error DefaultBSplineModel( model->AlphaR = (const float *) defaultHRIR_rom_AlphaR48; model->EL = (const float *) defaultHRIR_rom_EL48; model->ER = (const float *) defaultHRIR_rom_ER48; -#ifdef FIX_989_TD_REND_ROM model->K = defaultHRIR_rom_model_configuration[5]; -#else - model->K = 128; -#endif if ( HrFiltSet_p->ModelParams.UseItdModel ) { modelITD->resamp_factor = 1.0f; @@ -523,11 +464,7 @@ static ivas_error DefaultBSplineModel( model->AlphaR = (const float *) defaultHRIR_rom_AlphaR32; model->EL = (const float *) defaultHRIR_rom_EL32; model->ER = (const float *) defaultHRIR_rom_ER32; -#ifdef FIX_989_TD_REND_ROM model->K = (int16_t) ceil( RESAMPLE_FACTOR_32_48 * defaultHRIR_rom_model_configuration[5] ); -#else - model->K = 86; -#endif if ( HrFiltSet_p->ModelParams.UseItdModel ) { modelITD->resamp_factor = RESAMPLE_FACTOR_32_48; @@ -538,11 +475,7 @@ static ivas_error DefaultBSplineModel( model->AlphaR = (const float *) defaultHRIR_rom_AlphaR16; model->EL = (const float *) defaultHRIR_rom_EL16; model->ER = (const float *) defaultHRIR_rom_ER16; -#ifdef FIX_989_TD_REND_ROM model->K = (int16_t) ceilf( RESAMPLE_FACTOR_16_48 * defaultHRIR_rom_model_configuration[5] ); -#else - model->K = 43; -#endif if ( HrFiltSet_p->ModelParams.UseItdModel ) { modelITD->resamp_factor = RESAMPLE_FACTOR_16_48; @@ -552,47 +485,17 @@ static ivas_error DefaultBSplineModel( break; } -#ifdef FIX_989_TD_REND_ROM modelITD->elevDim3 = defaultHRIR_rom_ITD_model_configuration[0]; modelITD->azimDim3 = defaultHRIR_rom_ITD_model_configuration[1]; modelITD->elevSegSamples = defaultHRIR_rom_ITD_model_configuration[2]; modelITD->azimSegSamples = defaultHRIR_rom_ITD_model_configuration[3]; modelITD->elevBsLen = defaultHRIR_rom_ITD_elevBsLen; modelITD->elevBsStart = defaultHRIR_rom_ITD_elevBsStart; -#else - modelITD->N = 4; - modelITD->elevDim2 = 20; - modelITD->elevDim3 = 18; - modelITD->azimDim2 = 41; - modelITD->azimDim3 = 41; - modelITD->elevSegSamples = 3; - modelITD->elevBsLen[0] = 4; - modelITD->elevBsLen[1] = 7; - modelITD->elevBsLen[2] = 10; - modelITD->elevBsLen[3] = 7; - modelITD->elevBsStart[0] = 0; - modelITD->elevBsStart[1] = 4; - modelITD->elevBsStart[2] = 11; - modelITD->elevBsStart[3] = 21; -#endif modelITD->elevKSeq = defaultHRIR_rom_ITD_elevKSeq; -#ifdef FIX_989_TD_REND_ROM modelITD->azimBsLen = defaultHRIR_rom_ITD_azimBsLen; modelITD->azimBsStart = defaultHRIR_rom_ITD_azimBsStart; -#else - modelITD->azimBsLen[0] = 11; - modelITD->azimBsLen[1] = 21; - modelITD->azimBsLen[2] = 31; - modelITD->azimBsLen[3] = 21; - modelITD->azimBsStart[0] = 0; - modelITD->azimBsStart[1] = 11; - modelITD->azimBsStart[2] = 32; - modelITD->azimBsStart[3] = 63; - - modelITD->azimSegSamples = 10; -#endif modelITD->azimKSeq = defaultHRIR_rom_ITD_azimKSeq; modelITD->W = (const float *) defaultHRIR_rom_ITD_W; diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index a0f489f35da840da2fe04d569c670a0dd402e0c3..0633995e30637ba96694f0412814bffab09ed0f5 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() @@ -514,7 +510,6 @@ static void TDREND_SRC_SPATIAL_SetDirAtten( return; } -#ifdef CONF_DISTATT /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_SetDistAtten() * @@ -534,7 +529,6 @@ static void TDREND_SRC_SPATIAL_SetDistAtten( return; } -#endif /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_GetDirGain() * @@ -608,11 +602,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: @@ -625,11 +615,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_output_init.c b/lib_rend/ivas_output_init.c index d85f8063ffecdc7d6d9a98bf07b5037738f9739c..b6d1b710fac38ff6b2078775ff0c7d9f162fb98f 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -408,11 +408,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 ) ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 9ccbc180ecc6efe9ef3c8bb31da85de03fcdb9d1..fd2daa83fbb733eba0cd95034560142e2aaca8d4 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -642,9 +642,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 */ @@ -733,13 +731,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 17c4f11a0be9afe7b30204c60131481b90135c6d..662e1a863029bc50c38fddcb5762f1b470fff8b2 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -132,11 +132,9 @@ ivas_error ivas_render_config_init_from_rom( ( *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 #ifdef SPLIT_REND_WITH_HEAD_ROT /* ISAR-related parameters */ diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 74b3acd3825bcd0ef5cd2cc917e40ed5c3b711b3..7ea38fe2a701806c1264c5e15a01b0c015280046 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -105,14 +105,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 */ -#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 */ + 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. */ @@ -979,9 +974,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 */ @@ -1003,15 +995,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; @@ -1036,19 +1019,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 */ @@ -1058,13 +1033,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]; @@ -1082,7 +1053,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 */ @@ -1091,20 +1061,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 */ @@ -1122,22 +1084,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 ); @@ -1147,16 +1093,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(...) */ @@ -1187,15 +1126,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 ); @@ -1219,7 +1153,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 ) @@ -1232,18 +1165,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 ) { @@ -1276,7 +1197,6 @@ ivas_error ivas_reverb_open( return error; } -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { /* init predelay */ @@ -1305,16 +1225,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_rom_TdBinauralRenderer.c b/lib_rend/ivas_rom_TdBinauralRenderer.c index 706d7de2d2972eb8c2cb4ccd5987630702c03d41..9f7550fbe4fe0ada059f399cbde0457d207db307 100644 --- a/lib_rend/ivas_rom_TdBinauralRenderer.c +++ b/lib_rend/ivas_rom_TdBinauralRenderer.c @@ -50,7 +50,6 @@ *------------------------------------------------------------------------*/ /* TD renderer default HRIR model */ const float defaultHRIR_rom_latency_s = 0.000020834f; -#ifdef FIX_989_TD_REND_ROM const int16_t defaultHRIR_rom_model_configuration[6] = { 1, /* UseItdModel */ 15, /* elevDim3 */ @@ -65,11 +64,6 @@ const int16_t defaultHRIR_rom_elevBsLen[4] = { const int16_t defaultHRIR_rom_elevBsStart[4] = { 0, 5, 14, 27, }; -#else -const int16_t defaultHRIR_rom_azimDim2[15] = { -1, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 1, -}; -#endif const int16_t defaultHRIR_rom_azimDim3[15] = { 1, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 1, }; @@ -10156,7 +10150,6 @@ const uint32_t defaultHRIR_rom_ITD_W[658] = { 0x3c678a1c,0xbdeb0ba5,0xbe2218a5,0x3e58dcde,0x3d71aaa0,0xbef80fb9,0xbf3d07e1,0x3f3485be,0x3db783c0,0x3c142933,0xbed36b04,0xbb9f1f49,0x3ebfdc23,0xbcc7652e,0xbdb4e6cd,0xbf3be092,0x3f399c4e,0x3ef2eb6a,0xbd93a618,0xbe480d88,0x3e1bd187,0x3df79a5d,0xbc53f8d6,0xbf002186,0xbd41bc42, 0x3e5c0f28,0x3f2ad402,0xbf3cc2c3,0xbedc59d1,0xbe021816,0x3ea43429,0x3d349309,0xbab986b3, }; -#ifdef FIX_989_TD_REND_ROM const int16_t defaultHRIR_rom_ITD_model_configuration[4] = { 18, /* elevDim3 */ 41, /* azimDim3 */ @@ -10175,7 +10168,6 @@ const int16_t defaultHRIR_rom_ITD_azimBsLen[4] = { const int16_t defaultHRIR_rom_ITD_azimBsStart[4] = { 0, 11, 32, 63, }; -#endif const uint32_t defaultHRIR_rom_ITD_azimBsShape[84] = { 0x3f800000,0x3f3a9fbe,0x3f03126f,0x3eaf9db2,0x3e5d2f1b,0x3e000000,0x3d83126f,0x3cdd2f1b,0x3c03126f,0x3a83126f,0xa5800000,0x00000000,0x3e8374bc,0x3ede353f,0x3f0ad0e5,0x3f178d50,0x3f180000,0x3f0ed917,0x3efd9168,0x3ed4fdf4,0x3ea95810,0x3e800000,0x3e3a9fbe,0x3e03126f,0x3daf9db2, 0x3d5d2f1b,0x3d000000,0x3c83126f,0x3bdd2f1b,0x3b03126f,0x3983126f,0xa6000000,0x00000000,0x3c66bdc8,0x3d57b901,0x3de1cac1,0x3e39af72,0x3e855555,0x3eaf1aa0,0x3ed756b3,0x3efb38a9,0x3f0bf7cf,0x3f155555,0x3f18aec3,0x3f16872b,0x3f0fc3ed,0x3f054a69,0x3ef00000,0x3ed19423,0x3eb11bfd, diff --git a/lib_rend/ivas_rom_TdBinauralRenderer.h b/lib_rend/ivas_rom_TdBinauralRenderer.h index f633f06a686dc5f0614908498d1ce6fcbe369ab0..cc44aa9643c1bf18e08ad004925a3fbcdb6d08d0 100644 --- a/lib_rend/ivas_rom_TdBinauralRenderer.h +++ b/lib_rend/ivas_rom_TdBinauralRenderer.h @@ -47,11 +47,7 @@ *------------------------------------------------------------------------*/ /* TD renderer default HRIR model */ extern const float defaultHRIR_rom_latency_s; -#ifdef FIX_989_TD_REND_ROM extern const int16_t defaultHRIR_rom_model_configuration[6]; -#else -extern const int16_t defaultHRIR_rom_azimDim2[15]; -#endif extern const int16_t defaultHRIR_rom_azimDim3[15]; extern const int16_t defaultHRIR_rom_azim_start_idx[15]; extern const int16_t defaultHRIR_rom_azimSegSamples[1]; @@ -70,10 +66,8 @@ extern const uint32_t defaultHRIR_rom_EL32[HRTF_MODEL_N_SECTIONS * 470]; extern const uint32_t defaultHRIR_rom_ER32[HRTF_MODEL_N_SECTIONS * 470]; extern const uint32_t defaultHRIR_rom_EL16[HRTF_MODEL_N_SECTIONS * 470]; extern const uint32_t defaultHRIR_rom_ER16[HRTF_MODEL_N_SECTIONS * 470]; -#ifdef FIX_989_TD_REND_ROM extern const int16_t defaultHRIR_rom_elevBsLen[4]; extern const int16_t defaultHRIR_rom_elevBsStart[4]; -#endif extern const uint32_t defaultHRIR_rom_elevBsShape[36]; extern const uint32_t defaultHRIR_rom_azimBsShape[21]; extern const uint32_t defaultHRIR_rom_ITD_W[658]; @@ -81,11 +75,9 @@ extern const uint32_t defaultHRIR_rom_ITD_azimBsShape[84]; extern const float defaultHRIR_rom_ITD_azimKSeq[19]; extern const uint32_t defaultHRIR_rom_ITD_elevBsShape[28]; extern const float defaultHRIR_rom_ITD_elevKSeq[16]; -#ifdef FIX_989_TD_REND_ROM extern const int16_t defaultHRIR_rom_ITD_model_configuration[4]; extern const int16_t defaultHRIR_rom_ITD_elevBsLen[4]; extern const int16_t defaultHRIR_rom_ITD_elevBsStart[4]; extern const int16_t defaultHRIR_rom_ITD_azimBsLen[4]; extern const int16_t defaultHRIR_rom_ITD_azimBsStart[4]; #endif -#endif diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 61871f2e3391a149a0d0738ebe561fce18725d2b..304b7a37670c54cfc055885b27cb558c0e38023d 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 2041585dbea6c5c5fa809fa90a91ed06366c9034..aacded4d5f64c9fd426bfe59f8f55ae6932c0466 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 973810bc968f7e1eafe334eab6140bd915f687ce..4959dc0a354623e5e16abd51319326c1e0f4d8e7 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; @@ -580,15 +577,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 */ -#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 + 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; @@ -603,12 +596,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 */ -#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 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 */ @@ -623,18 +612,10 @@ 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 + int16_t numPoly; /* Number of polygons */ 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 */ + int16_t numTri; /* Number of triangles */ } EFAP_POLYSET_DATA; @@ -942,26 +923,14 @@ typedef struct { int16_t modelROM; /* Flag that indicates that the model resides in ROM (controls init/dealloc). */ int16_t UseItdModel; /* Controls whether ITD model is used. */ -#ifdef FIX_989_TD_REND_ROM - int16_t K; /* Length of filter */ -#else - int16_t SplineDegree; /* Degree of the spline functions */ - int16_t K; /* Length of filter */ - int16_t elevDim2; -#endif + int16_t K; /* Length of filter */ int16_t elevDim3; int16_t AlphaN; /* Number of rows in Alpha matrices */ int16_t num_unique_azim_splines; int16_t elevSegSamples; -#ifdef FIX_989_TD_REND_ROM const int16_t *elevBsLen; const int16_t *elevBsStart; -#else - int16_t elevBsLen[HRTF_MODEL_BSPLINE_NUM_COEFFS]; - int16_t elevBsStart[HRTF_MODEL_BSPLINE_NUM_COEFFS]; - const int16_t *azimDim2; -#endif const int16_t *azimDim3; const int16_t *azim_start_idx; const int16_t *azimSegSamples; @@ -988,12 +957,8 @@ typedef struct float *ER_dyn; float *elevBsShape_dyn; float *elevKSeq_dyn; -#ifdef FIX_989_TD_REND_ROM int16_t *elevBsLen_dyn; int16_t *elevBsStart_dyn; -#else - int16_t *azimDim2_dyn; -#endif int16_t *azimDim3_dyn; int16_t *azim_start_idx_dyn; int16_t *azimSegSamples_dyn; @@ -1005,41 +970,19 @@ typedef struct typedef struct { -#ifdef FIX_989_TD_REND_ROM - int16_t elevDim3; - const float *elevKSeq; /* Array, length elevDim3-2 */ - int16_t azimDim3; - const float *azimKSeq; /* Array, length azimDim3-2 */ - const float *W; /* Array, size (elevDim3*azimDim3) x K */ -#else - int16_t N; /* Polynomial degree */ - - int16_t elevDim2; int16_t elevDim3; const float *elevKSeq; /* Array, length elevDim3-2 */ - int16_t azimDim2; int16_t azimDim3; const float *azimKSeq; /* Array, length azimDim3-2 */ const float *W; /* Array, size (elevDim3*azimDim3) x K */ -#endif -#ifdef FIX_989_TD_REND_ROM const int16_t *azimBsLen; const int16_t *azimBsStart; -#else - int16_t azimBsLen[HRTF_MODEL_BSPLINE_NUM_COEFFS]; - int16_t azimBsStart[HRTF_MODEL_BSPLINE_NUM_COEFFS]; -#endif const float *azimBsShape; int16_t azimSegSamples; -#ifdef FIX_989_TD_REND_ROM const int16_t *elevBsLen; const int16_t *elevBsStart; -#else - int16_t elevBsLen[HRTF_MODEL_BSPLINE_NUM_COEFFS]; - int16_t elevBsStart[HRTF_MODEL_BSPLINE_NUM_COEFFS]; -#endif const float *elevBsShape; int16_t elevSegSamples; float resamp_factor; @@ -1050,12 +993,10 @@ typedef struct float *W_dyn; float *azimBsShape_dyn; float *elevBsShape_dyn; -#ifdef FIX_989_TD_REND_ROM int16_t *azimBsLen_dyn; int16_t *azimBsStart_dyn; int16_t *elevBsLen_dyn; int16_t *elevBsStart_dyn; -#endif } ModelParamsITD_t; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 06840fbcdba6bf356ff594ab22b3fdfe9259f0f3..0d69ab721d23850dd27991371f89aa1b6576e7c5 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4390,9 +4390,7 @@ int16_t IVAS_REND_GetRenderConfig( hRCout->roomAcoustics.use_er = hRCin->roomAcoustics.use_er; hRCout->roomAcoustics.lowComplexity = hRCin->roomAcoustics.lowComplexity; -#ifdef FIX_1053_REVERB_RECONFIGURATION mvr2r( hRCin->distAtt, hRCout->distAtt, 3 ); -#endif return IVAS_ERR_OK; } @@ -4410,18 +4408,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 -#ifdef SPLIT_REND_WITH_HEAD_ROT - ivas_error error; -#endif -#endif if ( hIvasRend == NULL || hIvasRend->hRendererConfig == NULL ) { @@ -4440,9 +4432,7 @@ int16_t IVAS_REND_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 ); mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 * MAX_NUM_OBJECTS ); -#ifdef FIX_1053_REVERB_RECONFIGURATION mvr2r( renderConfig.distAtt, hRenderConfig->distAtt, 3 ); -#endif hRenderConfig->roomAcoustics.use_er = 0; if ( renderConfig.roomAcoustics.use_er == 1 ) @@ -4455,7 +4445,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 ) @@ -4591,7 +4580,6 @@ int16_t IVAS_REND_FeedRenderConfig( } #endif } -#endif #ifdef SPLIT_REND_WITH_HEAD_ROT hRenderConfig->split_rend_config = renderConfig.split_rend_config; diff --git a/lib_util/aeid_file_reader.c b/lib_util/aeid_file_reader.c index 737c71f0c8934c3cc27d62f98818ce6465855d6d..83dd4b4e1857595b2ec3774484592b1ef69c80f0 100644 --- a/lib_util/aeid_file_reader.c +++ b/lib_util/aeid_file_reader.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "aeid_file_reader.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION #include "ivas_error_utils.h" #include #include @@ -184,4 +183,3 @@ const char *aeidFileReader_getFilePath( return aeidReader->file_path; } -#endif diff --git a/lib_util/aeid_file_reader.h b/lib_util/aeid_file_reader.h index 2e7c3209447f85bc13ae7db77f335c9efd6eebc0..c48a8d4122e383fb3982b89dbf3ce5a93bc99ee8 100644 --- a/lib_util/aeid_file_reader.h +++ b/lib_util/aeid_file_reader.h @@ -35,7 +35,6 @@ #include "common_api_types.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION struct aeidFileReader; typedef struct aeidFileReader aeidFileReader; @@ -84,6 +83,5 @@ const char *aeidFileReader_getFilePath( aeidFileReader *aeidReader /* i : aeidFileReader handle */ ); -#endif #endif /* IVAS_AEID_FILE_READER_H */ diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 3f0393752566159ec4c1f4d82d27942d07c288f9..970daa9609fcfafb4ea5445c304a8e47f6646b2b 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -269,7 +269,6 @@ static void LoadBSplineBinaryITD( ) { int16_t tmp; -#ifdef FIX_989_TD_REND_ROM fread( &modelITD->elevDim3, sizeof( int16_t ), 1, f_hrtf ); modelITD->elevKSeq_dyn = (float *) malloc( ( modelITD->elevDim3 - 2 ) * sizeof( float ) ); fread( modelITD->elevKSeq_dyn, sizeof( float ), modelITD->elevDim3 - 2, f_hrtf ); @@ -277,33 +276,16 @@ static void LoadBSplineBinaryITD( fread( &modelITD->azimDim3, sizeof( int16_t ), 1, f_hrtf ); modelITD->azimKSeq_dyn = (float *) malloc( ( ( modelITD->azimDim3 + 1 ) / 2 - 2 ) * sizeof( float ) ); /* basis functions are flipped around 180 deg, number of basis functions above/below is (N+1)/2 */ fread( modelITD->azimKSeq_dyn, sizeof( float ), ( modelITD->azimDim3 + 1 ) / 2 - 2, f_hrtf ); -#else - fread( &modelITD->N, sizeof( int16_t ), 1, f_hrtf ); - fread( &modelITD->elevDim2, sizeof( int16_t ), 1, f_hrtf ); - fread( &modelITD->elevDim3, sizeof( int16_t ), 1, f_hrtf ); - modelITD->elevKSeq_dyn = (float *) malloc( ( modelITD->elevDim3 - 2 ) * sizeof( float ) ); - fread( modelITD->elevKSeq_dyn, sizeof( float ), modelITD->elevDim3 - 2, f_hrtf ); - - fread( &modelITD->azimDim2, sizeof( int16_t ), 1, f_hrtf ); - fread( &modelITD->azimDim3, sizeof( int16_t ), 1, f_hrtf ); - modelITD->azimKSeq_dyn = (float *) malloc( ( ( modelITD->azimDim3 + 1 ) / 2 - 2 ) * sizeof( float ) ); /* basis functions are flipped around 180 deg, number of basis functions above/below is (N+1)/2 */ - fread( modelITD->azimKSeq_dyn, sizeof( float ), ( modelITD->azimDim3 + 1 ) / 2 - 2, f_hrtf ); -#endif fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); modelITD->W_dyn = (float *) malloc( tmp * sizeof( float ) ); fread( modelITD->W_dyn, sizeof( float ), tmp, f_hrtf ); /* azimuth */ -#ifdef FIX_989_TD_REND_ROM modelITD->azimBsLen_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); fread( modelITD->azimBsLen_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); modelITD->azimBsStart_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); fread( modelITD->azimBsStart_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#else - fread( modelITD->azimBsLen, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); - fread( modelITD->azimBsStart, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#endif fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); @@ -313,15 +295,10 @@ static void LoadBSplineBinaryITD( fread( &modelITD->azimSegSamples, sizeof( int16_t ), 1, f_hrtf ); /* elevation */ -#ifdef FIX_989_TD_REND_ROM modelITD->elevBsLen_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); fread( modelITD->elevBsLen_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); modelITD->elevBsStart_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); fread( modelITD->elevBsStart_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#else - fread( modelITD->elevBsLen, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); - fread( modelITD->elevBsStart, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#endif fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); @@ -335,12 +312,10 @@ static void LoadBSplineBinaryITD( modelITD->W = (const float *) modelITD->W_dyn; modelITD->azimBsShape = (const float *) modelITD->azimBsShape_dyn; modelITD->elevBsShape = (const float *) modelITD->elevBsShape_dyn; -#ifdef FIX_989_TD_REND_ROM modelITD->azimBsLen = (const int16_t *) modelITD->azimBsLen_dyn; modelITD->azimBsStart = (const int16_t *) modelITD->azimBsStart_dyn; modelITD->elevBsLen = (const int16_t *) modelITD->elevBsLen_dyn; modelITD->elevBsStart = (const int16_t *) modelITD->elevBsStart_dyn; -#endif return; } @@ -397,29 +372,15 @@ static ivas_error LoadBSplineBinary( return IVAS_ERROR( IVAS_ERR_INVALID_HRTF, "Error: HR filter file had an unsupported sampling rate (%d kHz)", tmp ); } -#ifdef FIX_989_TD_REND_ROM fread( &model->K, sizeof( int16_t ), 1, f_hrtf ); fread( &model->elevDim3, sizeof( int16_t ), 1, f_hrtf ); model->elevKSeq_dyn = (float *) malloc( ( model->elevDim3 - 2 ) * sizeof( float ) ); fread( model->elevKSeq_dyn, sizeof( float ), model->elevDim3 - 2, f_hrtf ); -#else - fread( &model->SplineDegree, sizeof( int16_t ), 1, f_hrtf ); - fread( &model->K, sizeof( int16_t ), 1, f_hrtf ); - - fread( &model->elevDim2, sizeof( int16_t ), 1, f_hrtf ); - fread( &model->elevDim3, sizeof( int16_t ), 1, f_hrtf ); - model->elevKSeq_dyn = (float *) malloc( ( model->elevDim3 - 2 ) * sizeof( float ) ); - fread( model->elevKSeq_dyn, sizeof( float ), model->elevDim3 - 2, f_hrtf ); - model->azimDim2_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); -#endif model->azimDim3_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); model->azim_start_idx_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); model->azimKSeq = (float **) malloc( model->elevDim3 * sizeof( float * ) ); for ( i = 0; i < model->elevDim3; i++ ) { -#ifndef FIX_989_TD_REND_ROM - fread( &model->azimDim2_dyn[i], sizeof( int16_t ), 1, f_hrtf ); -#endif fread( &model->azimDim3_dyn[i], sizeof( int16_t ), 1, f_hrtf ); fread( &model->azim_start_idx_dyn[i], sizeof( int16_t ), 1, f_hrtf ); model->azimKSeq[i] = (float *) malloc( ( model->azimDim3_dyn[i] + 1 ) * sizeof( float ) ); @@ -452,15 +413,10 @@ static ivas_error LoadBSplineBinary( fread( model->azimShapeSampFactor_dyn, sizeof( int16_t ), model->elevDim3, f_hrtf ); /* elevation */ -#ifdef FIX_989_TD_REND_ROM model->elevBsLen_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); fread( model->elevBsLen_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); model->elevBsStart_dyn = (int16_t *) malloc( HRTF_MODEL_BSPLINE_NUM_COEFFS * sizeof( int16_t ) ); fread( model->elevBsStart_dyn, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#else - fread( model->elevBsLen, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); - fread( model->elevBsStart, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); -#endif fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); model->elevBsShape_dyn = (float *) malloc( tmp * sizeof( float ) ); fread( model->elevBsShape_dyn, sizeof( float ), tmp, f_hrtf ); @@ -472,15 +428,10 @@ static ivas_error LoadBSplineBinary( model->AlphaR = (const float *) model->AlphaR_dyn; model->EL = (const float *) model->EL_dyn; model->ER = (const float *) model->ER_dyn; -#ifdef FIX_989_TD_REND_ROM model->elevBsLen = (const int16_t *) model->elevBsLen_dyn; model->elevBsStart = (const int16_t *) model->elevBsStart_dyn; -#endif model->elevBsShape = (const float *) model->elevBsShape_dyn; model->elevKSeq = (const float *) model->elevKSeq_dyn; -#ifndef FIX_989_TD_REND_ROM - model->azimDim2 = (const int16_t *) model->azimDim2_dyn; -#endif model->azimDim3 = (const int16_t *) model->azimDim3_dyn; model->azim_start_idx = (const int16_t *) model->azim_start_idx_dyn; model->azimSegSamples = (const int16_t *) model->azimSegSamples_dyn; @@ -896,18 +847,13 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelParamsITD.W_dyn ); free( ( *hHrtf )->ModelParamsITD.azimBsShape_dyn ); free( ( *hHrtf )->ModelParamsITD.elevBsShape_dyn ); -#ifdef FIX_989_TD_REND_ROM free( ( *hHrtf )->ModelParamsITD.azimBsLen_dyn ); free( ( *hHrtf )->ModelParamsITD.azimBsStart_dyn ); free( ( *hHrtf )->ModelParamsITD.elevBsLen_dyn ); free( ( *hHrtf )->ModelParamsITD.elevBsStart_dyn ); -#endif } free( ( *hHrtf )->ModelParams.elevKSeq_dyn ); free( ( *hHrtf )->ModelParams.azim_start_idx_dyn ); -#ifndef FIX_989_TD_REND_ROM - free( ( *hHrtf )->ModelParams.azimDim2_dyn ); -#endif free( ( *hHrtf )->ModelParams.azimDim3_dyn ); free( ( *hHrtf )->ModelParams.AlphaL_dyn ); free( ( *hHrtf )->ModelParams.AlphaR_dyn ); @@ -915,10 +861,8 @@ void destroy_td_hrtf( free( ( *hHrtf )->ModelParams.azimShapeIdx_dyn ); free( ( *hHrtf )->ModelParams.azimShapeSampFactor_dyn ); -#ifdef FIX_989_TD_REND_ROM free( ( *hHrtf )->ModelParams.elevBsLen_dyn ); free( ( *hHrtf )->ModelParams.elevBsStart_dyn ); -#endif free( ( *hHrtf )->ModelParams.elevBsShape_dyn ); for ( i = 0; i < ( *hHrtf )->ModelParams.num_unique_azim_splines; i++ ) diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index ef398017ff1ec818c86d7d68875af78f2ec61aeb..6ed7a2558b613d4bd764ddedda03c6e34479e977 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 + float distAtt[3]; /* [MaxDist, RefDist, Rolloff] */ }; @@ -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() @@ -1202,9 +1198,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 */ @@ -1323,7 +1317,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] ); @@ -1337,7 +1330,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 } @@ -1380,9 +1372,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; @@ -1902,7 +1892,6 @@ static ivas_error RenderConfigReader_readBinary( } } } -#ifdef CONF_DISTATT /**********************************/ /* Read the distance attenuation */ /**********************************/ @@ -1930,7 +1919,6 @@ static ivas_error RenderConfigReader_readBinary( return error; } } -#endif /* Cleanup */ @@ -2788,7 +2776,6 @@ ivas_error RenderConfigReader_read( free( pValue ); accDPIdx++; } -#ifdef CONF_DISTATT else if ( strcmp( chapter, "DISTANCEATTENUATION" ) == 0 ) { params_idx = 0; @@ -2834,7 +2821,6 @@ ivas_error RenderConfigReader_read( free( pValue ); } -#endif else if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) { @@ -3004,12 +2990,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; } } @@ -3092,7 +3076,6 @@ ivas_error RenderConfigReader_getDirectivity( return IVAS_ERR_OK; } -#ifdef CONF_DISTATT /*------------------------------------------------------------------------------------------* * RenderConfigReader_getDistanceAttenuation() * @@ -3119,7 +3102,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 4fb9280ff14c2831bfff92d6bccc579f97e2beff..ef16c818fa3c8320ff3edb75b9f90c39c5e8d540 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 */