diff --git a/apps/decoder.c b/apps/decoder.c index 59aacd9a910edbc178e3da7b64ed6e8dfdca7e9d..b32d9d92c82249ce3a02bb9e2e45526734a78e40 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -89,7 +89,6 @@ static *------------------------------------------------------------------------------------------*/ -#ifdef FIX_1053_REVERB_RECONFIGURATION typedef struct { uint16_t *pID; @@ -98,7 +97,6 @@ typedef struct uint16_t selected; uint16_t frameCounter; } AcousticEnvironmentSequence; -#endif typedef struct { @@ -130,11 +128,7 @@ typedef struct bool customLsOutputEnabled; char *customLsSetupFilename; int16_t orientation_tracking; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION bool non_diegetic_pan_enabled; -#else - int16_t Opt_non_diegetic_pan; -#endif float non_diegetic_pan_gain; bool renderConfigEnabled; char *renderConfigFilename; @@ -153,16 +147,8 @@ typedef struct uint16_t tsmScale; #endif #endif -#ifdef FIX_1053_REVERB_RECONFIGURATION AcousticEnvironmentSequence aeSequence; -#else - uint16_t acousticEnvironmentId; -#endif -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION bool dpidEnabled; -#else - int16_t Opt_dpid_on; -#endif uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; } DecArguments; @@ -299,11 +285,7 @@ int main( if ( arg.hrtfReaderEnabled ) { /* sanity check */ -#ifdef NONBE_1293_SR_HRTF if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) -#endif { arg.hrtfReaderEnabled = false; fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" ); @@ -418,32 +400,6 @@ int main( } } -#ifndef FIX_1158_FASTCONV_REVERB_HRTF - /*------------------------------------------------------------------------------------------* - * Open renderer configuration reader file - *------------------------------------------------------------------------------------------*/ - - if ( arg.renderConfigEnabled ) - { - /* sanity check */ -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false ) -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && - arg.Opt_non_diegetic_pan == 0 ) -#endif - { - fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" ); - goto cleanup; - } - - if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); - goto cleanup; - } - } -#endif /*------------------------------------------------------------------------------------------* * Configure the decoder @@ -451,19 +407,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; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, - arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif -#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; @@ -616,15 +562,11 @@ int main( } } #else -#ifdef FIX_VOIP_FUNCTIONS if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#else - IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ); -#endif #endif /*-------------------------------------------------------------------* @@ -636,13 +578,7 @@ int main( IVAS_RENDER_CONFIG_DATA renderConfig; /* sanity check */ -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false ) -#else - if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && - arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && - arg.Opt_non_diegetic_pan == 0 ) -#endif { fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" ); goto cleanup; @@ -654,13 +590,11 @@ int main( goto cleanup; } -#ifdef FIX_1158_FASTCONV_REVERB_HRTF if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename ); goto cleanup; } -#endif if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK ) { @@ -674,13 +608,11 @@ int main( goto cleanup; } -#ifdef CONF_DISTATT if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get Distance Attenuation \n\n" ); goto cleanup; } -#endif if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { @@ -709,11 +641,7 @@ int main( if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#else - if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#endif { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { @@ -723,16 +651,9 @@ int main( } else { -#ifdef FIX_1053_REVERB_RECONFIGURATION fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID ); -#else - fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId ); -#endif goto cleanup; } -#ifndef FIX_587_DEFAULT_REVERB - renderConfig.roomAcoustics.override = true; -#endif } /* ISAR frame size is set from command line, not renderer config file. @@ -937,13 +858,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 ); @@ -1144,20 +1063,12 @@ static bool parseCmdlIVAS_dec( arg->renderConfigEnabled = false; arg->renderConfigFilename = NULL; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->dpidEnabled = false; -#else - arg->Opt_dpid_on = 0; -#endif arg->outputMdFilename = NULL; arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->non_diegetic_pan_enabled = false; -#else - arg->Opt_non_diegetic_pan = 0; -#endif arg->non_diegetic_pan_gain = 0.f; arg->tsmEnabled = false; arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS; @@ -1168,15 +1079,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; @@ -1500,11 +1407,7 @@ static bool parseCmdlIVAS_dec( else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 ) { i++; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->non_diegetic_pan_enabled = true; -#else - arg->Opt_non_diegetic_pan = 1; -#endif strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 ); argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0'; to_upper( argv_to_upper ); @@ -1562,7 +1465,6 @@ static bool parseCmdlIVAS_dec( if ( !is_digits_only( argv[i] ) ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t k; char *s = argv[i]; char *token = argv[i]; @@ -1622,14 +1524,8 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } -#else - fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] ); - usage_dec(); - return false; -#endif } -#ifdef FIX_1053_REVERB_RECONFIGURATION else { /* A single acoustic environment */ @@ -1644,19 +1540,12 @@ 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 ) { int16_t id, tmp; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION arg->dpidEnabled = true; -#else - arg->Opt_dpid_on = 1; -#endif ++i; tmp = 0; while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS ) @@ -1737,11 +1626,7 @@ static bool parseCmdlIVAS_dec( } i++; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( arg->non_diegetic_pan_enabled && arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) -#else - if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) ) -#endif { fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" ); usage_dec(); @@ -1759,11 +1644,7 @@ static bool parseCmdlIVAS_dec( arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_EVS; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( arg->non_diegetic_pan_enabled ) -#else - if ( ( arg->Opt_non_diegetic_pan ) ) -#endif { arg->outputConfig = IVAS_AUDIO_CONFIG_STEREO; } @@ -1898,15 +1779,11 @@ static void usage_dec( void ) fprintf( stdout, " output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" ); fprintf( stdout, " ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" ); fprintf( stdout, " otherwise a default directivity pattern is used.\n" ); -#ifdef FIX_1053_REVERB_RECONFIGURATION fprintf( stdout, "-aeid ID : Acoustic environment ID (number > 0) or\n" ); fprintf( stdout, " a sequence thereof in the format [ID1:duration1,ID2:duration2...]\n" ); fprintf( stdout, " without braces and spaces, with ':' character separating ID from duration and ',' separating\n" ); fprintf( stdout, " ID and duration pairs, where duration is specified in frames\n" ); fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" ); -#else - fprintf( stdout, "-aeid ID : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" ); -#endif fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); @@ -2179,12 +2056,8 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); return error; @@ -2269,7 +2142,6 @@ static ivas_error decodeG192( int16_t vec_pos_update, vec_pos_len; SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; -#ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; RenderConfigReader *renderConfigReader = NULL; @@ -2305,7 +2177,6 @@ static ivas_error decodeG192( goto cleanup; } } -#endif for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i ) { @@ -2507,7 +2378,6 @@ static ivas_error decodeG192( { if ( needNewFrame ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL && arg.aeSequence.count > 0 && arg.aeSequence.pValidity[arg.aeSequence.selected] != 0 ) { @@ -2538,7 +2408,6 @@ static ivas_error decodeG192( } } } -#endif #ifdef DEBUGGING #ifdef VARIABLE_SPEED_DECODING if ( arg.tsmScaleFileEnabled ) @@ -2720,7 +2589,6 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -2729,7 +2597,6 @@ static ivas_error decodeG192( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { @@ -2737,12 +2604,8 @@ static ivas_error decodeG192( goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -2869,7 +2732,6 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -2877,18 +2739,13 @@ static ivas_error decodeG192( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -2964,9 +2821,7 @@ static ivas_error decodeG192( cleanup: -#ifdef FIX_1053_REVERB_RECONFIGURATION RenderConfigReader_close( &renderConfigReader ); -#endif split_rend_reader_writer_close( &splitRendWriter ); AudioFileWriter_close( &afWriter ); MasaFileWriter_close( &masaWriter ); @@ -3539,7 +3394,6 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -3548,18 +3402,13 @@ static ivas_error decodeVoIP( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; @@ -3636,7 +3485,6 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t fullDelayNumSamples[3]; float delayMs; @@ -3645,19 +3493,14 @@ static ivas_error decodeVoIP( { fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale ); if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); goto cleanup; diff --git a/apps/renderer.c b/apps/renderer.c index 5d338d1ac6faedc0d6a79b058e343b5591cdcf2a..a01cb40c231bec33e04a32d8b4d3ce0d544cd0de 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -140,7 +140,6 @@ typedef struct IVAS_CUSTOM_LS_DATA outSetupCustom; } OutputConfig; -#ifdef FIX_1053_REVERB_RECONFIGURATION typedef struct { uint16_t *pID; @@ -149,7 +148,6 @@ typedef struct uint16_t selected; uint16_t frameCounter; } AcousticEnvironmentSequence; -#endif typedef struct { @@ -170,10 +168,8 @@ typedef struct char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; int8_t orientation_tracking; -#ifdef FIX_1135_EXT_RENDERER_HANDLES int16_t Opt_Headrotation; int16_t Opt_ExternalOrientation; -#endif int16_t nonDiegeticPan; float nonDiegeticPanGain; IVAS_REND_COMPLEXITY_LEVEL complexityLevel; @@ -190,11 +186,7 @@ typedef struct float syncMdDelay; IVAS_RENDER_FRAMESIZE render_framesize; uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; -#ifdef FIX_1053_REVERB_RECONFIGURATION AcousticEnvironmentSequence aeSequence; -#else - uint16_t acousticEnvironmentId; -#endif } CmdlnArgs; typedef enum @@ -389,11 +381,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_acousticEnvironmentId, .match = "acoustic_environment_id", .matchShort = "aeid", -#ifdef FIX_1053_REVERB_RECONFIGURATION .description = "Acoustic environment ID( number > 0 ) or a sequence thereof in the format [ID1:duration1,ID2:duration2...] without braces and spaces, with ':' character separating ID from duration and ',' separating ID and duration pairs, where duration is specified in frames for BINAURAL_ROOM_REVERB output configuration.", -#else - .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output.", -#endif }, }; @@ -713,9 +701,7 @@ int main( int16_t zeroPadToWrite = 0; int32_t delayTimeScale = 0; int16_t i, numChannels; -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t aeID; -#endif ivas_error error = IVAS_ERR_OK; #ifdef WMOPS @@ -900,11 +886,7 @@ int main( const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError opening renderer handle: %s\n", ivas_error_to_string( error ) ); goto cleanup; @@ -1089,7 +1071,6 @@ int main( fprintf( stderr, "\nFailed to read renderer configuration from file %s\n", args.renderConfigFilePath ); goto cleanup; } -#ifdef NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, args.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", args.directivityPatternId[0], args.directivityPatternId[1], args.directivityPatternId[2], args.directivityPatternId[3] ); @@ -1100,15 +1081,10 @@ int main( fprintf( stderr, "Failed to get Distance Attenuation \n\n" ); goto cleanup; } -#endif if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535; if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#else - if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#endif { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { @@ -1118,16 +1094,9 @@ int main( } else { -#ifdef FIX_1053_REVERB_RECONFIGURATION fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", aeID ); -#else - fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId ); -#endif goto cleanup; } -#ifndef FIX_587_DEFAULT_REVERB - renderConfig.roomAcoustics.override = 1; -#endif } /* ISAR frame size is set from command line, not renderer config file. @@ -1511,7 +1480,6 @@ int main( num_in_channels = inBuffer.config.numChannels; const bool isCurrentFrameMultipleOf20ms = frame % ( 4 / args.render_framesize ) == 0; -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL && args.aeSequence.count > 0 && args.aeSequence.pValidity[args.aeSequence.selected] != 0 ) { @@ -1544,7 +1512,6 @@ int main( } } } -#endif numSamplesRead = 0; /* Read the input data */ if ( ( error = AudioFileReader_read( audioReader, inpInt16Buffer, (int16_t) inBufferSize, &numSamplesRead ) ) != IVAS_ERR_OK ) @@ -1930,11 +1897,7 @@ int main( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput, NULL ) ) != IVAS_ERR_OK ) /* NULL -> use default metadata delay settings */ -#else - if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMetaOutput ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } @@ -2015,13 +1978,11 @@ cleanup: { free( bitsBufferData ); } -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( args.aeSequence.count > 0 ) { free( args.aeSequence.pID ); free( args.aeSequence.pValidity ); } -#endif for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { MasaFileReader_close( &masaReaders[i] ); @@ -2493,7 +2454,6 @@ static bool parseLfePositionConfig( } -#ifdef FIX_1053_REVERB_RECONFIGURATION static bool parseAcousticEnvironmentIds( const char *value, AcousticEnvironmentSequence *aeSequence ) @@ -2578,7 +2538,6 @@ static bool parseAcousticEnvironmentIds( return true; } -#endif static bool checkRequiredArgs( CmdlnArgs args ) @@ -2662,10 +2621,8 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES args.Opt_Headrotation = 0; args.Opt_ExternalOrientation = 0; -#endif args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; @@ -2692,15 +2649,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; } @@ -2760,9 +2713,7 @@ static void parseOption( break; case CmdLnOptionId_trajFile: assert( numOptionValues == 1 ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_Headrotation = 1; -#endif strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_outputMetadata: @@ -2783,9 +2734,7 @@ static void parseOption( break; case CmdLnOptionId_exteriorOrientationFile: assert( numOptionValues == 1 ); -#ifdef FIX_1135_EXT_RENDERER_HANDLES args->Opt_ExternalOrientation = 1; -#endif strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); break; case CmdLnOptionId_customHrtfFile: @@ -2876,19 +2825,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 ); @@ -2919,12 +2859,10 @@ static CmdlnArgs parseCmdlnArgs( exit( -1 ); /* Error printout handled by failing function */ } -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { args.Opt_Headrotation = 1; } -#endif return args; } diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index f4c7d5b8d77d6e2f25bd404ebd49afec18908d51..4b12661876343b9bc5b61c17503c01a8181055a1 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -552,12 +552,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel */ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag */ const int16_t idchan, /* i : stereo channel ID */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const int16_t active_cnt, /* i : Active frame counter */ -#endif - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag*/ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ) { int16_t i, bits, nb_subfr; @@ -772,11 +769,7 @@ ivas_error config_acelp1( bits -= acelp_cfg->mid_lsf_bits; } -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC else if ( tdm_lp_reuse_flag == 1 && idchan == 1 ) -#else - else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 ) -#endif { bits -= TDM_IC_LSF_PRED_BITS; } diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index b52f2fa17fc2d0ebbab4769b1ee786e89ca70eab..323364a354480b586185d3436dcede3ef61f3341 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -4549,11 +4549,6 @@ ivas_error preview_indices( case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; break; -#ifndef FIX_1209_SID_SIGNALING - case SID_MULTICHANNEL: - st_ivas->ivas_format = MC_FORMAT; - break; -#endif case SID_SBA_1TC: st_ivas->ivas_format = SBA_FORMAT; st_ivas->element_mode_init = IVAS_SCE; @@ -4578,9 +4573,6 @@ ivas_error preview_indices( } break; default: -#ifndef FIX_1209_SID_SIGNALING - /* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ -#endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format ); } } diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index f3c818149f953b6dbc400559db14cffa1416d63d..5fb7b349c0eb7ebe3988fee1f6487ea826bf74e1 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -300,9 +300,6 @@ typedef enum typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { -#ifndef FIX_587_DEFAULT_REVERB - int16_t override; -#endif int16_t nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX]; /* Center frequencies for which following values are provided: */ float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX]; /* - The room's T60 per center frequency */ @@ -327,9 +324,7 @@ typedef struct _IVAS_RENDER_CONFIG IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics; ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; float directivity[IVAS_MAX_NUM_OBJECTS * 3]; -#ifdef CONF_DISTATT float distAtt[3]; -#endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; typedef struct diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index a94f024fc43900807cf29d4b3f6b8d5cc58a7956..d2c4a1768ebac61e7e0e395bd94880969f8aa2bf 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -118,13 +118,9 @@ typedef enum RENDERER_NON_DIEGETIC_DOWNMIX, RENDERER_OSBA_STEREO, RENDERER_OSBA_AMBI, -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT RENDERER_OSBA_LS, RENDERER_OMASA_OBJECT_EXT, RENDERER_OMASA_MIX_EXT -#else - RENDERER_OSBA_LS -#endif } RENDERER_TYPE; @@ -183,9 +179,6 @@ typedef enum typedef enum { -#ifndef FIX_1101_CLEANING_JBM_CALL - TC_BUFFER_MODE_NONE = 0, -#endif TC_BUFFER_MODE_RENDERER, TC_BUFFER_MODE_BUFFER } TC_BUFFER_MODE; @@ -240,11 +233,7 @@ typedef enum #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ #define SID_MASA_1TC 0x3 /* 1| 1| 0 */ -#ifdef FIX_1209_SID_SIGNALING /*reserved*/ /*0x4*/ /* 0| 0| 1 */ -#else -#define SID_MULTICHANNEL 0x4 /* 0| 0| 1 */ -#endif #define SID_SBA_1TC 0x5 /* 1| 0| 1 */ #define SID_SBA_2TC 0x6 /* 0| 1| 1 */ #define SID_MASA_2TC 0x7 /* 1| 1| 1 */ @@ -1436,9 +1425,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; @@ -1470,17 +1456,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 82d4f5a0001b00ac372d1110c5a2320cb22154b1..8fc82f7cd1b67f1fe778501770b24941861f497a 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 af6026ae699a3399fb121c80e6b1635190ba7951..def09b579502acc99e805c0b9f58a556024c50c8 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 b463812919a8b880ad3b4bd0a257c25c25b51e10..2bc994564ccf05900bb73ddf41a7f6d11ffc64db 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -84,13 +84,9 @@ void ivas_write_format( void ivas_write_format_sid( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t element_mode, /* i : element bitrate */ -#ifdef NONBE_FIX_1052_SBA_EXT_FIX BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const int16_t sba_order, /* i : Ambisonic (SBA) order */ const int16_t sba_planar /* i : SBA planar flag */ -#else - BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ -#endif ); ivas_error create_sce_enc( @@ -2126,9 +2122,6 @@ void td_stereo_param_updt( const float lsp_old_PCh[], /* i : primary channel old LSPs */ const float lsf_old_PCh[], /* i : primary channel old LSFs */ const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ -#endif float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ @@ -3089,11 +3082,7 @@ void mctStereoIGF_enc( MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ Encoder_State **sts, /* i/o: encoder state structure */ float *orig_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : MDCT spectrum for ITF */ -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ -#else - float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate */ -#endif float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect. */ float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ @@ -3241,9 +3230,7 @@ void ivas_qmetadata_enc_sid_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure*/ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif const int16_t ivas_format /* i : ivas format */ ); @@ -3547,12 +3534,10 @@ int16_t ivas_sba_get_nchan_metadata( const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); -#ifdef NONBE_FIX_1052_SBA_EXT /*! r: number of bits in SBA SID frame */ int16_t ivas_sba_spar_sid_bitlen( const int16_t nchan_transport /* i : number of transport channels */ ); -#endif void ivas_sba_get_spar_hoa_ch_ind( const int16_t num_md_chs, /* i : number of MD channels */ @@ -3655,9 +3640,7 @@ ivas_error ivas_dirac_enc( const int16_t input_frame, /* i : input frame length */ const int16_t dtx_vad, /* i : DTX vad flag */ const IVAS_FORMAT ivas_format, /* i : ivas format */ -#ifdef NONBE_FIX_1052_SBA_EXT const int16_t nchan_transport, /* i : number of transport channels */ -#endif const int16_t hodirac_flag /* i : hodirac flag */ ); @@ -3715,9 +3698,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 */ ); @@ -5523,11 +5504,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( @@ -5630,7 +5607,6 @@ ivas_error ivas_osba_render_sf( float *output_f[] /* o : rendered time signal */ ); -#ifdef NONBE_1894_OSBA_SCALING void ivas_osba_stereo_add_channels( float *tc_f[], /* i : transport channels */ float *output_f[], /* i/o: output channels */ @@ -5639,7 +5615,6 @@ void ivas_osba_stereo_add_channels( const int16_t nchan_ism, /* i : number of ISM channels */ const int16_t n_samples_to_render /* i : output frame length per channel */ ); -#endif void ivas_osba_data_close( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ @@ -5793,7 +5768,6 @@ void ivas_omasa_rearrange_channels( const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT ivas_error ivas_omasa_combine_separate_ism_with_masa_open( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -5805,11 +5779,7 @@ void ivas_omasa_combine_separate_ism_with_masa( const int16_t output_frame /* i : output frame length per channel */ ); -#ifdef FIX_1161_REDUCE_OMASA_HEAP ivas_error ivas_omasa_objects_delay_open( -#else -ivas_error ivas_omasa_render_objects_from_mix_open( -#endif Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); @@ -5820,7 +5790,6 @@ void ivas_omasa_render_objects_from_mix( const int16_t output_frame /* i : output frame length per channel */ ); -#endif void ivas_omasa_dirac_rend_jbm( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ const uint16_t nSamplesAsked, /* i : number of samples requested */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 357884efd7c8de457712277c04370e2e6c3debdf..09e6703c0e1b3f1331ad787eb07ce23ed6e31f8b 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1876,15 +1876,6 @@ const float ivas_param_mc_dmx_fac_CICP19_3tc[36] = 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f /*Ct*/ }; -#ifndef FIX_1157_OBSOLETE_DMX_TABLE -const float ivas_param_mc_dmx_fac_CICP19_4tc[48] = -{ - 1.0f, 0.0f, INV_SQRT2, INV_SQRT2, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*Lht*/ - 0.0f, 1.0f, INV_SQRT2, INV_SQRT2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, /*Rht*/ - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, /*Lut*/ - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, /*Rut*/ -}; -#endif /* Coefficient for Parametric MC ILD factorization */ const float ivas_param_mc_ild_fac_CICP6_2tc[6] = @@ -2473,13 +2464,11 @@ const uint16_t ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_ * MASA ROM tables *----------------------------------------------------------------------------------*/ -#ifdef FIX_1121_MASA_DESCRIPTOR const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 /* "IVASMASA" */ }; -#endif const float diffuseness_reconstructions_hr[HR_MASA_ER_LEVELS] = { 0.00f, @@ -3129,22 +3118,6 @@ const float ivas_lpf_4_butter_48k_sos[IVAS_BIQUAD_FILT_LEN << 2] = 1.00000000471366f, 1.f , -1.98677297369091f, 0.987060670205863f }; -#ifndef NONBE_FIX_MC_LFE_LPF -const float ivas_lpf_2_butter_16k[IVAS_BIQUAD_FILT_LEN << 1] = -{ - 0.000628720643081143f, 0.00125744128616229f, 0.000628720643081143f, 1.f, -1.92783286977036f, 0.930347752342683f -}; - -const float ivas_lpf_2_butter_32k[IVAS_BIQUAD_FILT_LEN << 1] = -{ - 0.000159990787823749f, 0.000319981575647499f, 0.000159990787823749f, 1.f, -1.96390539174033f, 0.964545354891623f -}; - -const float ivas_lpf_2_butter_48k[IVAS_BIQUAD_FILT_LEN << 1] = -{ - 7.15317998432330e-05f, 0.000143063599686466f, 7.15317998432330e-05f, 1.f, -1.97593552482925f, 0.976221652028620f -}; -#endif const ivas_lfe_freq_models ivas_str_lfe_freq_models = { diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 90816bc2c20295ec5d10f92f96276f9b15065baa..798ea4b8e4a4da593783e5a21dba3704127f5a16 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -264,10 +264,8 @@ extern const uint16_t ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PA * MASA ROM tables *----------------------------------------------------------------------------------*/ -#ifdef FIX_1121_MASA_DESCRIPTOR extern const uint8_t ivasmasaFormatDescriptor[8]; /* "IVASMASA" */ -#endif extern const int16_t bits_direction_masa[DIRAC_DIFFUSE_LEVELS]; extern const int16_t no_theta_masa[NO_SPHERICAL_GRIDS - 2]; extern const int16_t no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; @@ -356,11 +354,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 a324343a5288ef4450215c618250c05f90af609d..ae040fd3d9c4900c422037d1942b57c0bb4ec0f7 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -159,7 +159,6 @@ int16_t ivas_sba_get_nchan( } -#ifdef NONBE_FIX_1052_SBA_EXT /*-------------------------------------------------------------------* * ivas_sba_spar_sid_bitlen() * @@ -181,7 +180,6 @@ int16_t ivas_sba_spar_sid_bitlen( return num_bits; } -#endif /*-------------------------------------------------------------------* * ivas_sba_get_nchan_metadata() diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 26d410b2232a4408fc97db4e401367222f3da2f0..7c2c004d6f3a26dc3084ee2d022ad71096cb40f4 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -440,12 +440,9 @@ void tdm_bit_alloc( *-------------------------------------------------------------------*/ void td_stereo_param_updt( - const float lsp_old_PCh[], /* i : primary channel old LSPs */ - const float lsf_old_PCh[], /* i : primary channel old LSFs */ - const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - float tdm_lspQ_PCh[], /* o : Q LSPs for primary channel */ -#endif + const float lsp_old_PCh[], /* i : primary channel old LSPs */ + const float lsf_old_PCh[], /* i : primary channel old LSFs */ + const float pitch_buf_PCh[], /* i : primary channel pitch buffer */ float tdm_lsfQ_PCh[], /* o : Q LSFs for primary channel */ float tdm_Pri_pitch_buf[], /* o : pitch values for primary channel */ const int16_t flag_ACELP16k, /* i : ACELP@16kHz flag */ @@ -458,55 +455,16 @@ void td_stereo_param_updt( if ( tdm_use_IAWB_Ave_lpc == 1 ) { mvr2r( IAWB_Ave, tdm_lsfQ_PCh, M ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC -#ifdef FIX_1111_TDM_LSP_BUFFER - if ( tdm_lspQ_PCh != NULL ) - { - lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); - } -#else - lsf2lsp( tdm_lsfQ_PCh, tdm_lspQ_PCh, M, INT_FS_12k8 ); -#endif -#endif } else if ( flag_ACELP16k == 1 ) { -#ifdef FIX_1111_TDM_LSP_BUFFER -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( tdm_lspQ_PCh != NULL ) - { - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); - lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); - } - else - { -#endif - float lsp_temp[M]; - mvr2r( lsp_old_PCh, lsp_temp, M ); - lsp_convert_poly( lsp_temp, L_FRAME, 0 ); - lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } -#endif -#else - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - lsp_convert_poly( tdm_lspQ_PCh, L_FRAME, 0 ); - lsp2lsf( tdm_lspQ_PCh, tdm_lsfQ_PCh, M, INT_FS_12k8 ); -#endif + float lsp_temp[M]; + mvr2r( lsp_old_PCh, lsp_temp, M ); + lsp_convert_poly( lsp_temp, L_FRAME, 0 ); + lsp2lsf( lsp_temp, tdm_lsfQ_PCh, M, INT_FS_12k8 ); } else { -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC -#ifdef FIX_1111_TDM_LSP_BUFFER - if ( tdm_lspQ_PCh != NULL ) - { - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); - } -#else - mvr2r( lsp_old_PCh, tdm_lspQ_PCh, M ); -#endif -#endif mvr2r( lsf_old_PCh, tdm_lsfQ_PCh, M ); } diff --git a/lib_com/options.h b/lib_com/options.h index 8556b7947da99ce68a4bb78a9a9e2533cc1ec45e..eae06258d74b4e8173a5b49373fc0658332e07fb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,72 +156,9 @@ /* #################### Start BASOP porting switches ############################ */ -#define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ -#define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ -#define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to actiate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on )*/ -#define LC3PLUS_LEA_COMPAT_BITRATES_48_6 /* FhG: treat split-rendering 256kbps lc3plus 10ms 0dof bitrate as sentinel value for LEA compatible 48_6 bitrate (124 kbps per channel) */ -#define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */ -#define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ -#define NONBE_FIX_ISM_XOVER_BR /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */ -#define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nok: issue 1497 - porting OMASA EXT MR */ -#define FIX_1161_REDUCE_OMASA_HEAP /* VA: reduction of OMASA heap memory */ -#define CONF_DISTATT /* Eri: Make distance attenuation configurable */ -#define FIX_1052_EXT_OUTPUT /* VA: issue 1052: define EXT decoder output configuration for stereo and MC formats */ -#define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ -#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ -#define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/ #define FIX_1129_EXT_REND_OUTPUT_HIGH /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */ -#define NONBE_FIX_MC_LFE_LPF /* Dlb: Adding the LFE LPF filter back for MC content. */ -#define FIX_1050_EFAP_ALLOC /* FhG: issue 1050: reduction of memory allocated to EFAP handle */ -#define NONBE_FIX_1052_SBA_EXT /* Dlb: SBA external output support */ -#define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ -#define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ -#define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ -#define FIX_1111_TDM_LSP_BUFFER /* VA: issue 1111: remove unused buffer `tdm_lspQ_PCh[]' */ -#define FIX_1157_OBSOLETE_DMX_TABLE /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */ -#define NONBE_1325_TD_STEREO_QUANT_LSF_SEC /* Nokia: issue 1325: fix for usage of active_cnt variable in TD stereo LSFQ */ -#define NONBE_FIX_1130_DIV_ZERO_LEV_DUR /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */ -#define NONBE_1329_FIX_OSBA_CRASH /* FhG: issue 1329: prevent assert when bit budget is low*/ -#define NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /* FhG: issue 1128: set output ambisonics order to input order for EXT output */ -#define FIX_1138_SBA_EXT_ERROR_PRINTOUT /* VA: issue 1138: Fix SBA EXT output call of audioCfg2channels() */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ -#define FIX_745_FIX_DATA_TYPE_CONVERSION /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */ -#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ -#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ -#define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ -#define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ -#define NONBE_1289_STEREO_SW_TO_MONO /* VA: issue 1289: Fix glitch when stereo signal is decoded to mono n TD->DFT switching */ -#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ -#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ -#define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ -#define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */ -#define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */ -#define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ -#define NONBE_1360_LFE_DELAY /* Dlb: LFE delay alignment when rendering in CLDFB domain*/ -#define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ -#define NONBE_SVD_OPTIMIZATION /* FhG: port-2211-svd-optimization */ -#define FIX_1135_EXT_RENDERER_HANDLES /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */ -#define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ -#define NONBE_1250_MCMASA_LS_OUTPUT /* VA: issue 1250: fix crash in McMASA to custom LS output decoding */ -#define FIX_1158_FASTCONV_REVERB_HRTF /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */ -#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ -#define NONBE_1131_ACELP_OOB /* VA: issue 1131: fix division-by-zero in acelp gain decoding caused by wrong length of buffer update when switching from HQ core to ACELP core */ -#define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ -#define FIX_1101_CLEANING_JBM_CALL /* VA: issue 1101: remove obsolete call of ivas_jbm_dec_tc_buffer_open() */ -#define NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND /* Eri: issue 1337: Missing directivity setting and distance attenuation in external renderer IVAS_rend */ -#define FIX_1348_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_dec(), brings floating-point code inline with FX */ -#define FIX_VOIP_FUNCTIONS /* VA: fix data type mismatch in IVAS_DEC_VoIP_SetScale() + add sanity checks to API functions */ -#define FIX_1298_MEMORY_OPT_IVAS_CORE_ENC /* VA: issue 1298: Memory saving in ivas_core_enc() */ -#define FIX_587_DEFAULT_REVERB /* Philips: issue 587: inconsistent default reverb parameters across renderers */ -#define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ -#define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ -#define FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX /* VA: issue 1249: remove obsolete code around ALLRAD decoder matrix */ -#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ -#define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ -#define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ -#define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ - #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 5ad14bf8923c927321a13bc78bb56b6fbbcb5e2b..b917d41dc2d26fe910df2f495e97bc7436babc9a 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -4507,17 +4507,14 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ); void bass_psfilter_init( @@ -9071,12 +9068,9 @@ ivas_error config_acelp1( const int16_t tdm_lp_reuse_flag, /* i : LPC reuse flag (can be 1 only with secondary channel*/ const int16_t tdm_low_rate_mode, /* i : secondary channel low rate mode flag*/ const int16_t idchan, /* i : channel id */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const int16_t active_cnt, /* i : Active frame counter */ -#endif - const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ - const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ - const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ + const int16_t tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ + const int16_t tdm_LRTD_flag, /* i : LRTD stereo mode flag */ + const int16_t GSC_IVAS_mode /* i : GSC IVAS mode */ ); /*! r: ACELP16k flag */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 159702cfc63d1bdcc59c42d73ce915151cb35545..c5ae6c1ae9c641b92c2666b3e9deda0631af9909 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -67,17 +67,14 @@ ivas_error acelp_core_dec( int16_t *unbits, /* o : number of unused bits */ int16_t *sid_bw, /* o : 0-NB/WB, 1-SWB SID */ STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - const float tdm_lspQ_PCh[M], /* i : Q LSPs for primary channel */ -#endif - const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ - const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ - const int16_t last_element_mode, /* i : last element mode */ - const int32_t last_element_brate, /* i : last element bitrate */ - const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ - const int16_t nchan_out, /* i : number of output channels */ - STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ - const int16_t read_sid_info /* i : read SID info flag */ + const float tdm_lsfQ_PCh[M], /* i : Q LSFs for primary channel */ + const int16_t use_cldfb_for_dft, /* i : flag to use of CLDFB for DFT Stereo */ + const int16_t last_element_mode, /* i : last element mode */ + const int32_t last_element_brate, /* i : last element bitrate */ + const int16_t flag_sec_CNA, /* i : CNA flag for secondary channel */ + const int16_t nchan_out, /* i : number of output channels */ + STEREO_CNG_DEC_HANDLE hStereoCng, /* i : stereo CNG handle */ + const int16_t read_sid_info /* i : read SID info flag */ ) { float old_exc[L_EXC_DEC], *exc; /* excitation signal buffer */ @@ -615,19 +612,11 @@ ivas_error acelp_core_dec( nb_bits = -1; } -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, tc_subfr_tmp, 1, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif if ( st->coder_type == TRANSITION && tc_subfr < L_SUBFR && st->L_frame == L_FRAME ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, TRANSITION, -1, tc_subfr, 2, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } } @@ -664,22 +653,10 @@ ivas_error acelp_core_dec( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( st->active_cnt != 1 ) - { -#endif - int16_t beta_index; + int16_t beta_index; - beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); - tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } - else - { - mvr2r( tdm_lspQ_PCh, lsp_new, M ); - mvr2r( tdm_lsfQ_PCh, lsf_new, M ); - } -#endif + beta_index = get_next_indice( st, TDM_IC_LSF_PRED_BITS ); + tdm_SCh_lsf_reuse( DEC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, NULL, &beta_index ); if ( st->rate_switching_reset ) { @@ -712,11 +689,7 @@ ivas_error acelp_core_dec( old_exc_s = st->old_exc + L_EXC_MEM_DEC - st->L_frame; tmpF = *old_exc_s; st->mem_deemph = old_exc_s[st->L_frame - 1]; -#ifdef NONBE_1131_ACELP_OOB preemph( old_exc_s, st->preemph_fac, st->L_frame, &tmpF ); -#else - preemph( old_exc_s, st->preemph_fac, L_FRAME16k, &tmpF ); -#endif mvr2r( old_exc_s + st->L_frame - M, st->mem_syn2, M ); residu( Aq, M, old_exc_s, old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame ); } diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index 762de6e65eca6182b99ba19b33a6eb2c02c8cab5..50b70ad1a39e9d9d88304b4191605b639054730d 100644 --- a/lib_dec/acelp_core_switch_dec.c +++ b/lib_dec/acelp_core_switch_dec.c @@ -158,11 +158,7 @@ ivas_error acelp_core_switch_dec( * Excitation decoding *----------------------------------------------------------------*/ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#else - config_acelp1( DEC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), st->next_bit_pos, GENERIC, st->inactive_coder_type_flag, -1, -1, &decode_bwe /* dummy */, &i, st->element_mode, &i /*dummy*/, 0, 0, st->idchan, st->active_cnt, 0, 0, 0 /*st->GSC_IVAS_mode*/ ); -#endif decod_gen_voic_core_switch( st, L_frame_for_cs, 0, Aq, exc, cbrate ); diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index eed017087c7b70ab8148d204b7d5f80d0bdeeb05..c6e7fe24c316a7c97d29fd9cada922049aedae6a 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -263,14 +263,9 @@ ivas_error core_switching_pre_dec( st->uv_count = 0; } -#ifdef NONBE_1214_PLC_LSF_MEMORY if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) /* EVS and HQ -> ACELP */ || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 && st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) || ( st->core == ACELP_CORE && st->last_L_frame > L_FRAME16k ) /* TCX @ 25.6/32 kHz -> ACELP */ ) -#else - if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 && - st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) ) -#endif { if ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) { diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index e3bdde2f501749ffbe6cc1729be12a15e392b8d7..464437d75cd72b244721ab935900bb932250242f 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -259,11 +259,7 @@ ivas_error evs_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_dec( st, NULL, synth, NULL, bwe_exc_extended, voice_factors, old_syn_12k8_16k, sharpFlag, pitch_buf, &unbits, &sid_bw, NULL, NULL, NULL, 0, EVS_MONO, 0, 0, 1, NULL, 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index 2902b4daba537a1cfe983aae52a537f8587c2e63..693631cf31dfd855b417f28b50ff3266083e9db5 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -111,11 +111,7 @@ void decod_audio( } /* set bit-allocation */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( DEC, st->total_brate, st->core_brate, st->core, st->extl_orig, st->extl_brate_orig, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), st->next_bit_pos, st->coder_type, st->inactive_coder_type_flag, -1, 1, &nb_bits, NULL, st->element_mode, &nbits /*dummy*/, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /*---------------------------------------------------------------* * Decode energy dynamics diff --git a/lib_dec/hq_lr_dec.c b/lib_dec/hq_lr_dec.c index c338f238cdb73026c4de48096d14fc1480781448..730955e9a19e0bc6c8139d2b15ac16de43318cec 100644 --- a/lib_dec/hq_lr_dec.c +++ b/lib_dec/hq_lr_dec.c @@ -260,14 +260,10 @@ void hq_lr_dec( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef FIX_1348_OVERFLOW #ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */ #else Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif -#else - Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ #endif Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); } @@ -616,7 +612,6 @@ void hq_lr_dec( IF( sub( i, highband ) >= 0 ) { -#ifdef NONBE_1118_EVS_LR_HQ_BITERROR /* safety check in case of bit errors */ if ( Ep_fx[i] > 536788991 /* max(Q30) */ ) { @@ -625,12 +620,10 @@ void hq_lr_dec( return; } -#endif enerH_fx = L_add( enerH_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ } ELSE IF( sub( i, lowband ) >= 0 ) { -#ifdef NONBE_1118_EVS_LR_HQ_BITERROR /* safety check in case of bit errors */ if ( Ep_fx[i] > 536788991 /* max(Q30) */ ) { @@ -639,7 +632,6 @@ void hq_lr_dec( return; } -#endif enerL_fx = L_add( enerL_fx, L_shl( Ep_fx[i], 2 ) ); /*Q0 */ } } diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index 7d0ca6dac4a26b17e498071b56c0b891b2d283d4..c2582a22d7964ed93fae70515881292cb655cc13 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -293,11 +293,7 @@ ivas_error init_decoder( st->last_vad = 0; st->last_active_brate = ACELP_7k20; st->last_CNG_L_frame = L_FRAME; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC st->active_cnt = CNG_TYPE_HO; -#else - st->active_cnt = 20; -#endif if ( idchan == 0 && ( st->element_mode == EVS_MONO || st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) ) { diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 0c37769c3a2f841a4722676bf3662797653cfbe7..61ff1614424807d9bfb72871875e8f9a2818d463 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -47,7 +47,6 @@ #endif #include "wmc_auto.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION /*------------------------------------------------------------------------- * Local constants @@ -59,7 +58,6 @@ const float dmxmtx_table[BINAURAL_CHANNELS][REVERB_INPUT_DOWNMIX_CHANNELS] = { { 1.0f, 0.0f, 0.70709997f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f }, { 0.0f, 1.0f, 0.70709997f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f }, }; -#endif /*------------------------------------------------------------------------- * ivas_binRenderer_filterModule() @@ -837,11 +835,7 @@ static void ivas_binaural_obtain_DMX( for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION float dmxConst = dmxmtx_table[chOutIdx][chIdx]; -#else - float dmxConst = hBinRenderer->hReverb->dmxmtx[chOutIdx][chIdx]; -#endif for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { for ( k = 0; k < numTimeSlots; k++ ) @@ -1050,15 +1044,9 @@ ivas_error ivas_binRenderer_open( ) { BINAURAL_RENDERER_HANDLE hBinRenderer; -#ifdef FIX_1053_REVERB_RECONFIGURATION int16_t convBand, k; -#else - int16_t convBand, chIdx, k; -#endif ivas_error error; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif error = IVAS_ERR_OK; @@ -1198,7 +1186,6 @@ ivas_error ivas_binRenderer_open( /* Allocate memories needed for reverb module */ if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ? &( st_ivas->hRenderConfig->roomAcoustics ) : NULL; if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, @@ -1207,42 +1194,11 @@ ivas_error ivas_binRenderer_open( pRoomAcoustics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, - st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - NULL -#endif - ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif + st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections, + NULL ) ) != IVAS_ERR_OK ) { return error; } - -#ifndef FIX_1053_REVERB_RECONFIGURATION - /* initialize the dmx matrix */ - if ( hBinRenderer->nInChannels != HOA3_CHANNELS ) - { - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < hBinRenderer->nInChannels; k++ ) - { - hBinRenderer->hReverb->dmxmtx[chIdx][k] = dmxmtx_table[chIdx][k]; - } - } - } - if ( hBinRenderer->nInChannels != HOA3_CHANNELS ) - { - for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - for ( k = 0; k < hBinRenderer->nInChannels; k++ ) - { - hBinRenderer->hReverb->dmxmtx[chIdx][k] = dmxmtx_table[chIdx][k]; - } - } - } -#endif } else { diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 9a63526b93e0bb80f1f61b2d912a514301932702..9c146d5a5d49ad8e7f5cfddfcbbce572218a564a 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -83,11 +83,7 @@ ivas_error ivas_core_dec( int16_t unbits[CPE_CHANNELS]; int16_t sid_bw[CPE_CHANNELS]; FRAME_MODE frameMode[CPE_CHANNELS]; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC float tdm_lsfQ_PCh[M]; -#else - float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; -#endif int16_t tdm_LRTD_flag; int32_t element_brate, output_Fs; int32_t last_element_brate; @@ -352,11 +348,7 @@ ivas_error ivas_core_dec( if ( st->core == ACELP_CORE ) { /* ACELP core decoder */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hCPE == NULL ? NULL : hCPE->hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) -#else - if ( ( error = acelp_core_dec( st, output[n], synth[n], save_hb_synth, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], sharpFlag[n], pitch_buf[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lspQ_PCh, tdm_lsfQ_PCh, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hCPE == NULL ? NULL : hCPE->hStereoCng, read_sid_info ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -380,11 +372,7 @@ ivas_error ivas_core_dec( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, st->old_pitch_buf + st->nb_subfr, tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif } } /* n_channels loop */ diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index 7a6db2376dfa5f1ff2c3ba329257724fd50ac2df..97be3ac585abdcc47ffe0f1762c3b3b1e0d6624d 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_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index 87c4804022aabba72330fd618c5919c811d9063a..ebc295cb7204209d9107844c96af15cb35ef611b 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -375,23 +375,17 @@ ivas_error ivas_cpe_dec( if ( sts[1] != NULL ) { sts[1]->active_cnt = 0; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC if ( sts[1]->ini_frame == 0 ) { sts[1]->active_cnt = CNG_TYPE_HO; } -#endif } } else { sts[n]->VAD = 1; sts[n]->active_cnt++; -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC sts[n]->active_cnt = min( sts[n]->active_cnt, 200 ); -#else - sts[n]->active_cnt = min( sts[n]->active_cnt, 100 ); -#endif } /* set CNA flag */ diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 8fc0712d519e32907b3cd0a87de64a0a786fa880..4ea1e11603c0283a514807e678d6ceb98ae02633 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -871,11 +871,7 @@ ivas_error ivas_dirac_dec_config( if ( st_ivas->hDiracDecBin[0] == NULL ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -977,10 +973,8 @@ void ivas_dirac_dec_read_BS( int16_t *nb_bits, /* o : number of bits read */ const int16_t last_bit_pos, /* i : last read bitstream position */ const int16_t hodirac_flag, /* i : flag to indicate HO-DirAC mode */ -#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; @@ -1013,11 +1007,7 @@ void ivas_dirac_dec_read_BS( } } -#ifdef NONBE_FIX_1052_SBA_EXT *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT ); -#else - *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT ); -#endif for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { hQMetaData->q_direction[0].band_data[orig_dirac_bands - 1].azimuth[i] = hQMetaData->q_direction[0].band_data[1].azimuth[0]; @@ -1065,11 +1055,7 @@ void ivas_dirac_dec_read_BS( next_bit_pos_orig = st->next_bit_pos; /* subtract mode signaling bits, since bitstream was moved after mode reading */ -#ifdef NONBE_FIX_1052_SBA_EXT st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS - SBA_PLANAR_BITS - SBA_ORDER_BITS ); -#else - st->next_bit_pos = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC - 1 - SID_FORMAT_NBITS ); -#endif /* 1 bit flag for signaling metadata to read */ b = st->bit_stream[( st->next_bit_pos )--]; @@ -1091,11 +1077,7 @@ void ivas_dirac_dec_read_BS( } -#ifdef NONBE_FIX_1052_SBA_EXT *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), nchan_transport, NULL, SBA_FORMAT ); -#else - *nb_bits += ivas_qmetadata_dec_sid_decode( hQMetaData, st->bit_stream, &( st->next_bit_pos ), 0, NULL, SBA_FORMAT ); -#endif for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ ) { @@ -2241,117 +2223,74 @@ void ivas_dirac_dec_render_sf( /* render objects in combined format onto the CICP19 channels for BINAURAL_ROOM_IR */ if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - int16_t in_ch; - for ( in_ch = 0; in_ch < st_ivas->nchan_ism; in_ch++ ) + int16_t j, k, l; + int16_t num_objects, nchan_out_woLFE; + int16_t az1, el1; + int16_t n_slots_to_render; + int16_t n_samples_to_render; + float gain, prev_gain; + + num_objects = st_ivas->nchan_ism; + nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; + n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; + n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render; + + if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) { -#endif - int16_t j, k, l; -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - int16_t j2, lfe_index; -#endif - int16_t num_objects, nchan_out_woLFE; - int16_t az1, el1; - int16_t n_slots_to_render; - int16_t n_samples_to_render; -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - int16_t interp_offset; -#endif - float gain, prev_gain; - - num_objects = st_ivas->nchan_ism; - nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE; - n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; - n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render; -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - interp_offset = st_ivas->hTcBuffer->n_samples_rendered; -#endif + ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); + st_ivas->hIsmRendererData->interp_offset = 0; + } - if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] ) + for ( i = 0; i < num_objects; i++ ) + { + /* Combined rotation: rotate the object positions depending the head and external orientations */ + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) { - ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator ); -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING - st_ivas->hIsmRendererData->interp_offset = 0; -#else - interp_offset = 0; -#endif + rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &az1, &el1, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); + if ( st_ivas->hEFAPdata != NULL ) + { + efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], az1, el1, EFAP_MODE_EFAP ); + } } - for ( i = 0; i < num_objects; i++ ) + for ( j = 0; j < nchan_out_woLFE; j++ ) { - /* Combined rotation: rotate the object positions depending the head and external orientations */ - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) + gain = st_ivas->hIsmRendererData->gains[i][j]; + prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; + if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) { - rotateAziEle( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, &az1, &el1, st_ivas->hCombinedOrientationData->Rmat[0], st_ivas->hIntSetup.is_planar_setup ); - if ( st_ivas->hEFAPdata != NULL ) - { - efap_determine_gains( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains[i], az1, el1, EFAP_MODE_EFAP ); - } - } + float *tc_re, *tc_im; + float *w1, w2; -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING - for ( j = 0; j < nchan_out_woLFE; j++ ) -#else - lfe_index = 0; - for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ ) -#endif - { -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING - if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) ) - { - ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++; - } -#endif - gain = st_ivas->hIsmRendererData->gains[i][j]; - prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j]; - if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f ) - { - float *tc_re, *tc_im; - float *w1, w2; + w1 = &st_ivas->hIsmRendererData->interpolator[st_ivas->hIsmRendererData->interp_offset]; -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING - w1 = &st_ivas->hIsmRendererData->interpolator[st_ivas->hIsmRendererData->interp_offset]; -#else - w1 = &st_ivas->hIsmRendererData->interpolator[interp_offset]; -#endif + tc_re = pppQMfFrame_ts_re[nchan_transport + i][0]; + tc_im = pppQMfFrame_ts_im[nchan_transport + i][0]; + + for ( k = 0; k < n_slots_to_render; k++ ) + { + float g; - tc_re = pppQMfFrame_ts_re[nchan_transport + i][0]; - tc_im = pppQMfFrame_ts_im[nchan_transport + i][0]; + w2 = 1.0f - *w1; + g = ( *w1 * gain + w2 * prev_gain ); - for ( k = 0; k < n_slots_to_render; k++ ) + for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) { - float g; - - w2 = 1.0f - *w1; - g = ( *w1 * gain + w2 * prev_gain ); - - for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) - { -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING - Cldfb_RealBuffer[j][k][l] += g * *( tc_re++ ); - Cldfb_ImagBuffer[j][k][l] += g * *( tc_im++ ); -#else - Cldfb_RealBuffer[j2][k][l] += g * *( tc_re++ ); - Cldfb_ImagBuffer[j2][k][l] += g * *( tc_im++ ); -#endif - } - w1 += hSpatParamRendCom->num_freq_bands; + Cldfb_RealBuffer[j][k][l] += g * *( tc_re++ ); + Cldfb_ImagBuffer[j][k][l] += g * *( tc_im++ ); } + w1 += hSpatParamRendCom->num_freq_bands; } + } - /* update here only in case of head rotation */ - if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) - { - st_ivas->hIsmRendererData->prev_gains[i][j] = gain; - } + /* update here only in case of head rotation */ + if ( st_ivas->hCombinedOrientationData != NULL && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] == 1 ) + { + st_ivas->hIsmRendererData->prev_gains[i][j] = gain; } } -#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING } -#endif -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING st_ivas->hIsmRendererData->interp_offset += hSpatParamRendCom->num_freq_bands * st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered]; -#endif } if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -2449,14 +2388,10 @@ void ivas_dirac_dec_render_sf( /* Move the separated and the LFE channels to temporary variables as spatial synthesis may overwrite current channels */ mvr2r( &( output_f[st_ivas->hOutSetup.separateChannelIndex][subframe_start_sample] ), tmp_separated, num_samples_subframe ); -#ifdef NONBE_1250_MCMASA_LS_OUTPUT if ( hDirACRend->hOutSetup.num_lfe > 0 ) { mvr2r( &( output_f[LFE_CHANNEL][subframe_start_sample] ), tmp_lfe, num_samples_subframe ); } -#else - mvr2r( &( output_f[LFE_CHANNEL][subframe_start_sample] ), tmp_lfe, num_samples_subframe ); -#endif for ( ch = 0; ch < outchannels; ch++ ) { diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index 5139a6d55c08a9329d7b89a264fb60d334713c7d..cd525dbf8b5da7d910699d49feedde5015506129 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov.c @@ -51,13 +51,11 @@ #include "wmc_auto.h" #include "rom_dec.h" -#ifdef NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS /*-----------------------------------------------------------------------* * Local constants *-----------------------------------------------------------------------*/ #define SQRT_EPSILON 3.16227755e-08 /* square root of EPSILON */ -#endif /*-------------------------------------------------------------------* * ivas_dirac_dec_output_synthesis_cov_open() @@ -581,11 +579,7 @@ int16_t computeMixingMatrices( *-----------------------------------------------------------------*/ maximum( svd_s_buffer, lengthCx, &limit ); -#ifdef NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS limit = (float) max( limit * reg_Sx, SQRT_EPSILON ); -#else - limit = limit * reg_Sx + EPSILON; -#endif for ( i = 0; i < lengthCx; ++i ) { diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 8d00ef2b9802eab2fa36f1de30018c6dce8a2746..1b53d7fc4f0af925f57fc0138f93945d0f08aad3 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -54,17 +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 -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( const int16_t sba_order ); -#else -static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order ); -#endif -#endif -#ifdef NONBE_FIX_1052_SBA_EXT -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER /*-------------------------------------------------------------------* * ivas_set_audio_config_from_sba_order() * @@ -75,9 +67,6 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord static AUDIO_CONFIG ivas_set_audio_config_from_sba_order( const int16_t sba_order /* i : Ambisonic (SBA) order */ ) -#else -static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_order ) -#endif { AUDIO_CONFIG output_config; @@ -95,20 +84,14 @@ static AUDIO_CONFIG ivas_set_output_config_from_sba_order( const int16_t sba_ord output_config = IVAS_AUDIO_CONFIG_HOA3; break; default: -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER output_config = IVAS_AUDIO_CONFIG_INVALID; break; -#else - assert( 0 ); -#endif } return output_config; } -#endif -#ifdef FIX_1209_SID_SIGNALING /*---------------------------------------------------------------------* * ivas_dec_get_format( ) * @@ -471,7 +454,6 @@ ivas_error ivas_dec_get_format( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* @@ -504,14 +486,10 @@ ivas_error ivas_dec_setup( * Read IVAS format *-------------------------------------------------------------------*/ -#ifdef FIX_1209_SID_SIGNALING if ( ( error = ivas_read_format( st_ivas, &num_bits_read ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_read_format( st_ivas, &num_bits_read ); -#endif /*-------------------------------------------------------------------* * Read other signling (ISM/MC mode, number of channels, etc.) @@ -560,19 +538,6 @@ ivas_error ivas_dec_setup( st_ivas->sba_order = st_ivas->bit_stream[num_bits_read + 1]; st_ivas->sba_order += 2 * st_ivas->bit_stream[num_bits_read]; -#ifndef NONBE_FIX_1052_SBA_EXT_FIX -#ifdef NONBE_FIX_1052_SBA_EXT - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER - st_ivas->hDecoderConfig->output_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); -#else - st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order ); -#endif - st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); - } -#endif -#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 ) { @@ -601,13 +566,11 @@ ivas_error ivas_dec_setup( { st_ivas->nchan_transport = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* this should be non-zero if original input format was MASA_ISM_FORMAT */ st_ivas->nchan_ism = st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 3] + 2 * st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 2]; 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 @@ -622,19 +585,9 @@ 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; } -#endif if ( st_ivas->ini_frame > 0 ) { /* reconfigure in case a change of operation mode is detected */ @@ -724,25 +677,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; } @@ -832,19 +775,6 @@ ivas_error ivas_dec_setup( break; } -#ifndef NONBE_FIX_1052_SBA_EXT_FIX -#ifdef NONBE_FIX_1052_SBA_EXT - if ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER - st_ivas->hDecoderConfig->output_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); -#else - st_ivas->hDecoderConfig->output_config = ivas_set_output_config_from_sba_order( st_ivas->sba_order ); -#endif - st_ivas->hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->hDecoderConfig->output_config ); - } -#endif -#endif if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format == SBA_FORMAT ) { int16_t nchan_transport_old, nchan_transport; @@ -1066,11 +996,6 @@ static ivas_error ivas_read_format( case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; break; -#ifndef FIX_1209_SID_SIGNALING - case SID_MULTICHANNEL: - st_ivas->ivas_format = MC_FORMAT; - break; -#endif case SID_SBA_1TC: st_ivas->ivas_format = SBA_FORMAT; st_ivas->element_mode_init = IVAS_SCE; @@ -1095,16 +1020,12 @@ static ivas_error ivas_read_format( } break; default: -#ifndef FIX_1209_SID_SIGNALING -/* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ -#endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format ); } 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; @@ -1113,7 +1034,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; @@ -1219,9 +1139,7 @@ ivas_error ivas_init_decoder_front( st_ivas->nSCE = 0; st_ivas->nCPE = 0; -#ifdef NONBE_FIX_1052_SBA_EXT_FIX st_ivas->nchan_ism = 0; -#endif st_ivas->nchan_transport = -1; st_ivas->ism_mode = ISM_MODE_NONE; @@ -1357,11 +1275,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; @@ -1383,7 +1297,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; @@ -1392,27 +1305,12 @@ ivas_error ivas_init_decoder( { hDecoderConfig->nchan_out = audioCfg2channels( st_ivas->transport_config ); } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX else if ( st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) -#else - else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif -#else - if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif { -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER hDecoderConfig->nchan_out = audioCfg2channels( ivas_set_audio_config_from_sba_order( st_ivas->sba_order ) ); -#else - hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); -#endif hDecoderConfig->nchan_out += st_ivas->nchan_ism; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == MASA_FORMAT ) -#else - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) -#endif { hDecoderConfig->nchan_out = st_ivas->nchan_transport + st_ivas->nchan_ism; } @@ -1430,30 +1328,20 @@ 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 ); st_ivas->intern_config = st_ivas->transport_config; } -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER -#ifdef NONBE_FIX_1052_SBA_EXT_FIX else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && ( st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == SBA_FORMAT ) ) -#else - else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->ivas_format == SBA_ISM_FORMAT ) -#endif { st_ivas->intern_config = ivas_set_audio_config_from_sba_order( st_ivas->sba_order ); ivas_output_init( &( st_ivas->hOutSetup ), st_ivas->intern_config ); } -#endif else { 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 ) { @@ -1463,16 +1351,6 @@ ivas_error ivas_init_decoder( st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( st_ivas->intern_config ); } -#ifndef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - st_ivas->hOutSetup.ambisonics_order = SBA_HOA3_ORDER; - st_ivas->intern_config = IVAS_AUDIO_CONFIG_HOA3; - st_ivas->hOutSetup.output_config = IVAS_AUDIO_CONFIG_HOA3; - st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); - } - -#endif /* Only initialize transport setup if it is used */ if ( st_ivas->transport_config != IVAS_AUDIO_CONFIG_INVALID ) { @@ -1643,15 +1521,6 @@ ivas_error ivas_init_decoder( { return error; } -#ifndef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->hOutSetup.is_loudspeaker_setup ) - { - if ( ( error = ivas_sba_get_hoa_dec_matrix( st_ivas->hOutSetup, &st_ivas->hoa_dec_mtx, st_ivas->hIntSetup.ambisonics_order ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ) != IVAS_ERR_OK ) @@ -1659,11 +1528,7 @@ ivas_error ivas_init_decoder( return error; } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && !( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) -#else - if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) -#endif { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { @@ -1802,15 +1667,6 @@ ivas_error ivas_init_decoder( { return error; } -#ifndef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX - if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->hOutSetup.is_loudspeaker_setup ) - { - if ( ( error = ivas_sba_get_hoa_dec_matrix( st_ivas->hOutSetup, &st_ivas->hoa_dec_mtx, st_ivas->hIntSetup.ambisonics_order ) ) != IVAS_ERR_OK ) - { - return error; - } - } -#endif if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ), st_ivas->ivas_format ) ) != IVAS_ERR_OK ) @@ -1856,16 +1712,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; } @@ -2276,11 +2128,7 @@ ivas_error ivas_init_decoder( } } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2382,46 +2230,31 @@ ivas_error ivas_init_decoder( } } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /* Allocate memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#else - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } if ( st_ivas->renderer_type == RENDERER_DIRAC && ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_omasa_render_objects_from_mix_open( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2441,7 +2274,6 @@ ivas_error ivas_init_decoder( return error; } } -#endif } if ( ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && @@ -2481,39 +2313,6 @@ ivas_error ivas_init_decoder( } } -#ifndef NONBE_FIX_MC_LFE_LPF - /*-----------------------------------------------------------------* - * LFE handles for rendering after rendering to adjust LFE delay to filter delay - *-----------------------------------------------------------------*/ - - if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) - { - binauralization_delay_ns = st_ivas->binaural_latency_ns; - if ( st_ivas->hBinRenderer != NULL ) - { - if ( st_ivas->hBinRenderer->render_lfe ) - { - if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - /* Account for filterbank delay */ - binauralization_delay_ns += IVAS_FB_DEC_DELAY_NS; - } - } - else - { - binauralization_delay_ns = 0; - } - } - - if ( ( error = ivas_create_lfe_dec( &st_ivas->hLFE, output_Fs, binauralization_delay_ns ) ) != IVAS_ERR_OK ) - { - return error; - } - - set_zero( st_ivas->hLFE->prevsynth_buf, LFE_PLC_BUFLEN ); - set_zero( st_ivas->hLFE->prior_out_buffer, L_FRAME48k ); - } -#endif /*-----------------------------------------------------------------* * CLDFB handles for rendering @@ -2551,14 +2350,12 @@ 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 *-----------------------------------------------------------------*/ if ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { -#ifdef NONBE_1360_LFE_DELAY if ( st_ivas->hIntSetup.index_lfe[0] != -1 ) { delay_ns = st_ivas->binaural_latency_ns; @@ -2567,9 +2364,6 @@ ivas_error ivas_init_decoder( { delay_ns = 0; } -#else - delay_ns = st_ivas->binaural_latency_ns; -#endif if ( st_ivas->hBinRenderer != NULL ) { if ( st_ivas->hBinRenderer->render_lfe ) @@ -2601,7 +2395,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 @@ -2627,22 +2420,7 @@ ivas_error ivas_init_decoder( } } -#ifndef FIX_1101_CLEANING_JBM_CALL - if ( st_ivas->hTcBuffer == NULL ) - { - /* we need the handle anyway, but without the buffer*/ - if ( ( error = ivas_jbm_dec_tc_buffer_open( st_ivas, TC_BUFFER_MODE_NONE, 0, 0, 0, 1 ) ) != IVAS_ERR_OK ) - { - return error; - } - } - -#endif -#ifdef FIX_1099_JBM_MD_HANDLE_ALLOC if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->Opt_tsm ) -#else - if ( st_ivas->hJbmMetadata == NULL && st_ivas->hDecoderConfig->Opt_tsm ) -#endif { if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -3349,7 +3127,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbSyntheses = 0; } break; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: *numCldfbAnalyses = st_ivas->nchan_transport; *numCldfbSyntheses = st_ivas->hDecoderConfig->nchan_out; @@ -3358,7 +3135,6 @@ void ivas_init_dec_get_num_cldfb_instances( *numCldfbAnalyses = st_ivas->nchan_transport + 1; *numCldfbSyntheses = 0; break; -#endif default: assert( 0 && "Renderer not handled for CLDFB reservation." ); } @@ -3418,50 +3194,12 @@ static ivas_error doSanityChecks_IVAS( /* Verify stereo output configuration */ if ( st_ivas->ivas_format == STEREO_FORMAT ) { -#ifdef FIX_1052_EXT_OUTPUT if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM ) -#endif { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" ); } } -#ifdef FIX_1052_EXT_OUTPUT if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - else if ( st_ivas->ivas_format == ISM_FORMAT ) - { - /* Verify ISM output configuration */ - if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for ISM" ); - } - } - else if ( st_ivas->ivas_format == SBA_FORMAT ) - { - /* Verify SBA output coniguration */ - if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for SBA" ); - } - } - else if ( st_ivas->ivas_format == MASA_FORMAT ) - { - if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for MASA!" ); - } - } - else if ( st_ivas->ivas_format == MC_FORMAT ) - { - /* Verify MC output configuration */ - if ( output_config == IVAS_AUDIO_CONFIG_INVALID || output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for Multi-channel" ); - } - } -#endif if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 ) { @@ -3499,15 +3237,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED, "Wrong set-up: Acoustic environment is not supported in this output configuration." ); } } -#ifndef NONBE_FIX_984_OMASA_EXT_OUTPUT - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) - { - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - } -#endif #ifdef DEBUGGING if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) { diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index a115532990f3f3f180ecdf6ca9b027a707f549c5..ae347706fd06642c970789c975595db7f0d34cd8 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -237,11 +237,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -268,11 +264,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, &( st_ivas->hHrtfParambin ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_dirac_dec_init_binaural_data( st_ivas, st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index ba878d4b65b3abf946ef1ec13832bd94c88fbb0a..4845004dc80dc31bd1678ad26c2682bfbe5785fb 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -711,11 +711,7 @@ void ivas_ism_dec_digest_tc( if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_OSBA_AMBI || - st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING - || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#endif - ) + st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) { st_ivas->hIsmRendererData->interpolator[0] = 0.0f; for ( i = 1; i < interpolator_length; i++ ) @@ -735,9 +731,7 @@ void ivas_ism_dec_digest_tc( { ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator ); } -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING st_ivas->hIsmRendererData->interp_offset = 0; -#endif /* also get the gains here */ for ( i = 0; i < st_ivas->nchan_ism; i++ ) @@ -756,11 +750,7 @@ void ivas_ism_dec_digest_tc( if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING || st_ivas->renderer_type == RENDERER_OSBA_LS || - st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING - || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) -#endif - ) && + st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) ) && st_ivas->hCombinedOrientationData == NULL ) { if ( st_ivas->hIntSetup.is_planar_setup ) diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 19338aa72a4bf892e2613366e4be29e2dedeb6ee..95bdd1d7c29d72f320360e8f29fb0df9d89f3ade 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 ) { @@ -374,14 +370,10 @@ ivas_error ivas_omasa_separate_object_renderer_open( init_interpolator_length = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ); interpolator_length = init_interpolator_length; -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( st_ivas->hIsmRendererData->interpolator = (float *) malloc( sizeof( float ) * init_interpolator_length ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM renderer interpolator \n" ) ); } -#else - st_ivas->hIsmRendererData->interpolator = (float *) malloc( sizeof( float ) * init_interpolator_length ); -#endif for ( i = 0; i < interpolator_length; i++ ) { @@ -389,32 +381,6 @@ ivas_error ivas_omasa_separate_object_renderer_open( } st_ivas->hIsmRendererData->interpolator_length = interpolator_length; -#ifndef FIX_1161_REDUCE_OMASA_HEAP - st_ivas->hMasaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); - - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - st_ivas->hMasaIsmData->delayBuffer_nchan = 1; - } - else - { - st_ivas->hMasaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; - } - - if ( ( st_ivas->hMasaIsmData->delayBuffer = (float **) malloc( st_ivas->hMasaIsmData->delayBuffer_nchan * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); - } - - for ( i = 0; i < st_ivas->hMasaIsmData->delayBuffer_nchan; i++ ) - { - if ( ( st_ivas->hMasaIsmData->delayBuffer[i] = (float *) malloc( st_ivas->hMasaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for MASA ISM delay buffer \n" ) ); - } - set_zero( st_ivas->hMasaIsmData->delayBuffer[i], st_ivas->hMasaIsmData->delayBuffer_size ); - } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index dacbbf159cf62341d8d2449dfa2959fa7fc95945..a09017758fed9a6c43da13824061f9e037eba6e2 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -103,15 +103,6 @@ ivas_error ivas_jbm_dec_tc( } } -#ifndef FIX_1101_CLEANING_JBM_CALL - if ( !st_ivas->hDecoderConfig->Opt_tsm ) - { - for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) - { - st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n]; - } - } -#endif /*----------------------------------------------------------------* * Decoding + pre-rendering *----------------------------------------------------------------*/ @@ -312,7 +303,6 @@ ivas_error ivas_jbm_dec_tc( if ( st_ivas->ivas_format == MASA_FORMAT ) { ivas_masa_prerender( st_ivas, p_output, output_frame, nchan_remapped ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* external output */ if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) { @@ -323,7 +313,6 @@ ivas_error ivas_jbm_dec_tc( ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, output_frame ); } -#endif } else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) { @@ -400,7 +389,6 @@ ivas_error ivas_jbm_dec_tc( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); @@ -415,15 +403,6 @@ ivas_error ivas_jbm_dec_tc( /* Extract objects from MASA, output MASA + all objects (i.e., extracted and separated objects) */ ivas_omasa_render_objects_from_mix( st_ivas, p_output, st_ivas->nchan_ism, output_frame ); } -#else - /* sanity check in case of bitrate switching */ - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); - } - - ivas_omasa_rearrange_channels( p_output, nchan_transport_ism, output_frame ); -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); @@ -692,11 +671,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 ); } @@ -815,7 +790,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( p_data_f[n] = &data_f[n][0]; } -#ifdef FIX_1101_CLEANING_JBM_CALL if ( !st_ivas->hDecoderConfig->Opt_tsm ) { for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ ) @@ -824,7 +798,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } } -#endif if ( st_ivas->hDecoderConfig->Opt_tsm ) { ivas_jbm_dec_copy_tc( st_ivas, nSamplesForRendering, nSamplesResidual, data, p_data_f ); @@ -915,7 +888,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); @@ -927,7 +899,6 @@ void ivas_jbm_dec_feed_tc_to_renderer( } else { -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { n_render_timeslots *= ( st_ivas->hTcBuffer->n_samples_granularity / st_ivas->hSpatParamRendCom->slot_size ); @@ -939,9 +910,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( { ivas_ism_dec_digest_tc( st_ivas ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_DIRAC ) { @@ -1209,13 +1178,11 @@ ivas_error ivas_jbm_dec_render( { ivas_omasa_dirac_rend_jbm( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT || st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { ivas_jbm_dec_tc_buffer_playout( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output ); ivas_omasa_rearrange_channels( p_output, st_ivas->nchan_ism, *nSamplesRendered ); } -#endif } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { @@ -1248,14 +1215,7 @@ ivas_error ivas_jbm_dec_render( ivas_ism_render_sf( st_ivas, st_ivas->renderer_type, p_output, *nSamplesRendered ); /* add already rendered SBA part */ -#ifdef NONBE_1894_OSBA_SCALING ivas_osba_stereo_add_channels( p_tc, p_output, 1.0f, nchan_out, st_ivas->nchan_ism, *nSamplesRendered ); -#else - for ( n = 0; n < nchan_out; n++ ) - { - v_add( p_output[n], p_tc[n + st_ivas->nchan_ism], p_output[n], *nSamplesRendered ); - } -#endif } else if ( st_ivas->renderer_type == RENDERER_OSBA_AMBI || st_ivas->renderer_type == RENDERER_OSBA_LS || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { @@ -1287,12 +1247,10 @@ ivas_error ivas_jbm_dec_render( else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) { ivas_dirac_dec_binaural_render( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, nchan_remapped, p_output ); -#ifdef NONBE_1894_OSBA_SCALING for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered ); } -#endif } else { @@ -1315,12 +1273,10 @@ ivas_error ivas_jbm_dec_render( set_zero( p_output[n], *nSamplesRendered ); } } -#ifdef NONBE_1894_OSBA_SCALING for ( n = 0; n < st_ivas->hDecoderConfig->nchan_out; n++ ) { v_multc( p_output[n], 2.0f, p_output[n], *nSamplesRendered ); } -#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) @@ -1646,7 +1602,6 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( mc_mode_old == MC_MODE_MCT ) { -#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT int16_t crendInPlaceRotation = FALSE; if ( st_ivas->transport_config != intern_config_old && ( intern_config_old == IVAS_AUDIO_CONFIG_FOA || intern_config_old == IVAS_AUDIO_CONFIG_HOA2 || intern_config_old == IVAS_AUDIO_CONFIG_HOA3 ) ) @@ -1657,16 +1612,10 @@ ivas_error ivas_jbm_dec_flush_renderer( ivas_mc2sba( st_ivas->hTransSetup, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, hIntSetupOld->ambisonics_order, GAIN_LFE ); } } -#endif if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV || renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { -#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : st_ivas->hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, - hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1696,11 +1645,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( ism_mode_old == ISM_MASA_MODE_DISC ) { -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *tc_local[MAX_NUM_OBJECTS]; -#else - float *tc_local[MAX_TRANSPORT_CHANNELS]; -#endif for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { @@ -1708,29 +1653,10 @@ ivas_error ivas_jbm_dec_flush_renderer( mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); } -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( st_ivas->nchan_ism > 0 ) - { - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - for ( ch_idx = 0; ch_idx < st_ivas->hDecoderConfig->nchan_out; ch_idx++ ) - { - set_zero( p_output[ch_idx], (int16_t) ( *nSamplesRendered ) ); - } - st_ivas->hTcBuffer->slots_rendered += 1; - st_ivas->hTcBuffer->subframes_rendered += 1; - } -#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) @@ -2341,18 +2267,6 @@ ivas_error ivas_jbm_dec_tc_buffer_open( set_s( hTcBuffer->subframe_nbslots, 0, MAX_JBM_SUBFRAMES_5MS ); set_s( hTcBuffer->subframe_nbslots, nMaxSlotsPerSubframe, MAX_PARAM_SPATIAL_SUBFRAMES ); -#ifndef FIX_1101_CLEANING_JBM_CALL - if ( hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_NONE ) - { - hTcBuffer->tc_buffer = NULL; - - for ( ch_idx = 0; ch_idx < MAX_TRANSPORT_CHANNELS + MAX_NUM_OBJECTS; ch_idx++ ) - { - hTcBuffer->tc[ch_idx] = NULL; - } - } - else -#endif { int16_t n_samp_full, n_samp_residual; int32_t offset; @@ -2705,10 +2619,8 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( case RENDERER_PARAM_ISM: case RENDERER_BINAURAL_MIXER_CONV: case RENDERER_BINAURAL_MIXER_CONV_ROOM: -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT case RENDERER_OMASA_OBJECT_EXT: case RENDERER_OMASA_MIX_EXT: -#endif case RENDERER_OSBA_AMBI: case RENDERER_OSBA_LS: buffer_mode = TC_BUFFER_MODE_RENDERER; @@ -2781,9 +2693,6 @@ void ivas_jbm_dec_copy_tc_no_tsm( const int16_t output_frame /* i : output frame size */ ) { -#ifndef FIX_1101_CLEANING_JBM_CALL - int16_t n_ch_full_copy; -#endif int16_t n_ch_cldfb; int16_t ch_idx; DECODER_TC_BUFFER_HANDLE hTcBuffer; @@ -2791,25 +2700,10 @@ void ivas_jbm_dec_copy_tc_no_tsm( hTcBuffer = st_ivas->hTcBuffer; hTcBuffer->n_samples_buffered = output_frame; hTcBuffer->n_samples_available = hTcBuffer->n_samples_buffered; -#ifndef FIX_1101_CLEANING_JBM_CALL - n_ch_full_copy = min( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); -#endif n_ch_cldfb = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; -#ifdef FIX_1101_CLEANING_JBM_CALL #ifdef DEBUGGING assert( st_ivas->hDecoderConfig->Opt_tsm == 0 ); -#endif -#else - /* copy full tcs*/ - if ( st_ivas->hDecoderConfig->Opt_tsm ) - { - for ( ch_idx = 0; ch_idx < n_ch_full_copy; ch_idx++ ) - { - mvr2r( tc[ch_idx], st_ivas->hTcBuffer->tc[ch_idx], hTcBuffer->n_samples_buffered ); - } - } - ch_idx = 0; #endif /* CLDFB ana for ParamMC/ParamISM */ if ( n_ch_cldfb > 0 ) @@ -2842,11 +2736,7 @@ void ivas_jbm_dec_copy_tc_no_tsm( } #endif /* CLDFB Analysis*/ -#ifdef FIX_1101_CLEANING_JBM_CALL for ( ch_idx = 0, cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ ) -#else - for ( cldfb_ch = 0; cldfb_ch < n_ch_cldfb; cldfb_ch++, ch_idx++ ) -#endif { for ( slot_idx = 0; slot_idx < DEFAULT_JBM_CLDFB_TIMESLOTS; slot_idx++ ) { diff --git a/lib_dec/ivas_lfe_dec.c b/lib_dec/ivas_lfe_dec.c index 11b8247c63995d7a37f8311626cca605361b46c4..d8cf359347373479a23405df30f5a2cc738f5a88 100644 --- a/lib_dec/ivas_lfe_dec.c +++ b/lib_dec/ivas_lfe_dec.c @@ -252,7 +252,6 @@ static int16_t ivas_lfe_dec_dequant( } -#ifdef NONBE_FIX_MC_LFE_LPF /*------------------------------------------------------------------------- * ivas_create_lfe_lpf_dec() * @@ -271,7 +270,6 @@ static void ivas_create_lfe_lpf_dec( return; } -#endif /*-----------------------------------------------------------------------------------------* * Function ivas_lfe_dec() @@ -371,15 +369,9 @@ void ivas_lfe_dec( *-------------------------------------------------------------------------*/ ivas_error ivas_create_lfe_dec( -#ifdef NONBE_FIX_MC_LFE_LPF LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */ const int32_t output_Fs, /* i : output sampling rate */ const int32_t delay_ns /* i : additional LFE delay to sync other channel outputs */ -#else - LFE_DEC_HANDLE *hLFE_out, /* o : IVAS LFE decoder structure */ - const int32_t output_Fs, /* i : output sampling rate */ - const int32_t binauralization_delay_ns /* i : additional LFE delay to sync with binaural renderer */ -#endif ) { float low_pass_delay_dec_out, block_offset_s; @@ -387,11 +379,7 @@ ivas_error ivas_create_lfe_dec( LFE_DEC_HANDLE hLFE; float lfe_addl_delay_s; int16_t i, j; -#ifndef NONBE_1360_LFE_DELAY - int16_t add_delay_sa; -#else float lfe_block_delay_s; -#endif low_pass_delay_dec_out = 0; block_offset_s = 0; @@ -429,57 +417,29 @@ ivas_error ivas_create_lfe_dec( hLFE->cum_freq_models[1][3] = &ivas_str_lfe_freq_models.entropy_coder_model_coarse_sg4; /* delay calculation */ -#ifndef NONBE_1360_LFE_DELAY - hLFE->lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#else lfe_block_delay_s = ( IVAS_LFE_FADE_NS / 1000000000.f ) + ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#endif block_offset_s = BLOCK_OFFSET_MS * 0.001f; filt_order = 0; 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; -#ifdef NONBE_1360_LFE_DELAY low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3]; -#else - low_pass_delay_dec_out = ivas_lfe_lpf_delay[IVAS_FILTER_ORDER_4 - 3] * 1000000000.f; -#endif ivas_create_lfe_lpf_dec( &( hLFE->filter_state ), output_Fs ); } -#endif hLFE->filter_state.order = filt_order; -#ifndef NONBE_1360_LFE_DELAY - hLFE->lfe_block_delay_s = hLFE->lfe_block_delay_s + low_pass_delay_dec_out; -#else lfe_block_delay_s = lfe_block_delay_s + low_pass_delay_dec_out; -#endif hLFE->lfe_prior_buf_len = NS2SA( output_Fs, IVAS_LFE_FADE_NS ); hLFE->bfi_count = 0; -#ifdef NONBE_1360_LFE_DELAY block_offset_s += delay_ns / 1000000000.f; lfe_addl_delay_s = block_offset_s - lfe_block_delay_s; -#else - lfe_addl_delay_s = block_offset_s - hLFE->lfe_block_delay_s; -#endif lfe_addl_delay_s = max( 0.0f, lfe_addl_delay_s ); -#ifndef NONBE_1360_LFE_DELAY -#ifdef NONBE_FIX_MC_LFE_LPF - add_delay_sa = (int16_t) roundf( (float) delay_ns * output_Fs / 1000000000.f ); -#else - add_delay_sa = (int16_t) roundf( (float) binauralization_delay_ns * output_Fs / 1000000000.f ); -#endif - hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs ) + add_delay_sa; - hLFE->lfe_block_delay_s += lfe_addl_delay_s + add_delay_sa / output_Fs; -#else hLFE->lfe_addl_delay = (int16_t) ( lfe_addl_delay_s * output_Fs ); hLFE->delay_ns = delay_ns; -#endif if ( hLFE->lfe_addl_delay > 0 ) { if ( ( hLFE->lfe_delay_buf = (float *) malloc( hLFE->lfe_addl_delay * sizeof( float ) ) ) == NULL ) diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 408318a34c1b50f3eab8c776ffa9ea908b0f4997..e31e689130879323303c917d435c5ae2642a1088 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,17 +293,7 @@ ivas_error ivas_masa_decode( } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT -#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 )--]; @@ -317,29 +305,13 @@ ivas_error ivas_masa_decode( { hMasa->config.input_ivas_format = MASA_ISM_FORMAT; } -#else - /* read the MASA_ISM_FORMAT bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; - if ( byteBuffer == 1 ) - { - hMasa->config.input_ivas_format = MASA_ISM_FORMAT; - } - else - { - hMasa->config.input_ivas_format = MASA_FORMAT; - } - /* reserved bit */ - byteBuffer = st->bit_stream[( st->next_bit_pos )--]; -#endif *nb_bits_read += MASA_HEADER_BITS; /* read number of directions */ 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 { @@ -415,13 +387,11 @@ ivas_error ivas_masa_decode( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, st_ivas->hMasaIsmData->idx_separated_ism, ism_imp, st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx, st_ivas->hSpatParamRendCom->dirac_md_buffer_length ); } -#endif else { *nb_bits_read += ivas_decode_masaism_metadata( hQMetaData, st_ivas->hMasa, st_ivas->hMasaIsmData, st_ivas->nchan_ism, st->bit_stream, &st->next_bit_pos, @@ -466,11 +436,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 ); } @@ -545,12 +511,10 @@ ivas_error ivas_masa_decode( dirac_bs_md_write_idx = st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx; /* Store the write-index for this frame */ ivas_qmetadata_to_dirac( hQMetaData, st_ivas->hDirAC, hMasa, st_ivas->hSpatParamRendCom, ivas_total_brate, ivas_format, 0, 0 ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) { st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx = ( st_ivas->hSpatParamRendCom->dirac_bs_md_write_idx + MAX_PARAM_SPATIAL_SUBFRAMES ) % st_ivas->hSpatParamRendCom->dirac_md_buffer_length; } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { if ( hQMetaData->q_direction == NULL ) @@ -669,14 +633,12 @@ ivas_error ivas_masa_dec_open( } ism_total_brate = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* ISM metadata */ if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hIsmMetaData[0] != NULL && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* these are not needed -> clean. EXT metafile writer in OMASA needs only the number of ISMs and writes default null-data */ ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); } -#endif if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->nSCE > 0 && ( st_ivas->ism_mode == ISM_MASA_MODE_DISC || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) { for ( i = 0; i < st_ivas->nSCE; i++ ) @@ -693,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 ) { @@ -751,13 +709,11 @@ ivas_error ivas_masa_dec_open( nchan_transport = 1; nchan_to_allocate = 1; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif else if ( st_ivas->nchan_transport == 1 && ( st_ivas->renderer_type == RENDERER_DIRAC ) ) { /* addtl channel for CNG */ @@ -909,11 +865,7 @@ static ivas_error ivas_masa_dec_config( for ( i = 0; i < st_ivas->hQMetaData->no_directions; i++ ) { st_ivas->hQMetaData->q_direction[i].cfg.nbands = hMasa->config.numCodingBands; -#ifdef FIX_1161_REDUCE_OMASA_HEAP st_ivas->hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - st_ivas->hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) { @@ -1134,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 ) ) ) @@ -1520,16 +1470,12 @@ ivas_error ivas_masa_dec_reconfigure( if ( st_ivas->ivas_format == MASA_FORMAT ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->nchan_ism = 0; /* Initialization if it has not been already read from the end of the bitstream at the same time with reading of the format: nchan_ism is needed in MASA format because for the EXT output in MASA-only (pre-rendering mode of OMASA) the number of ISMs to output correct number of empty objects is needed */ } -#else - st_ivas->nchan_ism = 0; -#endif st_ivas->ism_mode = ISM_MODE_NONE; } @@ -1548,11 +1494,7 @@ ivas_error ivas_masa_dec_reconfigure( { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } else { @@ -1585,13 +1527,11 @@ ivas_error ivas_masa_dec_reconfigure( /* addtl channel for CNG */ tc_nchan_to_allocate++; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) ) { tc_nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; tc_nchan_to_allocate = st_ivas->nchan_transport + st_ivas->nchan_ism; } -#endif if ( tc_nchan_transport != st_ivas->hTcBuffer->nchan_transport_jbm || tc_nchan_to_allocate != st_ivas->hTcBuffer->nchan_transport_internal || buffer_mode_new != st_ivas->hTcBuffer->tc_buffer_mode ) { @@ -1895,9 +1835,6 @@ static void create_masa_ext_out_meta( IVAS_QMETADATA_HANDLE hQMetaData, const int16_t nchan_transport ) { -#ifndef FIX_1121_MASA_DESCRIPTOR - const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ -#endif int16_t i, sf, b_old, b_new, dir; MASA_DECRIPTIVE_META *descMeta; int16_t *bandMap; @@ -2566,12 +2503,10 @@ static int16_t ivas_decode_masaism_metadata( hMasaIsmData->energy_ratio_ism[dir][meta_write_index][b] = energy_ratio_ism[i][band][dir]; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hMasaIsmData->hExtData != NULL ) { hMasaIsmData->hExtData->masa_render_masa_to_total[meta_write_index][b] = hMasaIsmData->masa_to_total_energy_ratio[i][band]; } -#endif } } } diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 3cd98b9ca2264f33548b7f66a08beae9b79c9d94..68da9856be0f5fefc4aa18e7983bdc86b40216d8 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_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 448ac3673dcc5a222fefb41f5fbcb417e0076000..87b6e2d124b1de939efabcf527536e6eaa65a2bf 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -841,38 +841,30 @@ static void ivas_mc_paramupmix_dec_sf( { for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) { -#ifdef NONBE_1360_LFE_DELAY /*delay is handled within LFE decoder*/ if ( st_ivas->hIntSetup.index_lfe[0] != ch ) { -#endif float tmp_buf[L_SUBFRAME5MS_48k]; mvr2r( &output_f[ch][n_samples_rendered - noparamupmix_delay], tmp_buf, noparamupmix_delay ); mvr2r( output_f[ch], &output_f[ch][noparamupmix_delay], n_samples_rendered - noparamupmix_delay ); mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], noparamupmix_delay ); mvr2r( tmp_buf, hMCParamUpmix->pcm_delay[ch], noparamupmix_delay ); -#ifdef NONBE_1360_LFE_DELAY } -#endif } } else { for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS; ch++ ) { -#ifdef NONBE_1360_LFE_DELAY /*delay is handled within LFE decoder*/ if ( st_ivas->hIntSetup.index_lfe[0] != ch ) { -#endif float tmp_buf[L_SUBFRAME5MS_48k]; mvr2r( &output_f[ch][0], tmp_buf, n_samples_rendered ); mvr2r( hMCParamUpmix->pcm_delay[ch], output_f[ch], n_samples_rendered ); mvr2r( &hMCParamUpmix->pcm_delay[ch][n_samples_rendered], &hMCParamUpmix->pcm_delay[ch][0], noparamupmix_delay - n_samples_rendered ); mvr2r( tmp_buf, &hMCParamUpmix->pcm_delay[ch][noparamupmix_delay - n_samples_rendered], n_samples_rendered ); -#ifdef NONBE_1360_LFE_DELAY } -#endif } } } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 586bd6490b1be064cd75ee42ac4dde349b639a7c..4e8031e140dfad7d7eded1fda4de97ba7a586baf 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -685,7 +685,6 @@ ivas_error ivas_mc_dec_config( { st_ivas->transport_config = signaled_config; } -#ifdef FIX_1052_EXT_OUTPUT else if ( st_ivas->transport_config != signaled_config ) { #ifdef DEBUGGING @@ -693,7 +692,6 @@ ivas_error ivas_mc_dec_config( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); } -#endif /* select MC format mode */ st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), st_ivas->hDecoderConfig->ivas_total_brate ); @@ -701,11 +699,7 @@ ivas_error ivas_mc_dec_config( /* MC format switching */ if ( st_ivas->ini_frame != 0 ) { -#ifdef FIX_1052_EXT_OUTPUT if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || last_mc_mode != st_ivas->mc_mode ) -#else - if ( st_ivas->hDecoderConfig->last_ivas_total_brate != st_ivas->hDecoderConfig->ivas_total_brate || st_ivas->transport_config != signaled_config || last_mc_mode != st_ivas->mc_mode ) -#endif { if ( ( error = ivas_mc_dec_reconfig( st_ivas, nSamplesRendered, pcm_resolution, data ) ) != IVAS_ERR_OK ) @@ -1124,60 +1118,6 @@ static ivas_error ivas_mc_dec_reconfig( return error; } -#ifndef NONBE_1360_LFE_DELAY - /*-----------------------------------------------------------------* - * Allocate the LFE handle that is coded separately after the allocation of the core coders - *-----------------------------------------------------------------*/ - if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hLFE == NULL ) - { -#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 ) ) - { - 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; - } - - set_zero( st_ivas->hLFE->prevsynth_buf, LFE_PLC_BUFLEN ); - set_zero( st_ivas->hLFE->prior_out_buffer, L_FRAME48k ); - } -#endif /*-----------------------------------------------------------------* * Reconfigure renderers @@ -1227,12 +1167,10 @@ static ivas_error ivas_mc_dec_reconfig( if ( st_ivas->hBinRenderer != NULL && ( st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM ) ) { ivas_binRenderer_close( &st_ivas->hBinRenderer ); -#ifdef FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR if ( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) { efap_free_data( &st_ivas->hEFAPdata ); } -#endif } if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hIntSetup.output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) @@ -1331,18 +1269,11 @@ static ivas_error ivas_mc_dec_reconfig( return error; } -#ifdef NONBE_1360_LFE_DELAY /*-----------------------------------------------------------------* * Allocate the LFE handle that is coded separately after the allocation of the core coders *-----------------------------------------------------------------*/ -#ifdef NONBE_1360_LFE_DELAY if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) -#else - if ( ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && st_ivas->hLFE == NULL ) -#endif { -#ifdef NONBE_FIX_MC_LFE_LPF -#ifdef NONBE_1360_LFE_DELAY int32_t delay_ns; if ( st_ivas->hIntSetup.index_lfe[0] != -1 ) { @@ -1352,33 +1283,18 @@ static ivas_error ivas_mc_dec_reconfig( { delay_ns = 0; } -#else - int32_t delay_ns = st_ivas->binaural_latency_ns; -#endif -#else - int32_t binauralization_delay_ns = st_ivas->binaural_latency_ns; -#endif if ( st_ivas->hBinRenderer != NULL ) { if ( st_ivas->hBinRenderer->render_lfe ) { /* Account for filterbank delay */ -#ifdef NONBE_FIX_MC_LFE_LPF delay_ns += IVAS_FB_DEC_DELAY_NS; -#else - binauralization_delay_ns += IVAS_FB_DEC_DELAY_NS; -#endif } else { -#ifdef NONBE_FIX_MC_LFE_LPF delay_ns = 0; -#else - binauralization_delay_ns = 0; -#endif } } -#ifdef NONBE_FIX_MC_LFE_LPF else { if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( st_ivas->cldfbSynDec[0] != NULL ) ) @@ -1386,9 +1302,7 @@ static ivas_error ivas_mc_dec_reconfig( delay_ns += IVAS_FB_DEC_DELAY_NS; } } -#endif -#ifdef NONBE_1360_LFE_DELAY if ( st_ivas->hLFE != NULL ) { if ( st_ivas->hLFE->delay_ns != delay_ns ) @@ -1396,28 +1310,18 @@ static ivas_error ivas_mc_dec_reconfig( ivas_lfe_dec_close( &( st_ivas->hLFE ) ); } } -#endif -#ifdef NONBE_1360_LFE_DELAY if ( st_ivas->hLFE == NULL ) { -#endif -#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; } set_zero( st_ivas->hLFE->prevsynth_buf, LFE_PLC_BUFLEN ); set_zero( st_ivas->hLFE->prior_out_buffer, L_FRAME48k ); -#ifdef NONBE_1360_LFE_DELAY } -#endif } -#endif /*-----------------------------------------------------------------* * JBM TC buffers diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 804b5fef6515b4f3343f260b49bf9d10b3f8904b..4ce42e01d5e3af55860f491289cde61a21fc0290 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 } @@ -97,11 +92,7 @@ ivas_error ivas_td_binaural_renderer_sf( int16_t nchan_ism_internal, nchan_ism, ch_offset; /* Set the number of ISMs */ -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { nchan_ism_internal = st_ivas->nchan_ism; nchan_ism = st_ivas->nchan_ism; @@ -209,11 +200,7 @@ ivas_error ivas_td_binaural_renderer_sf( /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -286,9 +273,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_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 6a98f9b1bc8cd4c28ae92cc9192b5e6b3187dff0..24d5b05bc75f9758099f0bdd6044ab1ffbff10ae 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -32,9 +32,7 @@ #include "options.h" #include -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #include -#endif #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" @@ -50,9 +48,7 @@ * Local constants *------------------------------------------------------------------------*/ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT #define EXT_RENDER_IIR_FAC 0.95f -#endif /*-------------------------------------------------------------------* * ivas_omasa_data_open() @@ -107,7 +103,6 @@ ivas_error ivas_omasa_data_open( } set_s( hMasaIsmData->azimuth_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); set_s( hMasaIsmData->elevation_separated_ism, 0, MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT hMasaIsmData->hExtData = NULL; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { @@ -140,7 +135,6 @@ ivas_error ivas_omasa_data_open( hMasaIsmData->hExtData = hExtData; } -#endif st_ivas->hMasaIsmData = hMasaIsmData; return IVAS_ERR_OK; @@ -173,13 +167,11 @@ void ivas_omasa_data_close( free( ( *hMasaIsmData )->delayBuffer ); ( *hMasaIsmData )->delayBuffer = NULL; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ( *hMasaIsmData )->hExtData != NULL ) { free( ( *hMasaIsmData )->hExtData ); ( *hMasaIsmData )->hExtData = NULL; } -#endif free( *hMasaIsmData ); *hMasaIsmData = NULL; @@ -293,7 +285,6 @@ ivas_error ivas_omasa_dec_config( { /* ISM MD reconfig. */ n_MD = 0; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* the full number of hIsmMetaData are needed for EXT output */ @@ -342,33 +333,6 @@ ivas_error ivas_omasa_dec_config( ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); } -#else - if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) - { - n_MD = 1; - - if ( st_ivas->hIsmMetaData[0] == NULL ) - { - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, 1, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - } - else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) - { - n_MD = st_ivas->nchan_ism; - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); - - if ( ( error = ivas_ism_metadata_dec_create( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) - { - return error; - } - } - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); -#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; @@ -398,14 +362,9 @@ ivas_error ivas_omasa_dec_config( } /* objects renderer reconfig. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hMasaIsmData != NULL || st_ivas->hIsmRendererData != NULL ) { /* this calls also ivas_ism_renderer_close() closing st_ivas->hIsmRendererData used by the EXT renderers. also cleans st_ivas->hMasaIsmData */ -#else - if ( st_ivas->hMasaIsmData != NULL ) - { -#endif ivas_omasa_separate_object_renderer_close( st_ivas ); } @@ -429,19 +388,11 @@ ivas_error ivas_omasa_dec_config( } } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /* Allocate memory for delay buffer within 'hMasaIsmData' */ if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#else - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif } else { @@ -465,12 +416,10 @@ ivas_error ivas_omasa_dec_config( if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) { return error; } -#endif if ( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ) != IVAS_ERR_OK ) { @@ -483,7 +432,6 @@ ivas_error ivas_omasa_dec_config( ivas_omasa_separate_object_renderer_close( st_ivas ); } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->renderer_type == RENDERER_OMASA_MIX_EXT ) { /* Allocate 'hIsmRendererData' handle */ @@ -498,11 +446,7 @@ ivas_error ivas_omasa_dec_config( DIRAC_CONFIG_FLAG common_rend_config_flag = st_ivas->hSpatParamRendCom == NULL ? DIRAC_OPEN : DIRAC_RECONFIGURE; /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( error = ivas_omasa_objects_delay_open( st_ivas ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_omasa_render_objects_from_mix_open( st_ivas ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -513,7 +457,6 @@ ivas_error ivas_omasa_dec_config( return error; } } -#endif /*-----------------------------------------------------------------* * TD Decorrelator *-----------------------------------------------------------------*/ @@ -707,7 +650,6 @@ ivas_error ivas_omasa_ism_metadata_dec( } } } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT else if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { azimuth_ism = (int16_t) ( st_ivas->hIsmMetaData[0]->azimuth + 0.5f ); @@ -724,7 +666,6 @@ ivas_error ivas_omasa_ism_metadata_dec( st_ivas->hMasaIsmData->elevation_separated_ism[block] = elevation_ism; } } -#endif } return IVAS_ERR_OK; @@ -797,26 +738,14 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ) { int16_t n; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float data_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; -#else - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#endif ivas_error error; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *p_sepobj[BINAURAL_CHANNELS]; -#else - float *p_sepobj[MAX_NUM_OBJECTS]; -#endif int16_t slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH for ( n = 0; n < BINAURAL_CHANNELS; n++ ) -#else - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) -#endif { p_sepobj[n] = &data_separated_objects[n][0]; } @@ -905,7 +834,6 @@ void ivas_omasa_rearrange_channels( return; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /*-------------------------------------------------------------------------* * ivas_omasa_combine_separate_ism_with_masa_open() @@ -1092,7 +1020,6 @@ void ivas_omasa_combine_separate_ism_with_masa( } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /*-------------------------------------------------------------------------* * ivas_omasa_objects_delay_open() * @@ -1100,21 +1027,11 @@ void ivas_omasa_combine_separate_ism_with_masa( *-------------------------------------------------------------------------*/ ivas_error ivas_omasa_objects_delay_open( -#else -/*-------------------------------------------------------------------------* - * ivas_omasa_render_objects_from_mix_open() - * - * Open structures, reserve memory, and init values. - *-------------------------------------------------------------------------*/ - -ivas_error ivas_omasa_render_objects_from_mix_open( -#endif Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ) { int16_t i; -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { st_ivas->hMasaIsmData->delayBuffer_nchan = 1; @@ -1123,9 +1040,6 @@ ivas_error ivas_omasa_render_objects_from_mix_open( { st_ivas->hMasaIsmData->delayBuffer_nchan = st_ivas->nchan_ism; } -#else - st_ivas->hMasaIsmData->delayBuffer_nchan = 1; -#endif st_ivas->hMasaIsmData->delayBuffer_size = (int16_t) ( ( st_ivas->hDecoderConfig->output_Fs / 50 ) / MAX_PARAM_SPATIAL_SUBFRAMES ); @@ -1396,4 +1310,3 @@ void ivas_omasa_render_objects_from_mix( return; } -#endif diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index c9e9e2e93773ab6e8145ff484bafa47c9f1b9dbc..1c73dcfea1e9e82ecd464ed93b3c98cff762ca5a 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -153,9 +153,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( return error; } -#ifdef NONBE_FIX_ISM_XOVER_BR ivas_combined_orientation_set_to_start_index( st_ivas->hCombinedOrientationData ); -#endif if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) @@ -184,20 +182,10 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( for ( b = 0; b < num_cldfb_bands; b++ ) { st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] = -#ifndef NONBE_1894_OSBA_SCALING - ( 0.5f * st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) + - ( 0.5f * Cldfb_RealBuffer[b] ); -#else st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[n][slot_idx_start + slot_idx][b] + Cldfb_RealBuffer[b]; -#endif st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] = -#ifndef NONBE_1894_OSBA_SCALING - ( 0.5f * st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] ) + - ( 0.5f * Cldfb_ImagBuffer[b] ); -#else st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[n][slot_idx_start + slot_idx][b] + Cldfb_ImagBuffer[b]; -#endif } } } @@ -214,11 +202,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm( int16_t i; for ( i = 0; i < nSamplesAsked; i++ ) { -#ifndef NONBE_1894_OSBA_SCALING - output_f[n][i] = 0.5f * output_f[channel_offset + n][i] + 0.5f * p_sepobj[n][i]; -#else output_f[n][i] = output_f[channel_offset + n][i] + p_sepobj[n][i]; -#endif } } } @@ -308,15 +292,11 @@ ivas_error ivas_osba_render_sf( { v_add( p_output[n], p_output_ism[n], p_output[n], *nSamplesRendered ); } -#ifndef NONBE_1894_OSBA_SCALING - v_multc( p_output[n], 0.5f, p_output[n], *nSamplesRendered ); -#endif } return IVAS_ERR_OK; } -#ifdef NONBE_1894_OSBA_SCALING /*-------------------------------------------------------------------------* * ivas_osba_stereo_add_channels() * @@ -362,4 +342,3 @@ void ivas_osba_stereo_add_channels( return; } -#endif diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index ce0172a869f7466f250b2ea302c3a5e4c3cbb1b7..f897ad87b7a6dc00af7ce8d957f49278053b6c0f 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -309,9 +309,7 @@ ivas_error ivas_ls_setup_conversion_open( int16_t output_frame; int32_t output_Fs; int16_t paramUpmixMonoStereo; -#ifdef FIX_1052_EXT_OUTPUT ivas_error error; -#endif if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { @@ -421,37 +419,25 @@ ivas_error ivas_ls_setup_conversion_open( { if ( paramUpmixMonoStereo == TRUE ) { -#ifdef FIX_1052_EXT_OUTPUT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); -#endif } else { -#ifdef FIX_1052_EXT_OUTPUT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->transport_config, st_ivas->hDecoderConfig->output_config ); -#endif } } else { -#ifdef FIX_1052_EXT_OUTPUT if ( ( error = get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ) ) != IVAS_ERR_OK ) { return error; } -#else - get_ls_conversion_matrix( hLsSetUpConversion, st_ivas->intern_config, st_ivas->hDecoderConfig->output_config ); -#endif } } diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 801cc58e64bb090841df95a403585cedcba9094c..d9d661c4e2f635b8114655f26213ed4bc7f2a0af 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -141,11 +141,7 @@ void ivas_renderer_select( { *internal_config = IVAS_AUDIO_CONFIG_HOA3; -#ifdef FIX_1158_FASTCONV_REVERB_HRTF if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#else - if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) -#endif { *renderer_type = RENDERER_BINAURAL_FASTCONV; } @@ -266,11 +262,7 @@ void ivas_renderer_select( } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { -#ifdef FIX_1052_EXT_OUTPUT if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO ) -#endif { *renderer_type = RENDERER_MC; } @@ -326,37 +318,18 @@ void ivas_renderer_select( if ( ivas_format == SBA_FORMAT && ( output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO ) ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* 'internal_config' was already set in ivas_set_audio_config_from_sba_order() */ } else if ( output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_FOA ) -#else - if ( output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_FOA ) -#endif { *internal_config = output_config; } -#ifdef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX else { *internal_config = IVAS_AUDIO_CONFIG_HOA3; } -#else - else if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) - { - *internal_config = IVAS_AUDIO_CONFIG_FOA; - } -#ifdef NONBE_FIX_1128_OSBA_EXT_OUTPUT_ORDER - else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#endif - { - *internal_config = IVAS_AUDIO_CONFIG_HOA3; - } -#endif *renderer_type = RENDERER_SBA_LINEAR_DEC; } else if ( ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || @@ -376,12 +349,6 @@ void ivas_renderer_select( { *renderer_type = RENDERER_DISABLE; } -#ifndef FIX_1249_REMOVE_OBSOLETE_ALLRAD_MATRIX - else if ( ivas_format == SBA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO ) - { - *renderer_type = RENDERER_SBA_LINEAR_DEC; - } -#endif else if ( ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_OSBA_STEREO; @@ -417,7 +384,6 @@ void ivas_renderer_select( } else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { @@ -431,19 +397,12 @@ void ivas_renderer_select( { *renderer_type = RENDERER_DISABLE; } -#else // NONBE_FIX_984_OMASA_EXT_OUTPUT - *renderer_type = RENDERER_DISABLE; -#endif } } else if ( st_ivas->ivas_format == MC_FORMAT ) { *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 ) { @@ -457,11 +416,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 ) { @@ -486,14 +441,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 5880c8c357c50360b5c54696748c644ee6409efc..6b4dae19d940967c4d0c50aebd691aa66f7eccf0 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 a909faf4037b2d7db57da24c73f9c9c1145f03bf..deaf021649b74b234935ecffb318f87bbf98f7cb 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 c77e3db4fc06b4b1390fc0ed6bdccafe56957f3d..063921501a2441bd67060b04b109bc2bf61f773d 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -96,13 +96,6 @@ extern const uint16_t *const sym_freq_ECSQ_tab_abs_lsbs[1 + 4]; extern const float dirac_dithering_azi_scale[DIRAC_DIFFUSE_LEVELS]; extern const float dirac_dithering_ele_scale[DIRAC_DIFFUSE_LEVELS]; -#ifndef FIX_1053_REVERB_RECONFIGURATION -/*----------------------------------------------------------------------------------* - * FASTCONV and PARAMETRIC binaural renderer ROM tables - *----------------------------------------------------------------------------------*/ - -extern const float dmxmtx_table[BINAURAL_CHANNELS][11]; -#endif /*----------------------------------------------------------------------* * MC ParamUpmix ROM tables diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 7d01fabe9fdc885c69762d4cf2719054276b26e1..791e0ce6ecff84efce3aa954127f3f089bab84b7 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -70,11 +70,7 @@ void ivas_sba_set_cna_cng_flag( st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag = 1; st_ivas->hSCE[0]->hCoreCoder[0]->cng_sba_flag = 1; } -#ifdef NONBE_FIX_ISM_XOVER_BR else if ( st_ivas->nchan_transport == 2 && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#else - else if ( st_ivas->nchan_transport == 2 ) -#endif { for ( n = 0; n < CPE_CHANNELS; n++ ) { @@ -124,9 +120,7 @@ ivas_error ivas_sba_dec_reconfigure( ivas_error error; ISM_MODE ism_mode_old; int16_t granularity_new; -#ifdef NONBE_FIX_ISM_XOVER_BR int16_t nchan_transport; -#endif ism_mode_old = st_ivas->ism_mode; hDecoderConfig = st_ivas->hDecoderConfig; @@ -146,11 +140,7 @@ ivas_error ivas_sba_dec_reconfigure( if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { -#ifdef NONBE_FIX_ISM_XOVER_BR if ( ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ) == ISM_SBA_MODE_DISC ) -#else - if ( ivas_total_brate >= IVAS_256k ) -#endif { st_ivas->ism_mode = ISM_SBA_MODE_DISC; } @@ -444,9 +434,7 @@ ivas_error ivas_sba_dec_reconfigure( * Allocate, initialize, and configure SCE/CPE/MCT handles *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { if ( ism_mode_old == ISM_MODE_NONE && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) @@ -515,12 +503,8 @@ ivas_error ivas_sba_dec_reconfigure( return error; } -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport += st_ivas->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; -#else - st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; -#endif } else if ( ism_mode_old == ISM_SBA_MODE_DISC && st_ivas->ism_mode == ISM_MODE_NONE ) { @@ -534,24 +518,15 @@ ivas_error ivas_sba_dec_reconfigure( { ivas_td_binaural_close( &st_ivas->hBinRendererTd ); } -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif nchan_transport_old += st_ivas->nchan_ism; st_ivas->ism_mode = ISM_MODE_NONE; } else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport + st_ivas->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; nchan_transport_old += st_ivas->nchan_ism; -#else - st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; - nCPE_old = st_ivas->nCPE; - nchan_transport_old = st_ivas->nchan_transport; - nchan_transport_old += st_ivas->nchan_ism; -#endif } } @@ -698,11 +673,7 @@ void ivas_sba_dec_digest_tc( int16_t ch_idx, nchan_transport; /* set the md map */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( st_ivas->hDirAC || st_ivas->renderer_type == RENDERER_OMASA_OBJECT_EXT ) -#else - if ( st_ivas->hDirAC ) -#endif { ivas_dirac_dec_set_md_map( st_ivas, nCldfbSlots ); } diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index ae43ad1e5e7de69c95f136a199f57a16910789af..514965c6fe6dd1e143a2d0efa2b2b9ff2e69a347 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; @@ -1569,11 +1557,7 @@ void ivas_spar_dec_upmixer_sf( } } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->ivas_total_brate < IVAS_24k4 && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) -#else - if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#endif { ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); } @@ -1583,11 +1567,7 @@ void ivas_spar_dec_upmixer_sf( md_idx = hSpar->render_to_md_map[ts + slot_idx_start]; ivas_spar_get_parameters( hSpar, hDecoderConfig, md_idx, numch_out, numch_in, num_spar_bands, mixer_mat ); -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->ivas_total_brate < IVAS_24k4 && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) -#else - if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#endif { for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) { @@ -1676,11 +1656,7 @@ void ivas_spar_dec_upmixer_sf( } } -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && !( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA ) ) -#else - if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) -#endif { ivas_dirac_dec_render_sf( st_ivas, output, nchan_internal, cldfb_in_ts_re, cldfb_in_ts_im ); } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index 638efa9fcf9cf8944357601b9ede22496565d763..fea1fcf76b6eb3d8df4f0d41eb10d4993c264839 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_stat_dec.h b/lib_dec/ivas_stat_dec.h index fdc604b3dec18c1c8ef8bb0b5e9b3cbd2d33d8d6..8d3e8aee92603239735a4f206ec9ed1141d591c3 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -786,11 +786,7 @@ typedef struct ivas_lfe_dec_data_structure LFE_WINDOW_HANDLE pWindow_state; const uint16_t *cum_freq_models[IVAS_MAX_NUM_QUANT_STRATS][IVAS_MAX_NUM_DCT_COEF_GROUPS]; int16_t lfe_dec_indices_coeffs_tbl[IVAS_MAX_NUM_QUANT_STRATS][IVAS_MAX_NUM_DCT_COEF_GROUPS]; -#ifdef NONBE_1360_LFE_DELAY int32_t delay_ns; -#else - float lfe_block_delay_s; -#endif int16_t lfe_prior_buf_len; float prior_out_buffer[L_FRAME48k]; @@ -811,9 +807,7 @@ typedef struct renderer_struct float prev_gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; float *interpolator; int16_t interpolator_length; -#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING int16_t interp_offset; -#endif float gains[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; @@ -883,7 +877,6 @@ typedef struct ivas_masa_decoder_struct } MASA_DECODER, *MASA_DECODER_HANDLE; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* Data structure for MASA_ISM EXT rendering */ typedef struct ivas_masa_ism_ext_data_structure { @@ -896,7 +889,6 @@ typedef struct ivas_masa_ism_ext_data_structure float masa_render_masa_to_total[MAX_PARAM_SPATIAL_SUBFRAMES + DELAY_MASA_PARAM_DEC_SFR][CLDFB_NO_CHANNELS_MAX]; } MASA_ISM_EXT_DATA, *MASA_ISM_EXT_DATA_HANDLE; -#endif /* Data structure for MASA_ISM rendering */ typedef struct ivas_masa_ism_data_structure @@ -928,9 +920,7 @@ typedef struct ivas_masa_ism_data_structure int16_t delayBuffer_size; int16_t delayBuffer_nchan; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT MASA_ISM_EXT_DATA_HANDLE hExtData; -#endif } MASA_ISM_DATA, *MASA_ISM_DATA_HANDLE; diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 3d44edac647c52c0151ba89d224d8e0e86e18e0c..2ff0c4ac3aae4e320834503329b75e416d9f80e4 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -923,9 +923,7 @@ void stereo_cna_update_params( } else { -#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING hFdCngDec->first_cna_noise_updated = 0; -#endif return; } diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 6eeab0e242270e055d1f3936640403e7cc9bdf3d..a0565824af3b9e04a3837f163d527a58015f685f 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -1141,11 +1141,7 @@ void synchro_synthesis( /* handling of TD->DFT switching */ for ( n = 0; n < hCPE->nchan_out; n++ ) { -#ifdef NONBE_1289_STEREO_SW_TO_MONO if ( ( !use_cldfb_for_last_dft && hCPE->last_element_mode != IVAS_CPE_DFT && !sba_dirac_stereo_flag && dft_mono_brate_switch != -1 ) || dft_mono_brate_switch == 1 ) -#else - if ( ( hCPE->last_element_mode != IVAS_CPE_DFT && !sba_dirac_stereo_flag && dft_mono_brate_switch != -1 ) || dft_mono_brate_switch == 1 ) -#endif { float *pPrev_synth; float inv_fade_len = 1.f / delay_diff; @@ -1556,9 +1552,7 @@ void stereo_switching_dec( mvr2r( sts[0]->lsf_old, sts[1]->lsf_old, M ); mvr2r( sts[0]->lsp_old, sts[1]->lsp_old, M ); -#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING sts[1]->last_core_brate = sts[0]->last_core_brate; -#endif if ( hCPE->element_mode == IVAS_CPE_MDCT ) { diff --git a/lib_dec/ivas_svd_dec.c b/lib_dec/ivas_svd_dec.c index 0f9c7523b6c68af53dac88b8b9217ac1b3f76efc..5d15910c1db2a0ae1f361d911e37d9a0d4496f82 100644 --- a/lib_dec/ivas_svd_dec.c +++ b/lib_dec/ivas_svd_dec.c @@ -57,13 +57,8 @@ *-----------------------------------------------------------------------*/ static float GivensRotation( const float x, const float z ); -#ifdef NONBE_SVD_OPTIMIZATION static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g ); static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *g ); -#else -static void biDiagonalReductionLeft( float singularVectors[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); -static void biDiagonalReductionRight( float singularVectors[][MAX_OUTPUT_CHANNELS], float secDiag[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC, const int16_t currChannel, float *sig_x, float *g ); -#endif static void singularVectorsAccumulationLeft( float singularVectors_Left[][MAX_OUTPUT_CHANNELS], float singularValues[MAX_OUTPUT_CHANNELS], const int16_t nChannelsL, const int16_t nChannelsC ); @@ -491,26 +486,16 @@ static void HouseholderReduction( float *eps_x ) { int16_t nCh; -#ifdef NONBE_SVD_OPTIMIZATION float g_left = 0.0f; float g_right = 0.0f; -#else - float sig_x = 0.0f; - float g = 0.0f; -#endif /* Bidiagonal Reduction for every channel */ for ( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */ { -#ifdef NONBE_SVD_OPTIMIZATION secDiag[nCh] = g_right; /* from the previous channel */ biDiagonalReductionLeft( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_left ); singularValues[nCh] = g_left; biDiagonalReductionRight( singularVectors_Left, nChannelsL, nChannelsC, nCh, &g_right ); -#else - biDiagonalReductionLeft( singularVectors_Left, singularValues, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); - biDiagonalReductionRight( singularVectors_Left, secDiag, nChannelsL, nChannelsC, nCh, &sig_x, &g ); -#endif *eps_x = max( *eps_x, ( fabsf( singularValues[nCh] ) + fabsf( secDiag[nCh] ) ) ); } @@ -523,7 +508,6 @@ static void HouseholderReduction( } -#ifdef NONBE_SVD_OPTIMIZATION /*------------------------------------------------------------------------- * biDiagonalReductionLeft() * @@ -633,160 +617,13 @@ static void biDiagonalReductionRight( return; } -#else - -/*------------------------------------------------------------------------- - * biDiagonalReductionLeft() - * - * - *-------------------------------------------------------------------------*/ -static void biDiagonalReductionLeft( - float singularVectors[][MAX_OUTPUT_CHANNELS], - float singularValues[MAX_OUTPUT_CHANNELS], - float secDiag[MAX_OUTPUT_CHANNELS], - const int16_t nChannelsL, - const int16_t nChannelsC, - const int16_t currChannel, - float *sig_x, - float *g ) -{ - int16_t iCh, jCh, idx; - float norm_x, f, r; - - secDiag[currChannel] = ( *sig_x ) * ( *g ); - - /* Setting values to 0 */ - ( *sig_x ) = 0.0f; - ( *g ) = 0.0f; - - if ( currChannel < nChannelsL ) /* i <= m */ - { - idx = currChannel; - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - ( *sig_x ) += fabsf( singularVectors[jCh][currChannel] ); - } - - if ( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ - { - norm_x = 0.0f; - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][currChannel] = ( singularVectors[jCh][currChannel] / maxWithSign( ( *sig_x ) ) ); - norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][currChannel] ); - } - ( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x ); - r = ( *g ) * singularVectors[currChannel][idx] - norm_x; - singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) ); - - for ( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ - { - norm_x = 0.0f; - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - norm_x += ( singularVectors[jCh][currChannel] * singularVectors[jCh][iCh] ); - } - - f = norm_x / maxWithSign( r ); - - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][iCh] += ( f * singularVectors[jCh][currChannel] ); - } - } - - - for ( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ - { - singularVectors[jCh][currChannel] = ( singularVectors[jCh][currChannel] * ( *sig_x ) ); - } - } - - singularValues[currChannel] = ( ( *sig_x ) * ( *g ) ); - } - - return; -} -#endif /*------------------------------------------------------------------------- * biDiagonalReductionRight() * * *-------------------------------------------------------------------------*/ -#ifdef NONBE_SVD_OPTIMIZATION - -#else -static void biDiagonalReductionRight( - float singularVectors[][MAX_OUTPUT_CHANNELS], - float secDiag[MAX_OUTPUT_CHANNELS], - const int16_t nChannelsL, - const int16_t nChannelsC, - const int16_t currChannel, - float *sig_x, - float *g ) -{ - int16_t iCh, jCh, idx; - float norm_x, r; - - /* Setting values to 0 */ - ( *sig_x ) = 0.0f; - ( *g ) = 0.0f; - if ( currChannel < nChannelsL && currChannel != ( nChannelsC - 1 ) ) /* i <=m && i !=n */ - { - idx = currChannel + 1; - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - ( *sig_x ) += fabsf( singularVectors[currChannel][jCh] ); - } - - if ( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ - { - norm_x = 0.0f; - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */ - { - singularVectors[currChannel][jCh] = ( singularVectors[currChannel][jCh] / maxWithSign( ( *sig_x ) ) ); - norm_x += ( singularVectors[currChannel][jCh] * singularVectors[currChannel][jCh] ); - } - ( *g ) = -( singularVectors[currChannel][idx] >= 0 ? 1 : ( -1 ) ) * sqrtf( norm_x ); - r = ( *g ) * singularVectors[currChannel][idx] - norm_x; - singularVectors[currChannel][idx] = ( singularVectors[currChannel][idx] - ( *g ) ); - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - secDiag[jCh] = singularVectors[currChannel][jCh] / maxWithSign( r ); - } - for ( iCh = currChannel + 1; iCh < nChannelsL; iCh++ ) /* nChannelsL */ - { - norm_x = 0.0f; - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - norm_x += ( singularVectors[iCh][jCh] * singularVectors[currChannel][jCh] ); - } - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - singularVectors[iCh][jCh] += ( norm_x * secDiag[jCh] ); - } - } - - for ( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ - { - singularVectors[currChannel][jCh] = ( singularVectors[currChannel][jCh] * ( *sig_x ) ); - } - } - } - - return; -} - -#endif /*------------------------------------------------------------------------- * singularVectorsAccumulationLeft() * diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index d7130a7eac0d1f257eb53743e6188d0babc72d64..c1e728e103f3ad24c9aaca783238674981aa87c2 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -811,15 +811,11 @@ static void JB4_adaptActivePlayout( ( dropRateMax - dropRateMin ) / dropGapMax + dropRateMin; *scale = ( 1000 - rate ) / 10; -#ifdef NONBE_1215_FIX_JBM_MAX_SCALING /* Limit max scaling to the duration of one frame. APA will not exceed this limit * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting * the value to a sensible range here avoids integer overflows at later stages when * converting maxScaling from milliseconds to samples. */ *maxScaling = JB4_MIN( currPlayoutDelay - targetMax, 1000 / IVAS_NUM_FRAMES_PER_SEC ); -#else - *maxScaling = currPlayoutDelay - targetMax; -#endif } } } @@ -835,15 +831,11 @@ static void JB4_adaptActivePlayout( currPlayoutDelay < targetMaxStretch && currPlayoutDelay < (uint32_t) ( 110 + h->rfDelay / 4 ) ) { *scale = 120; -#ifdef NONBE_1215_FIX_JBM_MAX_SCALING /* Limit max scaling to the duration of one frame. APA will not exceed this limit * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting * the value to a sensible range here avoids integer overflows at later stages when * converting maxScaling from milliseconds to samples. */ *maxScaling = JB4_MIN( targetMaxStretch - currPlayoutDelay, 1000 / IVAS_NUM_FRAMES_PER_SEC ); -#else - *maxScaling = targetMaxStretch - currPlayoutDelay; -#endif } } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 868fc4e06df67fa59773683beb0336e6b29a4610..df0aed1eb3a7baea4aed23a08d605c2bf29fa21c 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -400,7 +400,6 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_Configure( -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ @@ -417,24 +416,6 @@ ivas_error IVAS_DEC_Configure( const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ const bool delayCompensationEnabled /* i : enable delay compensation */ -#else - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const uint32_t sampleRate, /* i : output sampling frequency */ - const IVAS_AUDIO_CONFIG outputConfig, /* i : audio configuration */ - const int16_t tsmEnabled, /* i : enable TSM */ - const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ - const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ - const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ - const int16_t enableExternalOrientation, /* i : enable external orientations */ - const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ - const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ - const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ - const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ - const int16_t Opt_dpid_on, /* i : enable directivity pattern option */ - const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ - const int16_t delayCompensationEnabled /* i : enable delay compensation */ -#endif ) { Decoder_Struct *st_ivas; @@ -451,13 +432,8 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == IVAS_AUDIO_CONFIG_MONO && !non_diegetic_pan_enabled ) || ( outputConfig == IVAS_AUDIO_CONFIG_STEREO && non_diegetic_pan_enabled ) ) ) -#else - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == IVAS_AUDIO_CONFIG_MONO && Opt_non_diegetic_pan == 0 ) || - ( outputConfig == IVAS_AUDIO_CONFIG_STEREO && Opt_non_diegetic_pan == 1 ) ) ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -485,37 +461,17 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); } -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_tsm = (int16_t) tsmEnabled; hDecoderConfig->Opt_LsCustom = (int16_t) customLsOutputEnabled; hDecoderConfig->Opt_Headrotation = (int16_t) enableHeadRotation; -#else - hDecoderConfig->Opt_tsm = tsmEnabled; - hDecoderConfig->Opt_LsCustom = customLsOutputEnabled; - hDecoderConfig->Opt_Headrotation = enableHeadRotation; -#endif hDecoderConfig->orientation_tracking = orientation_tracking; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_HRTF_binary = (int16_t) hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = (int16_t) renderConfigEnabled; hDecoderConfig->Opt_non_diegetic_pan = (int16_t) non_diegetic_pan_enabled; -#else - hDecoderConfig->Opt_HRTF_binary = hrtfReaderEnabled; - hDecoderConfig->Opt_RendConfigCustom = renderConfigEnabled; - hDecoderConfig->Opt_non_diegetic_pan = Opt_non_diegetic_pan; -#endif hDecoderConfig->non_diegetic_pan_gain = non_diegetic_pan_gain; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_delay_comp = (int16_t) delayCompensationEnabled; -#else - hDecoderConfig->Opt_delay_comp = delayCompensationEnabled; -#endif hDecoderConfig->Opt_ExternalOrientation = enableExternalOrientation; -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION hDecoderConfig->Opt_dpid_on = (int16_t) dpidEnabled; -#else - hDecoderConfig->Opt_dpid_on = Opt_dpid_on; -#endif hDecoderConfig->Opt_aeid_on = acousticEnvironmentId != 65535 ? TRUE : FALSE; if ( renderFramesize == IVAS_RENDER_FRAMESIZE_UNKNOWN ) @@ -531,12 +487,6 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->render_framesize = renderFramesize; } -#ifndef FIX_1135_EXT_RENDERER_HANDLES - if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - hDecoderConfig->Opt_Headrotation = TRUE; - } -#endif /* Set decoder parameters to initial values */ if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK ) { @@ -1130,12 +1080,10 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( int16_t ro_md_flag; IVAS_QUATERNION Quaternion; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif error = IVAS_ERR_OK; st_ivas = hIvasDec->st_ivas; @@ -1529,15 +1477,12 @@ ivas_error IVAS_DEC_GetNumObjects( uint16_t *numObjects /* o : number of objects for which the decoder has been configured */ ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { if ( hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -1546,9 +1491,6 @@ ivas_error IVAS_DEC_GetNumObjects( } } if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || is_masa_ism ) -#else - if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { *numObjects = hIvasDec->st_ivas->nchan_ism; } @@ -1573,13 +1515,11 @@ ivas_error IVAS_DEC_GetFormat( IVAS_DEC_BS_FORMAT *format /* o : format detected from bitstream fed to the decoder */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->hasDecodedFirstGoodFrame ) { *format = mapIvasFormat( hIvasDec->st_ivas->ivas_format ); @@ -1589,12 +1529,10 @@ ivas_error IVAS_DEC_GetFormat( *format = IVAS_DEC_BS_UNKOWN; } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( *format == IVAS_DEC_BS_MASA && hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) { *format = IVAS_DEC_BS_MASA_ISM; } -#endif return IVAS_ERR_OK; } @@ -1675,13 +1613,11 @@ ivas_error IVAS_DEC_GetNumOutputChannels( int16_t *numOutputChannels /* o : number of PCM output channels */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->hasDecodedFirstGoodFrame ) { *numOutputChannels = hIvasDec->st_ivas->hDecoderConfig->nchan_out; @@ -1710,17 +1646,14 @@ ivas_error IVAS_DEC_GetObjectMetadata( { Decoder_Struct *st_ivas; ISM_METADATA_HANDLE hIsmMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t is_masa_ism; is_masa_ism = 0; -#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } st_ivas = hIvasDec->st_ivas; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIvasDec->st_ivas->hMasa != NULL ) { if ( hIvasDec->st_ivas->hMasa->config.input_ivas_format == MASA_ISM_FORMAT ) @@ -1729,9 +1662,6 @@ ivas_error IVAS_DEC_GetObjectMetadata( } } if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT && is_masa_ism == 0 ) -#else - if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->ivas_format != MASA_ISM_FORMAT && st_ivas->ivas_format != SBA_ISM_FORMAT ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -1742,11 +1672,7 @@ ivas_error IVAS_DEC_GetObjectMetadata( } hIsmMeta = st_ivas->hIsmMetaData[objectIdx]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( hIsmMeta == NULL || zero_flag || ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ ) ) -#else - if ( hIsmMeta == NULL || zero_flag ) -#endif { metadata->azimuth = 0.f; metadata->elevation = 0.f; @@ -2153,9 +2079,6 @@ static ivas_error copyRendererConfigStruct( hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; break; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; #endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; @@ -2241,9 +2164,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( { hRenderConfig->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_CREND; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; #endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; @@ -2264,7 +2184,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( mvr2r( renderConfig.roomAcoustics.pAcoustic_rt60, hRenderConfig->roomAcoustics.pAcoustic_rt60, CLDFB_NO_CHANNELS_MAX ); mvr2r( renderConfig.roomAcoustics.pAcoustic_dsr, hRenderConfig->roomAcoustics.pAcoustic_dsr, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_1053_REVERB_RECONFIGURATION /* Re-initialize reverb instance if already available */ /* TD renderer Jot reverberator */ @@ -2296,12 +2215,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, - NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - NULL -#endif - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -2318,22 +2233,15 @@ ivas_error IVAS_DEC_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, - NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - NULL -#endif - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } } -#endif mvr2r( renderConfig.directivity, hRenderConfig->directivity, 3 * MAX_NUM_OBJECTS ); -#ifdef CONF_DISTATT mvr2r( renderConfig.distAtt, hRenderConfig->distAtt, 3 ); -#endif hRenderConfig->split_rend_config = renderConfig.split_rend_config; @@ -2383,11 +2291,7 @@ ivas_error IVAS_DEC_GetDelay( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbSynDec[0], hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ); -#else - nSamples[1] = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], hDecoderConfig->output_config ) ); -#endif nSamples[2] = (int16_t) roundf( (float) st_ivas->binaural_latency_ns * hDecoderConfig->output_Fs / 1000000000.f ); nSamples[0] = nSamples[1] + nSamples[2]; @@ -2532,13 +2436,11 @@ ivas_error IVAS_DEC_VoIP_FeedFrame( int16_t partialCopyFrameType, partialCopyOffset; int16_t result; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL || au == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( auSize == 0 ) { return IVAS_ERR_OK; /* ignore empty/NO_DATA frame - shouldn't be transmitted in RTP */ @@ -2617,12 +2519,10 @@ ivas_error IVAS_DEC_VoIP_SetScale( const int16_t scale /* i : TSM scale to set in percent of the default frame size */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm == false ) { @@ -2656,13 +2556,11 @@ ivas_error IVAS_DEC_TSM_SetQuality( const float quality /* i : target TSM quality */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif if ( !hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) { return IVAS_ERR_TSM_NOT_ENABLED; @@ -2706,13 +2604,11 @@ ivas_error IVAS_DEC_VoIP_GetSamples( int16_t nSamplesRendered; uint8_t nOutChannels; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->hVoIP == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; hVoIP = hIvasDec->hVoIP; @@ -2916,13 +2812,11 @@ ivas_error IVAS_DEC_Flush( uint16_t nSamplesToRender; uint16_t nSamplesFlushedLocal; -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); nSamplesToRender = (uint16_t) *nSamplesFlushed; @@ -2952,13 +2846,11 @@ bool IVAS_DEC_VoIP_IsEmpty( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t nSamplesAsked ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif return ( ( JB4_bufferedDataUnits( hIvasDec->hVoIP->hJBM ) == 0 ) && ( hIvasDec->nSamplesAvailableNext < nSamplesAsked ) ); } @@ -3064,11 +2956,7 @@ ivas_error IVAS_DEC_GetJbmData( IVAS_JBM_TRACE_DATA *JbmTraceData /* o : JBM Trace data */ ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->hVoIP == NULL || JbmTraceData == NULL ) -#else - if ( hIvasDec->hVoIP == NULL ) -#endif { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } @@ -3293,29 +3181,19 @@ static ivas_error printConfigInfo_dec( * Print decoder set-up info *---------------------------------------------------------------------*/ -#ifdef FIX_VOIP_FUNCTIONS ivas_error IVAS_DEC_PrintConfig( -#else -void IVAS_DEC_PrintConfig( -#endif const IVAS_DEC_HANDLE hIvasDec, const bool quietModeEnabled, const bool voipMode ) { -#ifdef FIX_VOIP_FUNCTIONS if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif printConfigInfo_dec( hIvasDec->st_ivas, hIvasDec->bitstreamformat, voipMode, quietModeEnabled ); -#ifdef FIX_VOIP_FUNCTIONS return IVAS_ERR_OK; -#else - return; -#endif } diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 31d40bd78bdbfa8b8495f59d8522b0de47324b1a..a35b33174f9380091f83eb617c54bb935f2570b1 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -118,7 +118,6 @@ ivas_error IVAS_DEC_Open( /*! r: error code */ ivas_error IVAS_DEC_Configure( -#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ const IVAS_AUDIO_CONFIG outputConfig, /* i : output configuration */ @@ -135,24 +134,6 @@ ivas_error IVAS_DEC_Configure( const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ const bool delayCompensationEnabled /* i : enable delay compensation */ -#else - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - const uint32_t sampleRate, /* i : output sampling frequency */ - const IVAS_AUDIO_CONFIG outputConfig, /* i : audio configuration */ - const int16_t tsmEnabled, /* i : enable TSM */ - const IVAS_RENDER_FRAMESIZE renderFramesize, /* i : rendering frame size */ - const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ - const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ - const int16_t enableExternalOrientation, /* i : enable external orientations */ - const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ - const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ - const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ - const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ - const int16_t Opt_dpid_on, /* i : enable directivity pattern option */ - const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ - const int16_t delayCompensationEnabled /* i : enable delay compensation */ -#endif ); void IVAS_DEC_Close( @@ -502,11 +483,7 @@ const char *IVAS_DEC_GetErrorMessage( ivas_error error /* i : decoder error code enum */ ); -#ifdef FIX_VOIP_FUNCTIONS ivas_error IVAS_DEC_PrintConfig( -#else -void IVAS_DEC_PrintConfig( -#endif const IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ const bool quietModeEnabled, /* i : quiet mode flag: if true, reduces the amount of config info printed */ const bool voipMode diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 2d57baa825887887629e8c6e7ebd7ee04690cdd8..dfa6766d4dd15257bf09f5f1f148d252f98723b2 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -375,11 +375,7 @@ ivas_error acelp_core_enc( if ( !nelp_mode && !ppp_mode ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, st->GSC_noisy_speech, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*-----------------------------------------------------------------* @@ -419,21 +415,14 @@ ivas_error acelp_core_enc( else { const float *pt_interp_2; -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - if ( st->active_cnt != 1 ) - { -#endif - int16_t beta_index; - float lsf_wgts[M]; - - /* intra_frame prediction for the LSFs */ - lsp2lsf( lsp_new, lsf_new, M, 12800 ); - Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); - tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); - push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); -#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC - } -#endif + int16_t beta_index; + float lsf_wgts[M]; + + /* intra_frame prediction for the LSFs */ + lsp2lsf( lsp_new, lsf_new, M, 12800 ); + Unified_weighting( &st->Bin_E[L_FFT / 2], lsf_new, lsf_wgts, st->bwidth == NB, st->coder_type == UNVOICED, st->sr_core, M ); + tdm_SCh_lsf_reuse( ENC, st->element_brate, lsf_new, lsp_new, tdm_lsfQ_PCh, lsf_wgts, &beta_index ); + push_indice( hBstr, IND_IC_LSF_PRED, beta_index, TDM_IC_LSF_PRED_BITS ); pt_interp_2 = interpol_frac_12k8; if ( tdm_low_rate_mode == 1 && st->coder_type > UNVOICED ) @@ -498,11 +487,7 @@ ivas_error acelp_core_enc( { tc_classif_enc( st->L_frame, &tc_subfr, &position, attack_flag, st->pitch[0], res ); -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 1, NULL, unbits, st->element_mode, &uc_two_stage_flag, tdm_lp_reuse_flag, tdm_low_rate_mode, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif } /*---------------------------------------------------------------* @@ -560,11 +545,7 @@ ivas_error acelp_core_enc( lsf_syn_mem_restore( st, tilt_code_bck, gc_threshold_bck, clip_var_bck, next_force_sf_bck, lsp_new, lsp_mid, clip_var, mem_AR, mem_MA, lsp_new_bck, lsp_mid_bck, Bin_E, Bin_E_old, mem_syn_bck, mem_w0_bck, streaklimit, pstreaklen ); /* Configure ACELP bit allocation */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, st->coder_type, st->inactive_coder_type_flag, tc_subfr, 0, &nb_bits, unbits, 0, &uc_two_stage_flag, 0, 0, st->idchan, st->active_cnt, tdm_Pitch_reuse_flag, st->tdm_LRTD_flag, st->GSC_IVAS_mode ); -#endif /* redo LSF quantization */ lsf_enc( st, lsf_new, lsp_new, lsp_mid, Aq, tdm_low_rate_mode, 0, NULL ); diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index 1b5f2f86082f8607d932727310bf11757acfddac..07717c60903424a49442a9195df7c5d325d3f6bd 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -132,11 +132,7 @@ void acelp_core_switch_enc( * Excitation encoding *----------------------------------------------------------------*/ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, cbrate, st->core, -1, -1, st->last_L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, GENERIC, st->inactive_coder_type_flag, -1, -1, &j, &i, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, 0, 0 /*GSC_IVAS_mode*/ ); -#endif encod_gen_voic_core_switch( st, st->last_L_frame, inp, Aq, A, T_op, st->voicing, exc, cbrate ); diff --git a/lib_enc/core_switching_enc.c b/lib_enc/core_switching_enc.c index 999e4e4725ef0d441fcd0f2ba72c9c82a26f223b..8edbd75878be9f119b5039b3139630bc74db695e 100644 --- a/lib_enc/core_switching_enc.c +++ b/lib_enc/core_switching_enc.c @@ -171,13 +171,9 @@ void core_switching_pre_enc( st->uv_count = 0; } -#ifdef NONBE_1214_PLC_LSF_MEMORY if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) /* EVS and HQ -> ACELP */ || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && active_cnt == 1 ) || ( st->core == ACELP_CORE && st->last_L_frame > L_FRAME16k ) /* TCX @ 25.6/32 kHz -> ACELP */ ) -#else - if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && active_cnt == 1 ) ) -#endif { /* Reset the ACELP core in case of HQ->ACELP core switching */ diff --git a/lib_enc/hq_lr_enc.c b/lib_enc/hq_lr_enc.c index c0b43f7794a22edd57cbacad89c9e77513dd840c..a66fa37d055968718714d2ea3111dcd240ad5fc2 100644 --- a/lib_enc/hq_lr_enc.c +++ b/lib_enc/hq_lr_enc.c @@ -334,14 +334,10 @@ void hq_lr_enc( frac1 = L_Extract_lc( L_tmp, &exp ); /* Extract exponent of L_tmp */ L_tmp = Pow2( 30, frac1 ); exp = sub( exp, 30 ); -#ifdef FIX_1369_HQ_LR_OVERFLOW #ifdef BASOP_NOGLOB Ep_fx[i] = L_shl_o( L_tmp, s_max( sub( exp, 6 ), -31 ), &Overflow ); /* Q -6 */ #else Ep_fx[i] = L_shl( L_tmp, s_max( sub( exp, 6 ), -31 ) ); /* Q -6 */ -#endif -#else - Ep_fx[i] = L_shl( L_tmp, sub( exp, 6 ) ); /* Q -6 */ #endif Ep[i] = (float) ( Ep_fx[i] / pow( 2.0, -6 ) ); } diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 060b85a1dd6a87f1c689f490d7fca2b2d01e27ee..b3e8addc7d6c8b96961c200ddcf734b8f7142665 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -90,13 +90,8 @@ ivas_error ivas_core_enc( float *inp[CPE_CHANNELS]; float new_inp_resamp16k[CPE_CHANNELS][L_FRAME16k]; /* new input signal @16kHz, non pre-emphasised, used by the WB TBE/BWE */ float old_syn_12k8_16k[CPE_CHANNELS][L_FRAME16k]; /* ACELP core synthesis at 12.8kHz or 16kHz to be used by the SWB BWE */ -#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC float *shb_speech; float *hb_speech; -#else - float shb_speech[L_FRAME16k]; - float hb_speech[L_FRAME16k / 4]; -#endif float *new_swb_speech; float new_swb_speech_buffer[L_FRAME48k + STEREO_DFT_OVL_MAX]; float bwe_exc_extended[CPE_CHANNELS][L_FRAME32k + NL_BUFF_OFFSET]; @@ -104,11 +99,7 @@ ivas_error ivas_core_enc( int16_t Voicing_flag[CPE_CHANNELS]; float pitch_buf[CPE_CHANNELS][NB_SUBFR16k]; int16_t unbits[CPE_CHANNELS]; -#ifdef FIX_1111_TDM_LSP_BUFFER float tdm_lsfQ_PCh[M]; -#else - float tdm_lspQ_PCh[M], tdm_lsfQ_PCh[M]; -#endif int16_t last_element_mode, tdm_Pitch_reuse_flag; int32_t element_brate, last_element_brate, input_Fs; int16_t diff_nBits; @@ -163,9 +154,6 @@ ivas_error ivas_core_enc( input_Fs = sts[0]->input_Fs; input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); -#ifndef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC - set_f( new_swb_speech_buffer, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); -#endif for ( n = 0; n < n_CoreChannels; n++ ) { @@ -280,15 +268,7 @@ ivas_error ivas_core_enc( if ( st->element_mode == IVAS_CPE_TD && n == 0 ) { -#ifdef FIX_1111_TDM_LSP_BUFFER -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], NULL, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif -#else - td_stereo_param_updt( st->lsp_old, st->lsf_old, pitch_buf[0], tdm_lspQ_PCh, tdm_lsfQ_PCh, hStereoTD->tdm_Pri_pitch_buf, st->flag_ACELP16k, hStereoTD->tdm_use_IAWB_Ave_lpc ); -#endif } } @@ -354,9 +334,7 @@ ivas_error ivas_core_enc( * WB BWE encoding *---------------------------------------------------------------------*/ -#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC hb_speech = new_swb_speech_buffer; /* reuse existing buffer: hb_speech[L_FRAME16k/4]; */ -#endif if ( input_Fs >= 16000 && st->bwidth < SWB && st->hBWE_TD != NULL ) { @@ -381,10 +359,8 @@ ivas_error ivas_core_enc( *---------------------------------------------------------------------*/ new_swb_speech = new_swb_speech_buffer + STEREO_DFT_OVL_MAX; -#ifdef FIX_1298_MEMORY_OPT_IVAS_CORE_ENC set_f( new_swb_speech_buffer, 0, L_FRAME48k + STEREO_DFT_OVL_MAX ); shb_speech = new_inp_resamp16k[n]; /* reuse existing buffer: shb_speech[L_FRAME16k] */ -#endif if ( !st->Opt_SC_VBR && input_Fs >= 32000 && st->hBWE_TD != NULL ) { diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index 48c37b0d6ed0454b0a397a49daf9116398a28e92..dcab606086f7b436f08fd4df8909e30a2a91107b 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -459,11 +459,7 @@ ivas_error ivas_corecoder_enc_reconfig( else if ( st_ivas->hMCT != NULL && st_ivas->nCPE > 1 ) { -#ifdef NONBE_FIX_ISM_XOVER_BR if ( ( error = mct_enc_reconfigure( st_ivas, nchan_transport_old_real != nchan_transport_real ) ) != IVAS_ERR_OK ) -#else - if ( ( error = mct_enc_reconfigure( st_ivas, st_ivas->nchan_transport != nchan_transport_old ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 50f2c5a18b35196bc7fc216a31a8f31f2c782b9c..8f1e419d5d227abed2613fdcf2103e3c17d004fb 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -632,21 +632,7 @@ ivas_error ivas_cpe_enc( if ( sts[0]->core_brate == SID_2k40 ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX ivas_write_format_sid( ivas_format, hCPE->element_mode, sts[0]->hBstr, hEncoderConfig->sba_order, hEncoderConfig->sba_planar ); -#else - ivas_write_format_sid( ivas_format, hCPE->element_mode, sts[0]->hBstr ); -#ifdef NONBE_FIX_1052_SBA_EXT - if ( ivas_format == SBA_FORMAT ) - { - /* Write SBA planar flag */ - push_indice( sts[0]->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_planar, SBA_PLANAR_BITS ); - - /* Write SBA order */ - push_indice( sts[0]->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_order, SBA_ORDER_BITS ); - } -#endif -#endif } /*----------------------------------------------------------------* diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index d84f73a7d307dd7d83787772de4ded4f1880f1ab..65a98f87d069fc0727f273d6bfca545c9fbe33fa 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -183,12 +183,8 @@ void ivas_decision_matrix_enc( st->core = ACELP_CORE; } -#ifdef NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* sanity check: highest bitrates in ISM */ if ( st->is_ism_format && st->tcxonly && st->total_brate > MAX_ACELP_BRATE_ISM ) -#else - if ( st->is_ism_format && st->tcxonly ) -#endif { st->core = TCX_20_CORE; } diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 28d126560c2ff6e5e446646b6fa0078a63fd7c0a..1a6290580b8d8ff7fbaa47617969fac39b5a12d9 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 dbed65daf8f527f0622f6e23a71eeb0a245e36f2..89d4d6ddf566699614d9c646aded5bcd2e514f9e 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -138,13 +138,9 @@ void ivas_write_format( void ivas_write_format_sid( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const int16_t element_mode, /* i : element bitrate */ -#ifdef NONBE_FIX_1052_SBA_EXT_FIX - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - const int16_t sba_order, /* i : Ambisonic (SBA) order */ - const int16_t sba_planar /* i : SBA planar flag */ -#else - BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ -#endif + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + const int16_t sba_order, /* i : Ambisonic (SBA) order */ + const int16_t sba_planar /* i : SBA planar flag */ ) { int16_t ind = 0; /* to avoid compilation warning */ @@ -168,11 +164,6 @@ void ivas_write_format_sid( case ISM_FORMAT: ind = SID_ISM; break; -#ifndef FIX_1209_SID_SIGNALING - case MC_FORMAT: - ind = SID_MULTICHANNEL; - break; -#endif case SBA_FORMAT: switch ( element_mode ) { @@ -204,7 +195,6 @@ void ivas_write_format_sid( push_indice( hBstr, IND_IVAS_FORMAT, ind, SID_FORMAT_NBITS ); -#ifdef NONBE_FIX_1052_SBA_EXT_FIX if ( ivas_format == SBA_FORMAT ) { /* Write SBA planar flag */ @@ -213,7 +203,6 @@ void ivas_write_format_sid( /* Write SBA order */ push_indice( hBstr, IND_SMODE, sba_order, SBA_ORDER_BITS ); } -#endif return; } @@ -705,14 +694,7 @@ ivas_error ivas_init_encoder( { st_ivas->ism_mode = ISM_MODE_NONE; -#ifdef NONBE_FIX_ISM_XOVER_BR st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism ); -#else - if ( ivas_total_brate >= IVAS_256k ) - { - st_ivas->ism_mode = ISM_SBA_MODE_DISC; - } -#endif if ( ( error = ivas_ism_metadata_enc_create( st_ivas, hEncoderConfig->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) { @@ -767,16 +749,12 @@ ivas_error ivas_init_encoder( else { /* allocate and initialize MCT core coder */ -#ifdef NONBE_FIX_ISM_XOVER_BR { int16_t n_all; n_all = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; st_ivas->nCPE = ( n_all + 1 ) >> 1; } -#else - st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; -#endif for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index a69541346cd753f920579df1dbde5ced6470a7b1..3cb1d981688a50899d9cd28c4f0e41b7f0494951 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -292,11 +292,7 @@ ivas_error ivas_ism_enc( if ( sid_flag ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr, -1, -1 ); -#else - ivas_write_format_sid( st_ivas->hEncoderConfig->ivas_format, IVAS_SCE, st->hBstr ); -#endif } /*only metadata encoding is needed for this case*/ diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index 164c2d5d409da5c37ff70703d136ef85021ece1b..7a4a250fe898f829c6b543f808f86c84bd9a4a50 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -174,7 +174,6 @@ ivas_error ivas_masa_enc_open( hOmasaData->lp_noise_CPE = -1; hOmasaData->omasa_stereo_sw_cnt = OMASA_STEREO_SW_CNT_MAX; -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) { if ( ( hOmasaData->hOmasaEnergy = (OMASA_ENCODER_ENERGY_HANDLE) malloc( sizeof( OMASA_ENCODER_ENERGY_STATE ) ) ) == NULL ) @@ -186,7 +185,6 @@ ivas_error ivas_masa_enc_open( { hOmasaData->hOmasaEnergy = NULL; } -#endif hMasa->data.hOmasaData = hOmasaData; } @@ -225,14 +223,12 @@ void ivas_masa_enc_close( if ( ( *hMasa )->data.hOmasaData != NULL ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( ( *hMasa )->data.hOmasaData->hOmasaEnergy != NULL ) { free( ( *hMasa )->data.hOmasaData->hOmasaEnergy ); ( *hMasa )->data.hOmasaData->hOmasaEnergy = NULL; } -#endif free( ( *hMasa )->data.hOmasaData ); ( *hMasa )->data.hOmasaData = NULL; } @@ -440,10 +436,8 @@ ivas_error ivas_masa_encode( } else { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* use the MASA number of transport channels bit to signal if there are 1 or 2 objects */ if ( nchan_ism == 1 || nchan_ism == 2 ) { @@ -454,33 +448,17 @@ 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 { -#endif /* write the number of MASA transport channels */ push_next_indice( hMetaData, nchan_transport - 1, MASA_TRANSP_BITS ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT } -#endif hQMetaData->metadata_max_bits -= MASA_TRANSP_BITS; } if ( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE ) { -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR if ( nchan_ism >= 3 ) /* if 3 or 4 objects */ { push_next_indice( hMetaData, 5 - nchan_ism, MASA_HEADER_BITS ); @@ -489,24 +467,7 @@ 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 - /* signal MASA_ISM_FORMAT to decoder */ - push_next_indice( hMetaData, 1, 1 ); - /* write reserved bit */ - push_next_indice( hMetaData, 0, MASA_HEADER_BITS - 1 ); hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; -#endif } else { @@ -515,16 +476,12 @@ ivas_error ivas_masa_encode( push_next_indice( hMetaData, 0, MASA_HEADER_BITS ); hQMetaData->metadata_max_bits -= MASA_HEADER_BITS; } -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR if ( !( ivas_format == MASA_ISM_FORMAT && ism_mode == ISM_MODE_NONE && nchan_ism > 2 ) ) { -#endif /* write number of directions */ push_next_indice( hMetaData, hQMetaData->no_directions - 1, 1 ); hQMetaData->metadata_max_bits -= 1; -#ifdef NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR } -#endif /* write subframe mode */ push_next_indice( hMetaData, hQMetaData->q_direction[0].cfg.nblocks == 1 ? 1 : 0, MASA_SUBFRAME_BITS ); @@ -661,11 +618,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; @@ -882,11 +835,7 @@ ivas_error ivas_masa_enc_config( for ( i = 0; i < hQMetaData->no_directions; i++ ) { hQMetaData->q_direction[i].cfg.nbands = hMasa->config.numCodingBands; -#ifdef FIX_1161_REDUCE_OMASA_HEAP hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - hQMetaData->q_direction[i].cfg.nblocks = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif if ( ivas_format == MC_FORMAT ) { @@ -1399,11 +1348,7 @@ static void move_metadata_to_qmetadata( numCodingBands = hMasa->config.numCodingBands; numDirections = hMasa->config.numberOfDirections; -#ifdef FIX_1161_REDUCE_OMASA_HEAP numSf = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif hMeta = &( hMasa->masaMetadata ); for ( dir = 0; dir < numDirections; dir++ ) @@ -1821,14 +1766,7 @@ static void reduce_metadata_further( /* Copy spread coherence to the rest of subframes for the coherence coding algorithm. */ for ( sf = 1; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ ) { -#ifdef NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[sf] = hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[0]; -#else - for ( band = 0; band < numCodingBands; band++ ) - { - hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[sf] = hqmetadata->q_direction[0].coherence_band_data[band].spread_coherence[0]; - } -#endif } /* Surround coherence is already merged through time */ @@ -2700,17 +2638,11 @@ void ivas_merge_masa_metadata( float eneBand; float energyMerged[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hMasa->data.hOmasaData->hOmasaEnergy; -#endif numCodingBands = hMasa->config.numCodingBands; numDirections = hMasa->config.numberOfDirections; -#ifdef FIX_1161_REDUCE_OMASA_HEAP numSf = hMasa->config.joinedSubframes == TRUE ? 1 : MAX_PARAM_SPATIAL_SUBFRAMES; -#else - numSf = hMasa->config.joinedSubframes == TRUE ? 1 : 4; -#endif hMeta = &( hMasa->masaMetadata ); for ( sf = 0; sf < numSf; sf++ ) @@ -2731,11 +2663,7 @@ void ivas_merge_masa_metadata( /* Compute energies */ eneBand = hMasa->data.energy[sf][band]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP energyMerged[sf][band] = eneBand + hOmasaEnergy->energy_ism[sf][band]; -#else - energyMerged[sf][band] = eneBand + hMasa->data.hOmasaData->energy_ism[sf][band]; -#endif /* Compute weights */ energyTimesRatioMASA[0] = eneBand * hMeta->directional_meta[0].energy_ratio[sf][band]; @@ -2752,11 +2680,7 @@ void ivas_merge_masa_metadata( total_diff_nrg = eneBand * hMeta->common_meta.diffuse_to_total_ratio[sf][band]; /* criterion is mean of ISM ratio and new ratio */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hOmasaEnergy->energy_ism[sf][band] ) ) ) / 2.0f * hOmasaEnergy->energy_ism[sf][band]; -#else - energyTimesRatioISM = ( hOMasaMeta->directional_meta[0].energy_ratio[sf][band] + ( 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.hOmasaData->energy_ism[sf][band] ) ) ) / 2.0f * hMasa->data.hOmasaData->energy_ism[sf][band]; -#endif /* Determine combined metadata based on the weights */ merge_dest = -1; @@ -2778,11 +2702,7 @@ void ivas_merge_masa_metadata( hMeta->directional_meta[merge_dest].elevation[sf][band] = hOMasaMeta->directional_meta[0].elevation[sf][band]; /* limit with the earlier direct-energy ratio */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP - dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hOmasaEnergy->energy_ism[sf][band] ); /* new dir ratio */ -#else - dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hMasa->data.hOmasaData->energy_ism[sf][band] ); /* new dir ratio */ -#endif + dir_sum = 1.0f - total_diff_nrg / ( EPSILON + eneBand + hOmasaEnergy->energy_ism[sf][band] ); /* new dir ratio */ hMeta->directional_meta[merge_dest].energy_ratio[sf][band] = min( dir_sum, hOMasaMeta->directional_meta[0].energy_ratio[sf][band] ); /* clip with original ISM dir */ hMeta->common_meta.diffuse_to_total_ratio[sf][band] = 1.0f - hMeta->directional_meta[merge_dest].energy_ratio[sf][band]; @@ -3497,9 +3417,7 @@ static void ivas_encode_masaism_metadata( int16_t tmp, rotate; int16_t n_ism_tmp, i; OMASA_ENCODER_DATA_HANDLE hOmasaData = hMasa->data.hOmasaData; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hOmasaData->hOmasaEnergy; -#endif int16_t nbands_work; /* use the values from hQMetaData */ @@ -3510,11 +3428,7 @@ static void ivas_encode_masaism_metadata( { for ( sf = 0; sf < numSf; sf++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( sum_f( hOmasaEnergy->energy_ism[sf], omasa_nbands ) == 0.0f ) -#else - if ( sum_f( hOmasaData->energy_ism[sf], omasa_nbands ) == 0.0f ) -#endif { hOmasaData->masa_to_total_energy_ratio[sf][0] = 1.0f; } @@ -3536,29 +3450,17 @@ static void ivas_encode_masaism_metadata( for ( band = 0; band < omasa_nbands; band++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism += hOmasaEnergy->energy_ism[sf][band]; -#else - energy_ism += hOmasaData->energy_ism[sf][band]; -#endif for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism_ind[obj] += hOmasaEnergy->energy_ism[sf][band] * hOmasaEnergy->energy_ratio_ism[sf][band][obj]; -#else - energy_ism_ind[obj] += hOmasaData->energy_ism[sf][band] * hOmasaData->energy_ratio_ism[sf][band][obj]; -#endif } } for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[sf][0][obj] = energy_ism_ind[obj] / energy_ism; -#else - hOmasaData->energy_ratio_ism[sf][0][obj] = energy_ism_ind[obj] / energy_ism; -#endif } hOmasaData->masa_to_total_energy_ratio[sf][0] = eneBand / ( eneBand + energy_ism + EPSILON ); } @@ -3575,18 +3477,10 @@ static void ivas_encode_masaism_metadata( } for ( sf = 0; sf < omasa_nblocks; sf++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism += hOmasaEnergy->energy_ism[sf][band]; -#else - energy_ism += hOmasaData->energy_ism[sf][band]; -#endif for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP energy_ism_ind[obj] += hOmasaEnergy->energy_ism[sf][band] * hOmasaEnergy->energy_ratio_ism[sf][band][obj]; -#else - energy_ism_ind[obj] += hOmasaData->energy_ism[sf][band] * hOmasaData->energy_ratio_ism[sf][band][obj]; -#endif } } @@ -3598,11 +3492,7 @@ static void ivas_encode_masaism_metadata( { for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[0][band][obj] = energy_ism_ind[obj] / energy_ism; -#else - hOmasaData->energy_ratio_ism[0][band][obj] = energy_ism_ind[obj] / energy_ism; -#endif } brange[0] = hMasa->data.band_mapping[band]; brange[1] = hMasa->data.band_mapping[band + 1]; @@ -3624,11 +3514,7 @@ static void ivas_encode_masaism_metadata( for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[0][band][obj] = hOmasaEnergy->energy_ratio_ism[0][nbands_work - 1][obj]; -#else - hOmasaData->energy_ratio_ism[0][band][obj] = hOmasaData->energy_ratio_ism[0][nbands_work - 1][obj]; -#endif } } } @@ -3638,11 +3524,7 @@ static void ivas_encode_masaism_metadata( { for ( band = 0; band < nbands_work; band++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP if ( hOmasaEnergy->energy_ism[sf][band] == 0.0f ) -#else - if ( hOmasaData->energy_ism[sf][band] == 0.0f ) -#endif { hOmasaData->masa_to_total_energy_ratio[sf][band] = 1.0f; } @@ -3656,11 +3538,7 @@ static void ivas_encode_masaism_metadata( { eneBand += hMasa->data.energy[sf][bin]; } -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hOmasaEnergy->energy_ism[sf][band] + EPSILON ); -#else - hOmasaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hOmasaData->energy_ism[sf][band] + EPSILON ); -#endif } } for ( band = nbands_work; band < numCodingBands; band++ ) @@ -3669,11 +3547,7 @@ static void ivas_encode_masaism_metadata( for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[sf][band][obj] = hOmasaEnergy->energy_ratio_ism[sf][nbands_work - 1][obj]; -#else - hOmasaData->energy_ratio_ism[sf][band][obj] = hOmasaData->energy_ratio_ism[sf][nbands_work - 1][obj]; -#endif } } } @@ -3695,13 +3569,8 @@ static void ivas_encode_masaism_metadata( { for ( obj = 0; obj < nchan_ism; obj++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP assert( ( hOmasaEnergy->energy_ratio_ism[sf][band][obj] >= 0 ) && ( hOmasaEnergy->energy_ratio_ism[sf][band][obj] <= 1 ) ); ratio_ism[band][obj] = hOmasaEnergy->energy_ratio_ism[sf][band][obj]; -#else - assert( ( hOmasaData->energy_ratio_ism[sf][band][obj] >= 0 ) && ( hOmasaData->energy_ratio_ism[sf][band][obj] <= 1 ) ); - ratio_ism[band][obj] = hOmasaData->energy_ratio_ism[sf][band][obj]; -#endif } /* Quantize ISM ratios */ @@ -3725,11 +3594,7 @@ static void ivas_encode_masaism_metadata( } /* reconstructed values */ -#ifdef FIX_1161_REDUCE_OMASA_HEAP reconstruct_ism_ratios( ratio_ism_idx[band], nchan_ism, step, hOmasaEnergy->q_energy_ratio_ism[sf][band] ); -#else - reconstruct_ism_ratios( ratio_ism_idx[band], nchan_ism, step, hMasa->data.hOmasaData->q_energy_ratio_ism[sf][band] ); -#endif } if ( ( nchan_ism > 2 ) && ( idx_separated_object == nchan_ism - 1 ) ) @@ -3805,11 +3670,7 @@ static void ivas_encode_masaism_metadata( } -#ifdef FIX_1161_REDUCE_OMASA_HEAP calculate_nbits_meta( nchan_ism, hOmasaEnergy->q_energy_ratio_ism, hOmasaData->masa_to_total_energy_ratio, numSf, numCodingBands, bits_ism, idx_separated_object, ism_imp ); -#else - calculate_nbits_meta( nchan_ism, hOmasaData->q_energy_ratio_ism, hOmasaData->masa_to_total_energy_ratio, numSf, numCodingBands, bits_ism, idx_separated_object, ism_imp ); -#endif /* quantize directions */ for ( obj = 0; obj < nchan_ism; obj++ ) diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 2626cfe09baed5c3e729746271d08ca9b115c144..fa8c4d8b356e9f6d5fd13ccbcad455846e7a0601 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -197,27 +197,17 @@ void ivas_mct_core_enc( int16_t i, cpe_id, n, nAvailBits; int16_t nCPE; float *orig_spectrum[MCT_MAX_CHANNELS][2]; /* Pointers to MDCT output for a short block (L/R) */ -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC float powerSpecMsInv_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS]; float inv_spectrum_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS]; float powerSpec_long_cpe0[CPE_CHANNELS][L_FRAME_PLUS]; float powerSpec_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; float inv_spectrum_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */ float powerSpecMsInv_long[MCT_MAX_CHANNELS - CPE_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */ -#else - float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k]; - float powerSpecMsInv_long[MCT_MAX_CHANNELS][L_FRAME48k]; /* MS inv power spectrum, also inverse MDST spectrum */ -#endif -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC float *powerSpec[MCT_MAX_CHANNELS]; -#endif float *powerSpecMsInv[MCT_MAX_CHANNELS][2]; float *inv_mdst_spectrum[MCT_MAX_CHANNELS][2]; float *inv_spectrum[MCT_MAX_CHANNELS][2]; float *mdst_spectrum[MCT_MAX_CHANNELS][2]; -#ifndef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC - float inv_spectrum_long[MCT_MAX_CHANNELS][L_FRAME48k]; /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */ -#endif int16_t total_side_bits; int16_t chBitRatios[MCT_MAX_CHANNELS]; Encoder_State *sts[MCT_MAX_CHANNELS]; @@ -252,7 +242,6 @@ void ivas_mct_core_enc( nCPE++; } -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* point first CPE channels to longer buffers where switching from ACELP to TCX may occur in SBA with DTX (total memory saving)*/ for ( ch = 0; ch < CPE_CHANNELS; ch++ ) { @@ -264,22 +253,12 @@ void ivas_mct_core_enc( } for ( ch = CPE_CHANNELS; ch < nChannels; ch++ ) -#else - for ( ch = 0; ch < nChannels; ch++ ) -#endif { -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC inv_mdst_spectrum[ch][0] = powerSpecMsInv[ch][0] = powerSpecMsInv_long[ch - CPE_CHANNELS]; inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long[ch - CPE_CHANNELS] + N_TCX10_MAX; inv_spectrum[ch][0] = inv_spectrum_long[ch - CPE_CHANNELS]; inv_spectrum[ch][1] = inv_spectrum_long[ch - CPE_CHANNELS] + N_TCX10_MAX; powerSpec[ch] = powerSpec_long[ch - CPE_CHANNELS]; -#else - inv_mdst_spectrum[ch][0] = powerSpecMsInv[ch][0] = powerSpecMsInv_long[ch]; - inv_mdst_spectrum[ch][1] = powerSpecMsInv[ch][1] = powerSpecMsInv_long[ch] + N_TCX10_MAX; - inv_spectrum[ch][0] = inv_spectrum_long[ch]; - inv_spectrum[ch][1] = inv_spectrum_long[ch] + N_TCX10_MAX; -#endif } for ( cpe_id = 0, i = 0; cpe_id < nCPE; cpe_id++ ) diff --git a/lib_enc/ivas_mct_enc_mct.c b/lib_enc/ivas_mct_enc_mct.c index 8818baf67b46735dcca460a822a019e968afec12..feefd008ee8ab81e33f796a53977bb59a1088797 100644 --- a/lib_enc/ivas_mct_enc_mct.c +++ b/lib_enc/ivas_mct_enc_mct.c @@ -814,14 +814,10 @@ void write_mct_bitstream( *--------------------------------------------------------------------*/ void mctStereoIGF_enc( - MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ - Encoder_State **sts, /* i/o: encoder state structure */ - float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ -#ifdef NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC - float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ -#else - float powerSpec[MCT_MAX_CHANNELS][L_FRAME48k], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ -#endif + MCT_ENC_HANDLE hMCT, /* i/o: MCT encoder structure */ + Encoder_State **sts, /* i/o: encoder state structure */ + float *orig_spectrum[MCT_MAX_CHANNELS][2], /* i : MDCT spectrum for ITF */ + float *powerSpec[MCT_MAX_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum,or estimate*/ float *powerSpecMsInv[MCT_MAX_CHANNELS][NB_DIV], /* i : same as above but for inverse spect.*/ float *inv_spectrum[MCT_MAX_CHANNELS][NB_DIV], /* i : inverse spectrum */ const int16_t sp_aud_decision0[MCT_MAX_CHANNELS] /* i : speech audio decision */ diff --git a/lib_enc/ivas_omasa_enc.c b/lib_enc/ivas_omasa_enc.c index 399ad301be45d43e2ab502cc84073ba921c29325..d38980016aad4e7bf4b1f4699f941d291e058dc3 100644 --- a/lib_enc/ivas_omasa_enc.c +++ b/lib_enc/ivas_omasa_enc.c @@ -290,7 +290,6 @@ ivas_error ivas_omasa_enc_config( st_ivas->hOMasa = NULL; } -#ifdef FIX_1161_REDUCE_OMASA_HEAP /* OMASA energy handle */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && st_ivas->hMasa->data.hOmasaData->hOmasaEnergy == NULL ) { @@ -305,7 +304,6 @@ ivas_error ivas_omasa_enc_config( st_ivas->hMasa->data.hOmasaData->hOmasaEnergy = NULL; } -#endif st_ivas->hCPE[0]->element_brate = ivas_total_brate - ism_total_brate; if ( ivas_total_brate - ism_total_brate >= MIN_BRATE_MDCT_STEREO ) @@ -839,9 +837,7 @@ static void ivas_omasa_param_est_enc( float renormalization_factor_diff[MASA_FREQUENCY_BANDS]; float norm_tmp; int16_t mrange[2], brange[2]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hOmasaData->hOmasaEnergy; -#endif num_freq_bins = hOMasa->cldfbAnaEnc[0]->no_channels; num_freq_bands = hOMasa->nbands; @@ -873,11 +869,7 @@ static void ivas_omasa_param_est_enc( hOMasa->direction_vector_m[2][block_m_idx][band_m_idx] = 0.0f; } -#ifdef FIX_1161_REDUCE_OMASA_HEAP set_zero( hOmasaEnergy->energy_ism[block_m_idx], num_freq_bands ); -#else - set_zero( hOmasaData->energy_ism[block_m_idx], num_freq_bands ); -#endif for ( ts = mrange[0]; ts < mrange[1]; ts++ ) { @@ -895,11 +887,7 @@ static void ivas_omasa_param_est_enc( { for ( k = 0; k < nchan_ism; k++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ism[block_m_idx][i] += Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; -#else - hOmasaData->energy_ism[block_m_idx][i] += Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; -#endif } } } @@ -1027,9 +1015,7 @@ static void ivas_omasa_energy_and_ratio_est( int16_t mrange[2], brange[2]; float tftile_energy; float ism_ratio_sum; -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy = hOmasaData->hOmasaEnergy; -#endif num_freq_bands = hOMasa->nbands; l_ts = input_frame / CLDFB_NO_COL_MAX; @@ -1044,17 +1030,9 @@ static void ivas_omasa_energy_and_ratio_est( for ( i = 0; i < hOMasa->nbands; i++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP set_zero( hOmasaEnergy->energy_ratio_ism[block_m_idx][i], nchan_ism ); -#else - set_zero( hOmasaData->energy_ratio_ism[block_m_idx][i], nchan_ism ); -#endif } -#ifdef FIX_1161_REDUCE_OMASA_HEAP set_zero( hOmasaEnergy->energy_ism[block_m_idx], num_freq_bands ); -#else - set_zero( hOmasaData->energy_ism[block_m_idx], num_freq_bands ); -#endif /* Compute CLDFB */ for ( ts = mrange[0]; ts < mrange[1]; ts++ ) @@ -1074,13 +1052,8 @@ static void ivas_omasa_energy_and_ratio_est( for ( k = 0; k < nchan_ism; k++ ) { tftile_energy = Chnl_RealBuffer[k][j] * Chnl_RealBuffer[k][j] + Chnl_ImagBuffer[k][j] * Chnl_ImagBuffer[k][j]; -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ism[block_m_idx][i] += tftile_energy; hOmasaEnergy->energy_ratio_ism[block_m_idx][i][k] += tftile_energy; -#else - hOmasaData->energy_ism[block_m_idx][i] += tftile_energy; - hOmasaData->energy_ratio_ism[block_m_idx][i][k] += tftile_energy; -#endif } } } @@ -1092,13 +1065,8 @@ static void ivas_omasa_energy_and_ratio_est( ism_ratio_sum = 0.0f; for ( j = 0; j < nchan_ism; j++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[block_m_idx][i][j] /= ( hOmasaEnergy->energy_ism[block_m_idx][i] + EPSILON ); ism_ratio_sum += hOmasaEnergy->energy_ratio_ism[block_m_idx][i][j]; -#else - hOmasaData->energy_ratio_ism[block_m_idx][i][j] /= ( hOmasaData->energy_ism[block_m_idx][i] + EPSILON ); - ism_ratio_sum += hOmasaData->energy_ratio_ism[block_m_idx][i][j]; -#endif } if ( ism_ratio_sum == 0.0f ) @@ -1106,11 +1074,7 @@ static void ivas_omasa_energy_and_ratio_est( float temp_ism_ratio = 1.0f / ( (float) nchan_ism ); for ( j = 0; j < nchan_ism; j++ ) { -#ifdef FIX_1161_REDUCE_OMASA_HEAP hOmasaEnergy->energy_ratio_ism[block_m_idx][i][j] = temp_ism_ratio; -#else - hOmasaData->energy_ratio_ism[block_m_idx][i][j] = temp_ism_ratio; -#endif } } } diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index b503673796f176c1a47d221e1c7706d1005281ae..438edc41cc635a41eb92da1f8ec75b53cf111504 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -185,9 +185,7 @@ ivas_error ivas_osba_enc_reconfig( error = IVAS_ERR_OK; hEncoderConfig = st_ivas->hEncoderConfig; ivas_total_brate = hEncoderConfig->ivas_total_brate; -#ifdef NONBE_FIX_ISM_XOVER_BR int16_t nchan_transport; -#endif if ( ivas_total_brate != hEncoderConfig->last_ivas_total_brate ) @@ -201,18 +199,7 @@ ivas_error ivas_osba_enc_reconfig( spar_reconfig_flag = 0; old_ism_mode = st_ivas->ism_mode; -#ifdef NONBE_FIX_ISM_XOVER_BR st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism ); -#else - if ( ivas_total_brate >= IVAS_256k ) - { - st_ivas->ism_mode = ISM_SBA_MODE_DISC; - } - else - { - st_ivas->ism_mode = ISM_MODE_NONE; - } -#endif nchan_transport_old = st_ivas->nchan_transport; nCPE_old = st_ivas->nCPE; nSCE_old = st_ivas->nSCE; @@ -342,42 +329,27 @@ ivas_error ivas_osba_enc_reconfig( /*-----------------------------------------------------------------* * Allocate, initialize, and configure SCE/CPE/MCT handles *-----------------------------------------------------------------*/ -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif if ( old_ism_mode == ISM_MODE_NONE && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_ISM_XOVER_BR { nchan_transport = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; } -#else - st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; -#endif } else if ( old_ism_mode == ISM_SBA_MODE_DISC && st_ivas->ism_mode == ISM_MODE_NONE ) { nchan_transport_old += st_ivas->hEncoderConfig->nchan_ism; -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport = st_ivas->nchan_transport; -#endif } else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { -#ifdef NONBE_FIX_ISM_XOVER_BR nchan_transport_old += st_ivas->hEncoderConfig->nchan_ism; nchan_transport = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; st_ivas->nCPE = ( nchan_transport + 1 ) >> 1; -#else - st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; - nCPE_old = st_ivas->nCPE; - nchan_transport_old = st_ivas->nchan_transport; - nchan_transport_old += st_ivas->hEncoderConfig->nchan_ism; -#endif } if ( ( error = ivas_corecoder_enc_reconfig( st_ivas, nSCE_old, nCPE_old, nchan_transport_old, ivas_total_brate / st_ivas->nchan_transport, ( ivas_total_brate / st_ivas->nchan_transport ) * CPE_CHANNELS, MC_MODE_NONE ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 72fcc943d645955cd69b3abdde7659e543514738..09a209840a108c5ed725aa10fcda493e2f7d4fc1 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -958,10 +958,8 @@ void ivas_qmetadata_enc_sid_encode( BSTR_ENC_HANDLE hMetaData, /* i/o: metadata bitstream handle */ IVAS_QMETADATA *q_metadata, /* i/o: metadata handle */ const int16_t masa_sid_descriptor, /* i : description of MASA SID coding structure */ -#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; @@ -974,18 +972,12 @@ void ivas_qmetadata_enc_sid_encode( float avg_elevation[MASA_MAXIMUM_CODING_SUBBANDS]; int16_t bits_dir, bits_diff, bits_delta; int16_t metadata_sid_bits; /* bits allocated to SID for metadata */ -#ifdef NONBE_FIX_1052_SBA_EXT int16_t sba_spar_bitlen; -#endif if ( ivas_format == SBA_FORMAT ) { -#ifdef NONBE_FIX_1052_SBA_EXT sba_spar_bitlen = ivas_sba_spar_sid_bitlen( nchan_transport ); metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - sba_spar_bitlen - SID_FORMAT_NBITS - SBA_ORDER_BITS - SBA_PLANAR_BITS - 1; /* -1 for inactive mode header bit*/ -#else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - 2 - SID_FORMAT_NBITS; /* -1 for inactive mode header bit*/ -#endif } else { @@ -1264,11 +1256,7 @@ void reset_metadata_spatial( assert( hMetaData->ind_list[0].nb_bits == 1 ); #endif hMetaData->ind_list[0].value = 1; -#ifdef NONBE_FIX_1052_SBA_EXT metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS - SBA_PLANAR_BITS - SBA_ORDER_BITS; -#else - metadata_sid_bits = (int16_t) ( IVAS_SID_5k2 - SID_2k40 ) / FRAMES_PER_SEC - SID_FORMAT_NBITS; -#endif while ( hMetaData->nb_bits_tot < metadata_sid_bits ) { diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 1abcc780ad98e96078c4a0de3ab42218e8a8818c..bac7ee783dea66853962d32673358dc1feaf6654 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -230,21 +230,7 @@ ivas_error ivas_sce_enc( if ( st->core_brate == SID_2k40 ) { -#ifdef NONBE_FIX_1052_SBA_EXT_FIX ivas_write_format_sid( ivas_format, IVAS_SCE, st->hBstr, st_ivas->hEncoderConfig->sba_order, st_ivas->hEncoderConfig->sba_planar ); -#else - ivas_write_format_sid( ivas_format, IVAS_SCE, st->hBstr ); -#ifdef NONBE_FIX_1052_SBA_EXT - if ( ivas_format == SBA_FORMAT ) - { - /* Write SBA planar flag */ - push_indice( st->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_planar, SBA_PLANAR_BITS ); - - /* Write SBA order */ - push_indice( st->hBstr, IND_SMODE, st_ivas->hEncoderConfig->sba_order, SBA_ORDER_BITS ); - } -#endif -#endif } /*----------------------------------------------------------------* diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 1e7795abf60eafa7342f3d6bd6069d1e886e9c05..1d0459a3331cddc71b7a80b46489aabf3cd14974 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -695,17 +695,10 @@ static ivas_error ivas_spar_enc_process( hodirac_flag = ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ); -#ifdef NONBE_FIX_1052_SBA_EXT if ( ( error = ivas_dirac_enc( st_ivas->hDirAC, hQMetaData, hMetaData, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, dtx_vad, hEncoderConfig->ivas_format, nchan_transport, hodirac_flag ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( ( error = ivas_dirac_enc( st_ivas->hDirAC, hQMetaData, hMetaData, data_f, ppIn_FR_real, ppIn_FR_imag, input_frame, dtx_vad, hEncoderConfig->ivas_format, hodirac_flag ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif /* Set Energy Ratio to 0.0 if the mono flag has been set */ if ( hQMetaData->dirac_mono_flag ) diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 8304e4dd80ca2fb41d19ad9c9d84587417bb7757..ca9dfdea04877df00fba992e98e0c9c641137c21 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -1720,9 +1720,7 @@ static void ivas_write_parameter_bitstream_dtx( int16_t idx; float pr_min_max[2]; int16_t zero_pad_bits, sid_bits_len; -#ifdef NONBE_FIX_1052_SBA_EXT int16_t sba_spar_bitlen; -#endif sid_bits_len = hMetaData->nb_bits_tot; pr_min_max[0] = pSpar_md->min_max[0]; pr_min_max[1] = pSpar_md->min_max[1]; @@ -1778,12 +1776,8 @@ static void ivas_write_parameter_bitstream_dtx( } sid_bits_len = hMetaData->nb_bits_tot - sid_bits_len; -#ifdef NONBE_FIX_1052_SBA_EXT sba_spar_bitlen = ivas_sba_spar_sid_bitlen( num_dmx[0] ); zero_pad_bits = sba_spar_bitlen - sid_bits_len; -#else - zero_pad_bits = ( SPAR_DTX_BANDS * SPAR_SID_BITS_TAR_PER_BAND ) - sid_bits_len; -#endif assert( zero_pad_bits >= 0 ); if ( num_dmx[0] == 2 ) { diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 4778c2eee894f0c700977590fd4f95a7ed093172..44c5c5ea1119776262796c6942e99f7538e83c72 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -798,7 +798,6 @@ typedef struct ivas_omasa_enc_state_structure } OMASA_ENC_STATE, *OMASA_ENC_HANDLE; -#ifdef FIX_1161_REDUCE_OMASA_HEAP typedef struct ivas_omasa_encoder_energy_struct { float energy_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; @@ -807,17 +806,10 @@ typedef struct ivas_omasa_encoder_energy_struct } OMASA_ENCODER_ENERGY_STATE, *OMASA_ENCODER_ENERGY_HANDLE; -#endif typedef struct ivas_omasa_encoder_data_struct { -#ifdef FIX_1161_REDUCE_OMASA_HEAP OMASA_ENCODER_ENERGY_HANDLE hOmasaEnergy; -#else - float energy_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; - float energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; - float q_energy_ratio_ism[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS][MAX_NUM_OBJECTS]; -#endif float masa_to_total_energy_ratio[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; float lp_noise_CPE; /* LP filtered total noise estimation */ int16_t omasa_stereo_sw_cnt; diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc.c b/lib_enc/ivas_stereo_mdct_stereo_enc.c index 4fa7dc15b2b1c23d8901ef7adcb36715eefba9cb..e3ff04f86b8eca897406e1151535eadab2da4747 100644 --- a/lib_enc/ivas_stereo_mdct_stereo_enc.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc.c @@ -411,7 +411,6 @@ void stereo_coder_tcx( nAvailBitsMS[k] = ( ( mct_on ? 2 * sts[0]->bits_frame_channel : sts[0]->bits_frame_nominal ) - sts[0]->side_bits_frame_channel - sts[1]->side_bits_frame_channel - ( nSubframes == 2 ? OFFSET_BITS_TCX10 : OFFSET_BITS_TCX20 ) ) / nSubframes; -#ifdef NONBE_1329_FIX_OSBA_CRASH if ( mct_on && nAvailBitsMS[k] <= 0 ) /*Force M/S when bit-budget is low for MCT*/ { hStereoMdct->mdct_stereo_mode[k] = 1; @@ -420,7 +419,6 @@ void stereo_coder_tcx( } else { -#endif MsStereoDecision( sfbConf, sts[0]->hTcxEnc->spectrum[k], sts[1]->hTcxEnc->spectrum[k], inv_spectrum[0][k], inv_spectrum[1][k], &hStereoMdct->mdct_stereo_mode[k], &ms_mask[k][0], nAvailBitsMS[k] ); if ( sts[0]->igf ) @@ -432,9 +430,7 @@ void stereo_coder_tcx( { hStereoMdct->IGFStereoMode[k] = hStereoMdct->mdct_stereo_mode[k]; } -#ifdef NONBE_1329_FIX_OSBA_CRASH } -#endif if ( hStereoMdct->mdct_stereo_mode[k] != SMDCT_DUAL_MONO || hStereoMdct->IGFStereoMode[k] != SMDCT_DUAL_MONO ) { diff --git a/lib_enc/ivas_stereo_switching_enc.c b/lib_enc/ivas_stereo_switching_enc.c index cc1f0b643516a019948ff3f94c02b17feb521e0f..27a17e048b7a7c3e222eb22262060654f09434c2 100644 --- a/lib_enc/ivas_stereo_switching_enc.c +++ b/lib_enc/ivas_stereo_switching_enc.c @@ -801,9 +801,7 @@ void stereo_switching_enc( mvr2r( sts[0]->lsf_old1, sts[1]->lsf_old1, M ); mvr2r( sts[0]->lsp_old1, sts[1]->lsp_old1, M ); -#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING sts[1]->last_core_brate = sts[0]->last_core_brate; -#endif sts[1]->GSC_noisy_speech = 0; if ( hCPE->element_mode == IVAS_CPE_MDCT ) diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index ff13c4cd3f8a7fbec3ca2900261b8c1e5a11362b..b1363db1005079f38a928d353735dcaf0b752419 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -281,13 +281,11 @@ void wb_tbe_enc( autocorr( hb_old_speech, R, LPC_SHB_ORDER_WB + 1, ( NS2SA( INT_FS_12k8, 5000000L ) + L_SUBFR + L_FRAME ) * 5 / 16, win_lpc_hb_wb, 0, 1, 1 ); -#ifdef NONBE_FIX_1130_DIV_ZERO_LEV_DUR if ( st->element_mode > EVS_MONO ) { /* Ensure R[0] isn't zero when entering Levinson-Durbin */ R[0] = max( R[0], 1.0e-8f ); } -#endif lev_dur( lpc_wb_temp, R, LPC_SHB_ORDER_WB, ervec_temp ); a2lsp( lsp_wb_temp, lpc_wb_temp, LPC_SHB_ORDER_WB ); diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index 804e9c0a48eb61f019d52b7dd268e8fd2da92403..cf05b43a1cfae087c61c917ab084d8f3f6df5348 100644 --- a/lib_enc/transition_enc.c +++ b/lib_enc/transition_enc.c @@ -178,11 +178,7 @@ void transition_enc( if ( *tc_subfr == TC_0_0 ) { /* this is called only to compute unused bits */ -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, L_FRAME, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, TC_0_0, 3, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } *clip_gain = gp_clip( st->element_mode, st->core_brate, st->voicing, i_subfr, TRANSITION, xn, gp_cl ); @@ -278,11 +274,7 @@ void transition_enc( if ( i_subfr - *tc_subfr <= L_SUBFR ) { -#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#else - config_acelp1( ENC, st->total_brate, st->core_brate, st->core, st->extl, st->extl_brate, st->L_frame, -1, &( st->acelp_cfg ), hBstr->nb_bits_tot, TRANSITION, -1, *tc_subfr, 2, NULL, unbits_ACELP, st->element_mode, &i /*dummy*/, 0 /*tdm_lp_reuse_flag*/, 0 /*tdm_low_rate_mode*/, st->idchan, st->active_cnt, 0 /*tdm_Pitch_reuse_flag*/, st->tdm_LRTD_flag, 0 /*GSC_IVAS_mode*/ ); -#endif } /*-----------------------------------------------------------------* diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index 442c2806dfb7d5894ba895a382e587191b651e3b..85a99aa9036fece27de1acd48b5c387b3f6406f3 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -290,13 +290,11 @@ void isar_set_split_rend_ht_setup( float Rmat[MAX_PARAM_SPATIAL_SUBFRAMES][3][3] ); -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 int32_t isar_get_lc3plus_bitrate( const int32_t SplitRendBitRate, const ISAR_SPLIT_REND_POSE_CORRECTION_MODE poseCorrectionMode, const int32_t nChannels, const int32_t codecFrameDurationUs ); -#endif ivas_error isar_split_rend_validate_config( const ISAR_SPLIT_REND_CONFIG_DATA *pSplitRendConfig, diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 520fba4c46a214f686cee432fd25070a68a6b9a9..372c924ad091da283059d5618e3834f14ab739c9 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -1744,11 +1744,7 @@ ivas_error split_renderer_open_lc3plus( config.channels = BINAURAL_CHANNELS; if ( ( error = ISAR_LC3PLUS_ENC_Open( config, -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 isar_get_lc3plus_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode, config.channels, config.lc3plus_frame_duration_us ), -#else - isar_get_lcld_bitrate( pSplitRendConfig->splitRendBitRate, pSplitRendConfig->poseCorrectionMode ), -#endif &hSplitRendWrapper->hLc3plusEnc ) ) != IVAS_ERR_OK ) { return error; @@ -1967,7 +1963,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( } else { -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 if ( pBits->pose_correction == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) { available_bits = isar_get_lc3plus_bitrate( SplitRendBitRate, hSplitBin->multiBinPoseData.poseCorrectionMode, hSplitBin->hLc3plusEnc->config.channels, hSplitBin->hLc3plusEnc->config.lc3plus_frame_duration_us ) / FRAMES_PER_SEC; @@ -1976,9 +1971,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( { available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; } -#else - available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; -#endif if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, in ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_isar/isar_splitRenderer_utils.c b/lib_isar/isar_splitRenderer_utils.c index dbd0b11cb2911e66868bde3dfc3e1526eb672272..02dd552ef918b6b4e1d604d843c61d94192db62d 100644 --- a/lib_isar/isar_splitRenderer_utils.c +++ b/lib_isar/isar_splitRenderer_utils.c @@ -562,7 +562,6 @@ int32_t isar_get_lcld_bitrate( return -1; } -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 /*------------------------------------------------------------------------- * Function isar_get_lc3plus_bitrate() * @@ -586,7 +585,6 @@ int32_t isar_get_lc3plus_bitrate( } return bitrate; } -#endif /*------------------------------------------------------------------------- diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index 5867793c26e9d34d2145cfcd48ebdbc7088629bc..2e6c70b47ec88ce9c6fb09794a448107edf20a66 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -390,7 +390,6 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( } -#ifdef LC3PLUS_LEA_COMPAT_BITRATES_48_6 if ( pBits->pose_correction == ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) { available_bits = isar_get_lc3plus_bitrate( SplitRendBitRate, hSplitBin->multiBinPoseData.poseCorrectionMode, hSplitBin->hLc3plusEnc->config.channels, hSplitBin->hLc3plusEnc->config.lc3plus_frame_duration_us ) / FRAMES_PER_SEC; @@ -399,9 +398,6 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( { available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; } -#else - available_bits = ( SplitRendBitRate / FRAMES_PER_SEC ) - pBits->bits_written; -#endif if ( ( error = splitRendLc3plusEncodeAndWrite( hSplitBin, pBits, available_bits, output ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 85f265da33a2137816cf8e20ba2f498a87db5738..a5031b66dbb7d87a84bacee6698f925cc0d8542c 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -112,17 +112,9 @@ static void ivas_dirac_dec_binaural_check_and_switch_transports_headtracked( COM static void formulate2x2MixingMatrix( float Ein1, float Ein2, float CinRe, float CinIm, float Eout1, float Eout2, float CoutRe, float CoutIm, float Q[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Mim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], const float regularizationFactor ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void hrtfShGetHrtf( const int16_t bin, const int16_t aziDeg, const int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t useCachedValue ); -#endif -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked, HRTFS_PARAMBIN_HANDLE hHrtfParambin ); -#else -static void getDirectPartGains( const int16_t bin, int16_t aziDeg, int16_t eleDeg, float *lRealp, float *lImagp, float *rRealp, float *rImagp, const uint8_t stereoMode, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, const int16_t isHeadtracked ); -#endif static void matrixMul( float Are[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Aim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bre[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float Bim[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outRe[BINAURAL_CHANNELS][BINAURAL_CHANNELS], float outIm[BINAURAL_CHANNELS][BINAURAL_CHANNELS] ); @@ -137,12 +129,8 @@ static void ivas_masa_ext_rend_parambin_internal( MASA_EXT_REND_HANDLE hMasaExtR *------------------------------------------------------------------------*/ ivas_error ivas_dirac_dec_init_binaural_data( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; @@ -154,9 +142,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t num_poses, pos_idx; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif num_poses = 1; if ( st_ivas->hSplitBinRend != NULL ) { @@ -178,9 +164,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->hReverb = NULL; hDiracDecBin->h_freq_domain_decorr_ap_params = NULL; hDiracDecBin->h_freq_domain_decorr_ap_state = NULL; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = NULL; -#endif } output_Fs = st_ivas->hDecoderConfig->output_Fs; @@ -232,28 +216,16 @@ ivas_error ivas_dirac_dec_init_binaural_data( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -#ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = NULL; -#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = &( st_ivas->hRenderConfig->roomAcoustics ); -#endif } -#else - mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif /* reconfiguration needed when Reverb. parameters are changed -> close and open the handle again */ if ( hDiracDecBin->hReverb != NULL && ( ( hDiracDecBin->hReverb->numBins != nBins ) || @@ -264,8 +236,6 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -#ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, @@ -273,18 +243,8 @@ ivas_error ivas_dirac_dec_init_binaural_data( pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - hDiracDecBin->earlyPartEneCorrection -#endif - ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif + ( *phHrtfParambin )->parametricReverberationEneCorrections, + hDiracDecBin->earlyPartEneCorrection ) ) != IVAS_ERR_OK ) { return error; } @@ -344,9 +304,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( hDiracDecBin->reqularizationFactor = configure_reqularization_factor( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate ); -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif st_ivas->hDiracDecBin[pos_idx] = hDiracDecBin; } @@ -360,11 +318,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( nchan_to_allocate = 2 * BINAURAL_CHANNELS; if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } n_samples_granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); @@ -1297,11 +1251,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( spreadCoh = max( spreadCoh, altSpreadCoh ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex], isHeadtracked ); -#endif if ( hDiracDecBin->renderStereoOutputInsteadOfBinaural ) { @@ -1344,11 +1294,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( rImagp *= centerMul; /* Apply the gain for the left source of the three coherent sources */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 30, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 1], isHeadtracked ); -#endif hrtfEneSides = ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; @@ -1358,11 +1304,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices( /* Apply the gain for the right source of the three coherent sources. * -30 degrees to 330 wrapping due to internal functions. */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg + 330, eleDeg, &lRealpTmp, &lImagpTmp, &rRealpTmp, &rImagpTmp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[gainCacheBaseIndex + 2], isHeadtracked ); -#endif hrtfEneSides += ( lRealpTmp * lRealpTmp ) + ( lImagpTmp * lImagpTmp ) + ( rRealpTmp * rRealpTmp ) + ( rImagpTmp * rImagpTmp ); lRealp += sidesMul * lRealpTmp; lImagp += sidesMul * lImagpTmp; @@ -1719,11 +1661,7 @@ static void ivas_dirac_dec_binaural_determine_processing_matrices( hDiracDecBin->processMtxImPrev[chA][chB + 2][bin] = hDiracDecBin->processMtxIm[chA][chB + 2][bin]; } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked, *hDiracDecBin->phHrtfParambin ); -#else - getDirectPartGains( bin, aziDeg, eleDeg, &lRealp, &lImagp, &rRealp, &rImagp, hDiracDecBin->renderStereoOutputInsteadOfBinaural, Rmat, &gainCache[chB], isHeadtracked ); -#endif hDiracDecBin->processMtxRe[0][chB + 2][bin] = lRealp * gainFactor; hDiracDecBin->processMtxIm[0][chB + 2][bin] = lImagp * gainFactor; @@ -2477,13 +2415,8 @@ static void getDirectPartGains( const uint8_t renderStereoOutputInsteadOfBinaural, float Rmat[3][3], PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t isHeadtracked, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t isHeadtracked -#endif -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { float aziRad, eleRad; float y, mappedX, aziRadMapped, A, A2, A3; @@ -2528,11 +2461,7 @@ static void getDirectPartGains( { if ( aziDeg == gainCache->azi && eleDeg == gainCache->ele ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, TRUE ); -#endif } else { @@ -2542,11 +2471,7 @@ static void getDirectPartGains( { rotateAziEle( (float) aziDeg, (float) eleDeg, &aziDeg, &eleDeg, Rmat, 0 ); } -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE, hHrtfParambin ); -#else - hrtfShGetHrtf( bin, aziDeg, eleDeg, lRealp, lImagp, rRealp, rImagp, gainCache, FALSE ); -#endif } } @@ -2563,21 +2488,14 @@ static void hrtfShGetHrtf( float *rRealp, float *rImagp, PARAMBIN_HRTF_GAIN_CACHE *gainCache, -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF const int16_t useCachedValue, - HRTFS_PARAMBIN_HANDLE hHrtfParambin -#else - const int16_t useCachedValue -#endif -) + HRTFS_PARAMBIN_HANDLE hHrtfParambin ) { int16_t k; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF float( *hrtfShCoeffsReInt )[16][60]; float( *hrtfShCoeffsImInt )[16][60]; hrtfShCoeffsReInt = hHrtfParambin->hrtfShCoeffsRe; hrtfShCoeffsImInt = hHrtfParambin->hrtfShCoeffsIm; -#endif *lRealp = 0.0f; *lImagp = 0.0f; @@ -2591,17 +2509,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif } } else @@ -2615,17 +2526,10 @@ static void hrtfShGetHrtf( for ( k = 0; k < HRTF_SH_CHANNELS; k++ ) { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF *lRealp += hrtfShCoeffsReInt[0][k][bin] * shVec[k]; *lImagp += hrtfShCoeffsImInt[0][k][bin] * shVec[k]; *rRealp += hrtfShCoeffsReInt[1][k][bin] * shVec[k]; *rImagp += hrtfShCoeffsImInt[1][k][bin] * shVec[k]; -#else - *lRealp += hrtfShCoeffsRe[0][k][bin] * shVec[k]; - *lImagp += hrtfShCoeffsIm[0][k][bin] * shVec[k]; - *rRealp += hrtfShCoeffsRe[1][k][bin] * shVec[k]; - *rImagp += hrtfShCoeffsIm[1][k][bin] * shVec[k]; -#endif gainCache->shVec[k] = shVec[k]; } diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 0310efa38a756bc606cb6cde75da5225b87cc2bc..13baefbd739b396f7d4e33f70edefdeaea7b0311 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 /*-----------------------------------------------------------------------* @@ -155,10 +151,8 @@ ivas_error efap_init_data( const int16_t efap_mode /* i : indicates whether EFAP or EFIP is used */ ) { -/* Handle instance declaration */ -#ifdef FIX_1050_EFAP_ALLOC + /* Handle instance declaration */ int8_t polyset_size; -#endif EFAP *efap; ivas_error error; @@ -202,7 +196,6 @@ ivas_error efap_init_data( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferS\n" ) ); } -#ifdef FIX_1050_EFAP_ALLOC /* get upper bound of number of polygons required */ polyset_size = efap_poly_limit[num_speaker_nodes - 1]; @@ -217,7 +210,6 @@ ivas_error efap_init_data( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferS\n" ) ); } -#endif /*-----------------------------------------------------------------* @@ -362,14 +354,12 @@ void efap_free_data( free( ( *hEFAPdata )->vtxData.vtxOrder ); ( *hEFAPdata )->vtxData.vtxOrder = NULL; -#ifdef FIX_1050_EFAP_ALLOC free( ( *hEFAPdata )->polyData.polysetArray ); ( *hEFAPdata )->vtxData.vtxOrder = NULL; free( ( *hEFAPdata )->polyData.triArray ); ( *hEFAPdata )->vtxData.vtxOrder = NULL; -#endif free( ( *hEFAPdata )->bufferLong ); ( *hEFAPdata )->bufferLong = NULL; @@ -438,11 +428,7 @@ static ivas_error poly_init( if ( efap->vtxData.vertexArray[n].ele > 90.0 - 1e-6 || efap->vtxData.vertexArray[n].ele < 1e-6 - 90.0 ) { -#ifdef FIX_1050_EFAP_ALLOC efap->vtxData.vertexArray[n].isNaN = true; -#else - efap->vtxData.vertexArray[n].isNaN = 1; -#endif } } @@ -1534,12 +1520,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_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c index b3f968ea310fa4d555e9363e3e694c6892276b0e..78519210302b82b9c15d495a3c65b886069bc94b 100644 --- a/lib_rend/ivas_mcmasa_ana.c +++ b/lib_rend/ivas_mcmasa_ana.c @@ -1069,9 +1069,6 @@ void ivas_create_masa_out_meta( float surroundingCoherence[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS] /* i : Estimated surround coherence */ ) { -#ifndef FIX_1121_MASA_DESCRIPTOR - const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ -#endif int16_t i, sf, band; uint8_t numFrequencyBands; uint8_t numDirections; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2137c948398b843b8759b2f5f7fa86392bb32b3e..1b5a7d0493224bcf0d653b67f8a030c91f8efe59 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 } } @@ -396,11 +384,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Render subframe */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -441,12 +425,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ -#endif + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ) { int16_t i; @@ -459,11 +438,6 @@ ivas_error TDREND_GetMix( float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; -#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - int16_t subframe_update_flag; - - subframe_update_flag = subframe_idx == ism_md_subframe_update; -#endif error = IVAS_ERR_OK; /* Clear the output buffer to accumulate rendered sources */ @@ -486,13 +460,8 @@ ivas_error TDREND_GetMix( /* Update rendering params if needed */ if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); -#else - TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, - Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_update_flag ); -#endif } /* Render source if needed */ @@ -693,9 +662,7 @@ ivas_error ivas_td_binaural_open_ext( IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; -#ifdef CONF_DISTATT float *distAtt = NULL; -#endif float *directivity = NULL; if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) @@ -725,16 +692,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_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index daa9137dbb731e2a78bfd3951cdfcbfa55e7336c..8414394baec44bc15660c94f27622997dc44dde6 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -260,14 +260,9 @@ void TDREND_firfilt( /* Handle memory */ p_signal = buffer + filterlength - 1; - mvr2r( mem, buffer, filterlength - 1 ); /* Insert memory */ -#ifdef NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR + mvr2r( mem, buffer, filterlength - 1 ); /* Insert memory */ mvr2r( signal, p_signal, subframe_length ); /* Insert current frame */ mvr2r( p_signal + subframe_length - filterlength + 1, mem, filterlength - 1 ); /* Update memory for next frame */ -#else - mvr2r( signal, buffer + filterlength - 1, subframe_length ); /* Insert current frame */ - mvr2r( signal + subframe_length - filterlength + 1, mem, filterlength - 1 ); /* Update memory for next frame */ -#endif /* Convolution */ for ( i = 0; i < subframe_length; i++ ) diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index db26566ad2aa4140585e688e2273d9722bf964ba..90b9752044de4dce12b30a5dfecc8f8ba82f2b4c 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() @@ -289,13 +285,8 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - TDREND_SRC_t *Src_p /* i/o: Source pointer */ + TDREND_SRC_t *Src_p /* i/o: Source pointer */ ) -#else - TDREND_SRC_t *Src_p, /* i/o: Source pointer */ - const int16_t subframe_update_flag ) -#endif { TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; @@ -386,11 +377,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */ } -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( *intp_count > 0 ) ) -#else - if ( ( *intp_count > 0 ) && subframe_update_flag ) -#endif { /* Set deltas for interpolation */ v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); @@ -523,7 +510,6 @@ static void TDREND_SRC_SPATIAL_SetDirAtten( return; } -#ifdef CONF_DISTATT /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_SetDistAtten() * @@ -543,7 +529,6 @@ static void TDREND_SRC_SPATIAL_SetDistAtten( return; } -#endif /*-------------------------------------------------------------------* * TDREND_SRC_SPATIAL_GetDirGain() * @@ -617,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: @@ -634,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 351ac4264dfe9c921157cc23468847f69c67f228..0e3abb08ee77023a39f1a6cce349969f00b0164b 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -289,12 +289,6 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifndef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS - else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) - { - nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); - } -#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); @@ -311,11 +305,7 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef FIX_1138_SBA_EXT_ERROR_PRINTOUT else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) -#else - else -#endif { nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); @@ -339,12 +329,10 @@ int16_t ivas_get_nchan_buffers_dec( nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); } -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_ism > 0 ) { nchan_out_buff = st_ivas->nchan_ism + CPE_CHANNELS; } -#endif } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { @@ -354,12 +342,10 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { nchan_out_buff = max( nchan_out_buff, BINAURAL_CHANNELS + st_ivas->nchan_ism ); } -#endif else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); @@ -414,11 +400,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 df8e8a85326d6caffb1ea452ad26d8799d5475b9..1e8ffa6bc9a248395faa3aa7de127de5b6715c90 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -210,11 +210,7 @@ void ivas_masa_ext_rend_parambin_render( ); ivas_error ivas_dirac_dec_init_binaural_data( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin /* i : HRTF structure for rendering */ -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin /* i : HRTF structure for rendering */ -#endif ); void ivas_dirac_dec_close_binaural_data( @@ -634,9 +630,7 @@ ivas_error ivas_td_binaural_open_unwrap( const IVAS_FORMAT ivas_format, /* i : IVAS format (ISM/MC) */ const AUDIO_CONFIG transport_config, /* i : Transport configuration */ const float *directivity, /* i : Directivity pattern (used for ISM) */ -#ifdef CONF_DISTATT const float *distAtt, /* i : Distance attenuation (used for ISM) */ -#endif const IVAS_OUTPUT_SETUP hTransSetup, /* i : Loudspeaker layout */ BINAURAL_TD_OBJECT_RENDERER_HANDLE *hBinRendererTd, /* o : TD renderer handle */ int32_t *binaural_latency_ns /* i : Binauralization delay */ @@ -658,12 +652,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth/rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay metadata to sync with audio */ -#endif ); ivas_error TDREND_Update_listener_orientation( @@ -729,13 +718,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 */ @@ -754,12 +741,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_t *Src_p /* i/o: Source pointer */ -#else - TDREND_SRC_t *Src_p, - const int16_t subframe_update_flag /* i : Flag to determine update subframe idx */ -#endif ); ivas_error TDREND_SRC_Alloc( @@ -935,10 +917,8 @@ ivas_error ivas_binaural_reverb_init( const int32_t sampling_rate, /* i : sampling rate */ const float *defaultTimes, /* i : default reverberation times */ const float *defaultEne /* i : default reverberation energies */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , float *earlyEne /* i/o: Early part energies to be modified */ -#endif ); diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 6a6ac61307b526a4c74838e431ed24b2add7daf6..887538a11493ccc6ef057b9f63984e75650157cf 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -111,9 +111,6 @@ ivas_error ivas_render_config_init_from_rom( } #ifdef DEBUGGING ( *hRenderConfig )->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; -#endif -#ifndef FIX_587_DEFAULT_REVERB - ( *hRenderConfig )->roomAcoustics.override = FALSE; #endif ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; ( *hRenderConfig )->roomAcoustics.acousticPreDelay = IVAS_REVERB_DEFAULT_PRE_DELAY; @@ -133,11 +130,9 @@ ivas_error ivas_render_config_init_from_rom( ( *hRenderConfig )->directivity[i * 3 + 1] = 360.0f; /* Back cone */ ( *hRenderConfig )->directivity[i * 3 + 2] = 1.0f; /* Back attenuation */ } -#ifdef CONF_DISTATT ( *hRenderConfig )->distAtt[0] = 15.75f; /* Default max dist */ ( *hRenderConfig )->distAtt[1] = 1.0f; /* Default ref dist */ ( *hRenderConfig )->distAtt[2] = 1.0f; /* Default rolloff factor */ -#endif ( *hRenderConfig )->split_rend_config.splitRendBitRate = SPLIT_REND_768k; ( *hRenderConfig )->split_rend_config.dof = 3; ( *hRenderConfig )->split_rend_config.hq_mode = 0; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index e54b75cabc92c342f2d52defc35a574c2a58c43e..af357ae22980bb7a003e755d1a718b2be1f2160a 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -56,9 +56,7 @@ #define CLDFB_SLOTS_PER_SECOND 800 /* Used for initializing reverb */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 #define REV_TIME_THRESHOLD ( 0.2f ) -#endif #define INNER_BLK_SIZE 80 /* size of data blocks used for more efficient delay line and IIR filter processing */ /* should be a divisor of the frame length at any sampling rate and an even number*/ @@ -109,14 +107,9 @@ typedef struct ivas_reverb_params_t float *pFc; /* Center frequencies for FFT filter design */ float *pRt60; /* RT60 values at these frequencies */ float *pDsr; /* DSR values at these frequencies */ -#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. */ @@ -263,7 +256,6 @@ static void ivas_binaural_reverb_setReverbTimes( } currentEnergy *= attenuationFactorPerSampleSq; } -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 /* In some configurations with small T60s it is possible the number of taps randomizes to zero. Ensure at least 1 filter tap. */ if ( tap == 0 ) @@ -274,7 +266,6 @@ static void ivas_binaural_reverb_setReverbTimes( tap = 1; actualizedEnergy = 1; } -#endif hReverb->taps[bin][ch] = tap; /* Number of taps determined at the above random procedure */ } @@ -998,9 +989,6 @@ static ivas_error setup_FDN_branches( { int16_t nr_coefs, branch_idx, channel_idx; ivas_error error; -#ifndef FIX_1053_REVERB_RECONFIGURATION - float *pCoef_a, *pCoef_b; -#endif error = IVAS_ERR_OK; /* initialize feedback branches */ @@ -1022,15 +1010,6 @@ static ivas_error setup_FDN_branches( { for ( branch_idx = 0; branch_idx < pParams->nr_loops; branch_idx++ ) { -#ifndef FIX_1053_REVERB_RECONFIGURATION - pCoef_a = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx + nr_coefs]; - pCoef_b = &pParams->pT60_filter_coeff[2 * nr_coefs * branch_idx]; - - if ( ( error = set_t60_filter( hReverb, branch_idx, nr_coefs, pCoef_a, pCoef_b ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif if ( ( error = set_feedback_delay( hReverb, branch_idx, pParams->pLoop_delays[branch_idx] ) ) != IVAS_ERR_OK ) { return error; @@ -1055,19 +1034,11 @@ static ivas_error setup_FDN_branches( } -#ifdef FIX_1053_REVERB_RECONFIGURATION /*------------------------------------------------------------------------- * ivas_reverb_open() * * Allocate and initialize FDN reverberation handle *------------------------------------------------------------------------*/ -#else -/*------------------------------------------------------------------------- - * ivas_reverb_open() - * - * Allocate and initialize Crend reverberation handle - *------------------------------------------------------------------------*/ -#endif ivas_error ivas_reverb_open( REVERB_HANDLE *hReverb, /* i/o: Reverberator handle */ const HRTFS_STATISTICS_HANDLE hHrtfStatistics, /* i : HRTF statistics handle */ @@ -1077,13 +1048,9 @@ ivas_error ivas_reverb_open( { ivas_error error; -#ifdef FIX_1053_REVERB_RECONFIGURATION REVERB_HANDLE pState = *hReverb; int16_t nr_coefs, branch_idx; float *pCoef_a, *pCoef_b; -#else - REVERB_HANDLE pState = NULL; -#endif int16_t bin_idx, subframe_len, output_frame, predelay_bf_len, loop_idx; ivas_reverb_params_t params; rv_fftwf_type_complex pFft_wf_filter_ch0[RV_LENGTH_NR_FC]; @@ -1101,7 +1068,6 @@ ivas_error ivas_reverb_open( predelay_bf_len = output_frame; nr_fc_input = hRenderConfig->roomAcoustics.nBands; -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { /* Allocate main reverb. handle */ @@ -1110,20 +1076,12 @@ ivas_error ivas_reverb_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for FDN Reverberator " ); } } -#else - /* Allocate main reverb. handle */ - if ( ( pState = (REVERB_HANDLE) malloc( sizeof( REVERB_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Reverberator " ); - } -#endif if ( ( error = set_base_config( ¶ms, output_Fs ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { /* Allocate memory for feedback delay lines */ @@ -1141,22 +1099,6 @@ ivas_error ivas_reverb_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for FDN Reverberator" ); } } -#else - /* Allocate memory for feedback delay lines */ - for ( loop_idx = 0; loop_idx < IVAS_REV_MAX_NR_BRANCHES; loop_idx++ ) - { - if ( ( pState->loop_delay_buffer[loop_idx] = (float *) malloc( params.pLoop_delays[loop_idx] * sizeof( float ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CREND Reverberator" ); - } - } - - /* Allocate memory for the pre-delay delay line */ - if ( ( pState->pPredelay_buffer = (float *) malloc( output_frame * sizeof( float ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CREND Reverberator" ); - } -#endif pState->nr_of_branches = IVAS_REV_MAX_NR_BRANCHES; set_fft_and_datablock_sizes( pState, subframe_len ); @@ -1166,16 +1108,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(...) */ @@ -1195,9 +1130,6 @@ ivas_error ivas_reverb_open( /* set reverb acoustic configuration based on renderer config */ #ifdef DEBUGGING pState->pConfig.renderer_type_override = hRenderConfig->renderer_type_override; -#endif -#ifndef FIX_587_DEFAULT_REVERB - pState->pConfig.roomAcoustics.override = hRenderConfig->roomAcoustics.override; #endif pState->pConfig.roomAcoustics.nBands = hRenderConfig->roomAcoustics.nBands; @@ -1208,15 +1140,10 @@ ivas_error ivas_reverb_open( } /* set up input downmix */ -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { pState->dmx_gain = calc_dmx_gain(); } -#else - /* set up input downmix */ - pState->dmx_gain = calc_dmx_gain(); -#endif /* set up predelay - must be after set_base_config() and before compute_t60_coeffs() */ calc_predelay( ¶ms, hRenderConfig->roomAcoustics.acousticPreDelay, output_Fs ); @@ -1240,7 +1167,6 @@ ivas_error ivas_reverb_open( /* Compute the window used for FFT filters */ ivas_reverb_define_window_fft( pTime_window, transition_start, transition_length, nr_fc_fft_filter ); -#ifdef FIX_1053_REVERB_RECONFIGURATION /* === Copy parameters from ivas_reverb_params_t into DSP blocks === */ /* === to be used for subsequent audio signal processing === */ if ( *hReverb == NULL ) @@ -1253,19 +1179,6 @@ ivas_error ivas_reverb_open( return error; } } -#else - - /* === Now, copy parameters from ivas_reverb_params_t into DSP blocks === */ - /* === to be used for subsequent audio signal processing === */ - - pState->do_corr_filter = params.do_corr_filter; - - /* clear & init jot reverb fft filters */ - if ( ( error = initialize_reverb_filters( pState ) ) != IVAS_ERR_OK ) - { - return error; - } -#endif if ( pState->do_corr_filter ) @@ -1299,7 +1212,6 @@ ivas_error ivas_reverb_open( return error; } -#ifdef FIX_1053_REVERB_RECONFIGURATION if ( *hReverb == NULL ) { /* init predelay */ @@ -1328,16 +1240,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; @@ -1975,43 +1877,21 @@ ivas_error ivas_binaural_reverb_init( const int32_t sampling_rate, /* i : sampling rate */ const float *defaultTimes, /* i : default reverberation times */ const float *defaultEne /* i : default reverberation energies */ -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 , float *earlyEne /* i/o: Early part energies to be modified */ -#endif ) { ivas_error error; -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 int16_t preDelay, bin; float revTimes[CLDFB_NO_CHANNELS_MAX]; float revEne[CLDFB_NO_CHANNELS_MAX]; -#else - const float *revTimes; - const float *revEne; - float t60[CLDFB_NO_CHANNELS_MAX]; - float ene[CLDFB_NO_CHANNELS_MAX]; - int16_t preDelay; -#endif error = IVAS_ERR_OK; -#ifdef FIX_587_DEFAULT_REVERB if ( roomAcoustics != NULL ) -#else - if ( ( roomAcoustics != NULL ) && roomAcoustics->override ) -#endif { -#ifndef FIX_1139_REV_COLORATION_SHORT_T60 - revTimes = t60; - revEne = ene; -#endif -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfStatistics, sampling_rate, revTimes, revEne ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_reverb_prepare_cldfb_params( roomAcoustics, hHrtfStatistics, sampling_rate, t60, ene ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2019,20 +1899,14 @@ ivas_error ivas_binaural_reverb_init( } else { -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) { revTimes[bin] = defaultTimes[bin]; revEne[bin] = defaultEne[bin]; } -#else - revTimes = defaultTimes; - revEne = defaultEne; -#endif preDelay = 10; } -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 for ( bin = 0; bin < CLDFB_NO_CHANNELS_MAX; bin++ ) { /* Adjust the room effect parameters when the reverberation time is less than a threshold value, to avoid @@ -2064,7 +1938,6 @@ ivas_error ivas_binaural_reverb_init( } } } -#endif error = ivas_binaural_reverb_open( hReverbPr, numBins, numCldfbSlotsPerFrame, sampling_rate, revTimes, revEne, preDelay ); diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 216da82a477804e762be74c1c02a41990bfd07fb..bf6776ab043ac11929235199df66ef07f6fd9e43 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 5effed43798fb134793c6ab210156c1da809702e..927287ecd96a2b33cb061c32d40013623da77469 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 eacab49ee9d94135a94130302d032a11367fe2a7..ee062c5477db07f6ca23da8bc62d1361e9afb50f 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; @@ -497,7 +494,6 @@ typedef struct ivas_diffuse_distribution_data_structure } DIFFUSE_DISTRIBUTION_DATA, *DIFFUSE_DISTRIBUTION_HANDLE; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF typedef struct ivas_hrtfs_parambin_struct { float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; @@ -510,7 +506,6 @@ typedef struct ivas_hrtfs_parambin_struct int16_t allocatedFromFile; /* Not used and should not be here. Remove in cleanup. */ } HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif /* Parametric binaural data structure */ typedef struct ivas_dirac_dec_binaural_data_structure @@ -547,9 +542,7 @@ typedef struct ivas_dirac_dec_binaural_data_structure ivas_td_decorr_state_t *hTdDecorr; float reqularizationFactor; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#endif DIFFUSE_DISTRIBUTION_HANDLE hDiffuseDist; @@ -580,15 +573,11 @@ typedef struct ivas_binaural_rendering_conv_module_struct typedef struct EFAP_VERTEX { - float azi; /* azimuth of the loudspeaker */ - float ele; /* elevation of the loudspeaker */ - float pos[3]; /* [x y z] cartesian coordinate vector */ - int16_t idx; /* integer, that corresponds to the first index for the LS in the 1D output */ -#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 +592,8 @@ typedef struct EFAP_VERTEX_DATA typedef struct EFAP_POLYSET { - int16_t chan[EFAP_MAX_CHAN_NUM]; /* An array indicating the loudspeaker index of the polygon vertices */ -#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 +608,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; @@ -1323,20 +1300,6 @@ typedef struct ivas_hrtfs_fastconv_struct } HRTFS_FASTCONV, *HRTFS_FASTCONV_HANDLE; -#ifndef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -typedef struct ivas_hrtfs_parambin_struct -{ - float hrtfShCoeffsRe[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - float hrtfShCoeffsIm[BINAURAL_CHANNELS][HRTF_SH_CHANNELS][HRTF_NUM_BINS]; - - float parametricReverberationTimes[CLDFB_NO_CHANNELS_MAX]; - float parametricReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; - float parametricEarlyPartEneCorrection[CLDFB_NO_CHANNELS_MAX]; - - int16_t allocatedFromFile; - -} HRTFS_PARAMBIN, *HRTFS_PARAMBIN_HANDLE; -#endif typedef struct ivas_hrtfs_statistics_struct { const float *average_energy_l; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d7d6cc54a43549fa26c08cedc9320a11bc93f478..68d5d45587947310d29272fe629699c22a7ce0e3 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1108,11 +1108,7 @@ static ivas_error initHeadRotation( static void closeHeadRotation( IVAS_REND_HANDLE hIvasRend ) { -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( hIvasRend != NULL && hIvasRend->headRotData.headRotEnabled && hIvasRend->headRotData.hOrientationTracker != NULL ) -#else - if ( ( hIvasRend != NULL ) && ( hIvasRend->headRotData.hOrientationTracker != NULL ) ) -#endif { free( hIvasRend->headRotData.hOrientationTracker ); } @@ -2770,10 +2766,8 @@ ivas_error IVAS_REND_Open( const bool asHrtfBinary, const int16_t nonDiegeticPan, const float nonDiegeticPanGain, -#ifdef FIX_1135_EXT_RENDERER_HANDLES const int16_t Opt_Headrotation, const int16_t Opt_ExternalOrientation, -#endif const int16_t num_subframes ) { int16_t i; @@ -2828,46 +2822,34 @@ ivas_error IVAS_REND_Open( } /* Initialize headrotation data */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES hIvasRend->headRotData.headRotEnabled = 0; if ( Opt_Headrotation ) { -#endif if ( ( error = initHeadRotation( hIvasRend ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif /* Initialize external orientation data */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES hIvasRend->hExternalOrientationData = NULL; if ( Opt_ExternalOrientation ) { -#endif if ( ( error = ivas_external_orientation_open( &( hIvasRend->hExternalOrientationData ), num_subframes ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif /* Initilize combined orientation data */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES hIvasRend->hCombinedOrientationData = NULL; if ( Opt_Headrotation || Opt_ExternalOrientation ) { -#endif if ( ( error = ivas_combined_orientation_open( &( hIvasRend->hCombinedOrientationData ), outputSampleRate, num_subframes ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif /* Initialize EFAP */ if ( ( error = initEfap( &hIvasRend->efapOutWrapper, outConfig, &hIvasRend->customLsOut ) ) != IVAS_ERR_OK ) @@ -2976,17 +2958,13 @@ ivas_error IVAS_REND_Open( } } -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#endif if ( ( error = ivas_HRTF_statistics_init( &( hIvasRend->hHrtfs.hHrtfStatistics ), hIvasRend->sampleRateOut ) ) != IVAS_ERR_OK ) { return error; } -#ifdef FIX_1135_EXT_RENDERER_HANDLES } -#endif return IVAS_ERR_OK; } @@ -3911,11 +3889,7 @@ ivas_error IVAS_REND_GetDelay( { if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( hIvasRend->splitRendWrapper != NULL && hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) -#else - if ( hIvasRend->splitRendWrapper->hBinHrSplitPreRend != NULL ) -#endif { if ( hIvasRend->hRendererConfig->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { @@ -4215,9 +4189,6 @@ int16_t IVAS_REND_GetRenderConfig( hRCout->renderer_type_override = IVAS_RENDER_TYPE_OVERRIDE_NONE; break; } -#endif -#ifndef FIX_587_DEFAULT_REVERB - hRCout->roomAcoustics.override = hRCin->roomAcoustics.override; #endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay = hRCin->roomAcoustics.acousticPreDelay; @@ -4258,16 +4229,12 @@ int16_t IVAS_REND_FeedRenderConfig( ) { RENDER_CONFIG_HANDLE hRenderConfig; -#ifdef FIX_1053_REVERB_RECONFIGURATION uint16_t i; input_ism *pIsmInput; input_masa *pMasaInput; input_mc *pMcInput; input_sba *pSbaInput; ivas_error error; -#else - ivas_error error; -#endif if ( hIvasRend == NULL || hIvasRend->hRendererConfig == NULL ) { @@ -4278,9 +4245,6 @@ int16_t IVAS_REND_FeedRenderConfig( hRenderConfig->renderer_type_override = renderConfig.renderer_type_override; #endif -#ifndef FIX_587_DEFAULT_REVERB - hRenderConfig->roomAcoustics.override = renderConfig.roomAcoustics.override; -#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay = renderConfig.roomAcoustics.acousticPreDelay; hRenderConfig->roomAcoustics.inputPreDelay = renderConfig.roomAcoustics.inputPreDelay; @@ -4300,7 +4264,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 ) @@ -4347,12 +4310,8 @@ int16_t IVAS_REND_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, - NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - NULL -#endif - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -4367,12 +4326,8 @@ int16_t IVAS_REND_FeedRenderConfig( &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, - NULL -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - NULL -#endif - ) ) != IVAS_ERR_OK ) + NULL, + NULL ) ) != IVAS_ERR_OK ) { return error; } @@ -4422,7 +4377,6 @@ int16_t IVAS_REND_FeedRenderConfig( } } } -#endif hRenderConfig->split_rend_config = renderConfig.split_rend_config; /* Overwrite any pose correction settings if 0 DOF (no pose correction) was selected */ @@ -4612,12 +4566,10 @@ ivas_error IVAS_REND_SetOrientationTrackingMode( const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ ) { -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( hIvasRend->headRotData.headRotEnabled == 0 ) { return IVAS_ERR_OK; } -#endif return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, orientation_tracking ); } @@ -5249,11 +5201,7 @@ static ivas_error renderIsmToBinauralRoom( hCombinedOrientationData = ismInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -5868,11 +5816,7 @@ static ivas_error renderMcToBinaural( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -5962,11 +5906,7 @@ static ivas_error renderMcToBinauralRoom( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6058,11 +5998,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( hCombinedOrientationData = mcInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6672,11 +6608,7 @@ static ivas_error renderSbaToBinaural( hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -6753,11 +6685,7 @@ static ivas_error renderSbaToBinauralRoom( hCombinedOrientationData = sbaInput->base.ctx.pCombinedOrientationData; combinedOrientationEnabled = 0; -#ifdef FIX_1135_EXT_RENDERER_HANDLES if ( *hCombinedOrientationData != NULL ) -#else - if ( hCombinedOrientationData != NULL ) -#endif { for ( subframe_idx = 0; subframe_idx < ( *hCombinedOrientationData )->num_subframes; subframe_idx++ ) { @@ -8390,11 +8318,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ) { DIRAC_DEC_BIN_HANDLE hDiracDecBin; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF HRTFS_PARAMBIN_HANDLE *phHrtfParambin; -#else - HRTFS_PARAMBIN_HANDLE hHrtfParambin; -#endif int16_t nBins; int32_t output_Fs; RENDERER_TYPE renderer_type; @@ -8404,17 +8328,11 @@ static ivas_error ivas_masa_ext_rend_parambin_init( ivas_error error; float frequency_axis[CLDFB_NO_CHANNELS_MAX]; int16_t pos_idx; -#ifdef FIX_587_DEFAULT_REVERB const IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pRoomAcoustics; -#endif error = IVAS_ERR_OK; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF phHrtfParambin = inputMasa->hMasaExtRend->hHrtfParambin; -#else - hHrtfParambin = *( inputMasa->hMasaExtRend->hHrtfParambin ); -#endif /* Set common variables and defaults */ output_Fs = *( inputMasa->base.ctx.pOutSampleRate ); @@ -8486,33 +8404,19 @@ static ivas_error ivas_masa_ext_rend_parambin_init( } else if ( renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Indication of binaural rendering with room effect */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -#ifdef NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART if ( *inputMasa->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = NULL; -#endif } else { set_f( hDiracDecBin->earlyPartEneCorrection, 1.0f, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_587_DEFAULT_REVERB pRoomAcoustics = &( hRendCfg->roomAcoustics ); -#endif } -#else - mvr2r( ( *phHrtfParambin )->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif -#else - mvr2r( hHrtfParambin->parametricEarlyPartEneCorrection, hDiracDecBin->earlyPartEneCorrection, nBins ); -#endif if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */ { -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF -#ifdef FIX_587_DEFAULT_REVERB if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, @@ -8520,18 +8424,8 @@ static ivas_error ivas_masa_ext_rend_parambin_init( pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, - ( *phHrtfParambin )->parametricReverberationEneCorrections -#ifdef FIX_1139_REV_COLORATION_SHORT_T60 - , - hDiracDecBin->earlyPartEneCorrection -#endif - ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif -#else - if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRendCfg->roomAcoustics ), output_Fs, hHrtfParambin->parametricReverberationTimes, hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK ) -#endif + ( *phHrtfParambin )->parametricReverberationEneCorrections, + hDiracDecBin->earlyPartEneCorrection ) ) != IVAS_ERR_OK ) { return error; } @@ -8568,9 +8462,7 @@ static ivas_error ivas_masa_ext_rend_parambin_init( /* External renderer uses constant regularization factor */ hDiracDecBin->reqularizationFactor = 0.4f; -#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF hDiracDecBin->phHrtfParambin = phHrtfParambin; -#endif inputMasa->hMasaExtRend->hDiracDecBin[pos_idx] = hDiracDecBin; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index eb014f0dc5d10c8393e195ebf6f5d593ce1a9b68..8e3353b1b88f0530fa0d10a8a81f724fee97fe44 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -113,10 +113,8 @@ ivas_error IVAS_REND_Open( const bool asHrtfBinary, /* i : load hrtf binary file */ const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain, /* i : non-diegetic panning gain */ -#ifdef FIX_1135_EXT_RENDERER_HANDLES const int16_t Opt_Headrotation, /* i : indicates whether head-rotation is used */ const int16_t Opt_ExternalOrientation, /* i : indicates whether external orientations are used */ -#endif const int16_t num_subframes /* i : number of subframes */ ); diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 16a1e8e323a3c081bab733d9bd4a525417b2ee3a..8943f2460c62a3d4f2a4db9b8625251b87b456f2 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -189,7 +189,6 @@ static ivas_error check_hrtf_binary_header( { /* Check the renderer type */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_PARAMETRIC ) && ( hrtf_header->rend_type != HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM ) && @@ -197,15 +196,6 @@ static ivas_error check_hrtf_binary_header( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Header of HRTF binary file not compliant (renderer type)" ); } -#else - if ( ( hrtf_header->rend_type != RENDERER_BINAURAL_MIXER_CONV ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_MIXER_CONV_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_FASTCONV ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_FASTCONV_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_PARAMETRIC ) && ( hrtf_header->rend_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) && - ( hrtf_header->rend_type != RENDERER_BINAURAL_OBJECTS_TD ) ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Header of HRTF binary file not compliant (renderer type)" ); - } -#endif /* Check the output format of the decoder */ if ( ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_FOA ) && ( hrtf_header->input_cfg != BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED ) ) @@ -443,19 +433,6 @@ static ivas_error LoadBSplineBinary( LoadBSplineBinaryITD( &HrFiltSet_p->ModelParamsITD, f_hrtf ); } -#ifndef USE_NEW_HRTF_BINARY_FILE_FORMAT - /* left/right energy and interaural coherence for late reverb */ - for ( i = 0; i < 3; i++ ) - { - HrFiltSet_p->lr_energy_and_iac_dyn[i] = (float *) malloc( LR_IAC_LENGTH_NR_FC * sizeof( float ) ); - if ( HrFiltSet_p->lr_energy_and_iac_dyn[i] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for hrtf data" ); - } - fread( HrFiltSet_p->lr_energy_and_iac_dyn[i], sizeof( const float ), LR_IAC_LENGTH_NR_FC, f_hrtf ); - HrFiltSet_p->lr_energy_and_iac[i] = (const float *) HrFiltSet_p->lr_energy_and_iac_dyn[i]; - } -#endif return IVAS_ERR_OK; } @@ -529,11 +506,7 @@ static ivas_error load_reverb_from_binary( return header_check_result; } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT - is_reverb = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_REVERB_ALL ); -#else is_reverb = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_REVERB_ALL ); -#endif if ( !is_reverb ) { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) @@ -663,11 +636,7 @@ static ivas_error TDREND_MIX_LoadHRTF( return header_check_result; } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT is_tdrend = ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_OBJECTS_TD ); -#else - is_tdrend = ( hrtf_header.rend_type == RENDERER_BINAURAL_OBJECTS_TD ); -#endif if ( !is_tdrend ) { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) @@ -962,7 +931,6 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->index_frequency_max_diffuse = *( (uint16_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint16_t ); -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { ( *hHRTF )->inv_diffuse_weight[0][i] = *( (float *) ( hrtf_data_rptr ) ); @@ -973,15 +941,6 @@ static ivas_error create_HRTF_from_rawdata( ( *hHRTF )->inv_diffuse_weight[1][i] = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); } -#else - /* inv_diffuse_weight */ - for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) - { - ( *hHRTF )->inv_diffuse_weight[0][i] = *( (float *) ( hrtf_data_rptr ) ); - ( *hHRTF )->inv_diffuse_weight[1][i] = ( *hHRTF )->inv_diffuse_weight[0][i]; - hrtf_data_rptr += sizeof( float ); - } -#endif /* max_total_num_fsamp_per_iteration */ @@ -1090,25 +1049,18 @@ static ivas_error create_HRTF_from_rawdata( static ivas_error create_fastconv_HRTF_from_rawdata( - HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ - char *hrtf_data, /* i : pointer to binary file */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT - HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ -#else - RENDERER_TYPE rend_type, /* i : Renderer type */ -#endif + HRTFS_FASTCONV_HANDLE *hHRTF, /* i/o: HRTF FastConv handle */ + char *hrtf_data, /* i : pointer to binary file */ + HRTF_READER_RENDERER_TYPE rend_type, /* i : Renderer type */ BINAURAL_INPUT_AUDIO_CONFIG input_cfg /* i : Input binaural config */ ) { int16_t i, j; char *hrtf_data_rptr; -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT ivas_error error; -#endif ( *hHRTF )->allocate_init_flag = 0; -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) { if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, 0, input_cfg, RENDERER_BINAURAL_FASTCONV, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) @@ -1127,38 +1079,21 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "renderer type not compliant" ); } -#else - ivas_allocate_binaural_hrtf( *hHRTF, 0, input_cfg, rend_type, ( *hHRTF )->allocate_init_flag ); -#endif hrtf_data_rptr = hrtf_data; -#if !defined USE_NEW_HRTF_BINARY_FILE_FORMAT - /* BINAURAL_CONVBANDS */ - if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); - } - hrtf_data_rptr += sizeof( uint16_t ); -#endif -/* HRIR */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT + /* HRIR */ if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#else - if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#endif { ( *hHRTF )->FASTCONV_HRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1205,23 +1140,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) -#endif { /* HRIR_HOA3 */ ( *hHRTF )->FASTCONV_HOA3_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA3_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1267,23 +1196,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) -#endif { /* HRIR_HOA2 */ ( *hHRTF )->FASTCONV_HOA2_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HOA2_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1330,23 +1253,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) -#endif { /* HRIR_FOA */ ( *hHRTF )->FASTCONV_FOA_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( FOA_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1394,23 +1311,17 @@ static ivas_error create_fastconv_HRTF_from_rawdata( } } } -/* BRIR */ -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT + /* BRIR */ else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#else - else if ( rend_type == RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) -#endif { ( *hHRTF )->FASTCONV_BRIR_latency_s = *( (float *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( float ); -#if defined USE_NEW_HRTF_BINARY_FILE_FORMAT if ( BINAURAL_CONVBANDS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (BINAURAL_CONVBANDS)" ); } hrtf_data_rptr += sizeof( uint16_t ); -#endif if ( HRTF_LS_CHANNELS != *( (uint16_t *) ( hrtf_data_rptr ) ) ) { @@ -1524,11 +1435,7 @@ ivas_error load_fastconv_HRTF_from_binary( free( hrtf_data ); return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#else - if ( ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV ) || ( hrtf_header.rend_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) -#endif { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) { @@ -1686,11 +1593,7 @@ ivas_error load_parambin_HRTF_from_binary( } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Parametric binauralizer data is represented as single entity */ -#else - if ( hrtf_header.rend_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) /* Parametric binauralizer data is represented as single entity */ -#endif { if ( fread( hrtf_data, 1, hrtf_header.data_size, f_hrtf ) != hrtf_header.data_size ) { @@ -1780,11 +1683,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = NULL; if ( hrtf_header.frequency == output_Fs ) { -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) -#else - if ( hrtf_header.rend_type == RENDERER_BINAURAL_MIXER_CONV ) -#endif { if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1803,11 +1702,7 @@ ivas_error create_SetOfHRTF_from_binary( hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_foa ); } } -#ifdef USE_NEW_HRTF_BINARY_FILE_FORMAT else if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#else - else if ( hrtf_header.rend_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) -#endif { if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { diff --git a/lib_util/masa_file_reader.c b/lib_util/masa_file_reader.c index d5e7f687470c16c78af68a9dc82dca5d44f2b1ee..73396eeb652632faba54f218e46b411d084a2c70 100644 --- a/lib_util/masa_file_reader.c +++ b/lib_util/masa_file_reader.c @@ -35,9 +35,7 @@ #include "ivas_stat_com.h" #include #include -#ifdef FIX_1121_MASA_DESCRIPTOR #include "ivas_rom_com.h" /* load 'ivasmasaFormatDescriptor[8]' */ -#endif struct MasaFileReader @@ -114,9 +112,6 @@ ivas_error MasaFileReader_readNextFrame( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifndef FIX_1121_MASA_DESCRIPTOR - const uint8_t ivasmasaFormatDescriptor[8] = { 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 }; /* "IVASMASA" */ -#endif uint16_t twoByteBuffer = 0; int16_t i, j, b; IVAS_MASA_METADATA_HANDLE hMeta; diff --git a/lib_util/masa_file_writer.c b/lib_util/masa_file_writer.c index c7dd7df86b03d6b835a225a26f521c2060b07791..f3431a2b6d3fcce6b2f55ba782609d821e6ec37d 100644 --- a/lib_util/masa_file_writer.c +++ b/lib_util/masa_file_writer.c @@ -41,20 +41,12 @@ typedef struct masaMetaDelayStorage { MASA_DECRIPTIVE_META descriptiveMeta; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR + 1][MASA_FREQUENCY_BANDS]; uint8_t prevDelay; -#else - uint16_t directionIndex[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t directToTotalRatio[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t spreadCoherence[MASA_MAXIMUM_DIRECTIONS][DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t surroundCoherence[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; - uint8_t diffuseToTotalRatio[DELAY_MASA_PARAM_DEC_SFR][MASA_FREQUENCY_BANDS]; -#endif } MASA_META_DELAY_STORAGE; struct MasaFileWriter @@ -96,23 +88,15 @@ static void getExtMasaMetadataFileName( static void delayMasaMetadata( MASA_DECODER_EXT_OUT_META_HANDLE extOutMeta, /* i/o: New input metadata which is inplace replaced with delayed metadata frame */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT - MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ - uint8_t delayNsf -#else - MASA_META_DELAY_STORAGE *delayStorage /* i/o: Storage for 10 ms of metadata and related descriptive metadata */ -#endif -) + MASA_META_DELAY_STORAGE *delayStorage, /* i/o: Storage for 15 ms of metadata and related descriptive metadata */ + uint8_t delayNsf ) { int16_t dir, sf, band; uint8_t currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT int16_t storeReadOffset; -#endif /* Move meta to delay and output. Always use two directions as the metadata is prepared to contain zero energy second direction * if there is 1dir meta. */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* stable state expected results delay change expected results delayNsf = 2 delayNsf = 3 delayNsf = 3 (from 2) delayNsf = 2 (from 3) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[0] (prev ext[1]) ext[0] = delayStorage[0] (prev ext[2]) ext[0] = delayStorage[1] (prev ext[2]) @@ -183,43 +167,6 @@ static void delayMasaMetadata( } } -#else - for ( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES - DELAY_MASA_PARAM_DEC_SFR; sf++ ) - { - for ( band = 0; band < MASA_FREQUENCY_BANDS; band++ ) - { - uint16_t temp_u16; - uint8_t temp_u8; - for ( dir = 0; dir < MASA_MAXIMUM_DIRECTIONS; dir++ ) - { - temp_u16 = delayStorage->directionIndex[dir][sf][band]; - delayStorage->directionIndex[dir][sf][band] = extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directionIndex[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directionIndex[dir][sf][band]; - extOutMeta->directionIndex[dir][sf][band] = temp_u16; - - temp_u8 = delayStorage->directToTotalRatio[dir][sf][band]; - delayStorage->directToTotalRatio[dir][sf][band] = extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->directToTotalRatio[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->directToTotalRatio[dir][sf][band]; - extOutMeta->directToTotalRatio[dir][sf][band] = temp_u8; - - temp_u8 = delayStorage->spreadCoherence[dir][sf][band]; - delayStorage->spreadCoherence[dir][sf][band] = extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->spreadCoherence[dir][sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->spreadCoherence[dir][sf][band]; - extOutMeta->spreadCoherence[dir][sf][band] = temp_u8; - } - - temp_u8 = delayStorage->surroundCoherence[sf][band]; - delayStorage->surroundCoherence[sf][band] = extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->surroundCoherence[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->surroundCoherence[sf][band]; - extOutMeta->surroundCoherence[sf][band] = temp_u8; - - temp_u8 = delayStorage->diffuseToTotalRatio[sf][band]; - delayStorage->diffuseToTotalRatio[sf][band] = extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band]; - extOutMeta->diffuseToTotalRatio[sf + DELAY_MASA_PARAM_DEC_SFR][band] = extOutMeta->diffuseToTotalRatio[sf][band]; - extOutMeta->diffuseToTotalRatio[sf][band] = temp_u8; - } - } -#endif /* Finalize descriptive meta by using new frame except for number of directions which is the larger of the two */ currentNumberOfDirections = extOutMeta->descriptiveMeta.numberOfDirections; if ( delayStorage->descriptiveMeta.numberOfDirections > extOutMeta->descriptiveMeta.numberOfDirections ) @@ -227,9 +174,7 @@ static void delayMasaMetadata( extOutMeta->descriptiveMeta.numberOfDirections = delayStorage->descriptiveMeta.numberOfDirections; } delayStorage->descriptiveMeta.numberOfDirections = currentNumberOfDirections; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT delayStorage->prevDelay = delayNsf; -#endif return; } @@ -272,9 +217,7 @@ ivas_error MasaFileWriter_open( if ( !delayCompensationEnabled ) { self->delayStorage = calloc( sizeof( MASA_META_DELAY_STORAGE ), 1 ); -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT self->delayStorage->prevDelay = DELAY_MASA_PARAM_DEC_SFR; -#endif } *masaWriter = self; @@ -290,13 +233,9 @@ ivas_error MasaFileWriter_open( *---------------------------------------------------------------------*/ ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ) { if ( self == NULL ) @@ -307,7 +246,6 @@ ivas_error MasaFileWriter_writeFrame( uint16_t descMetaTemp = 0; int16_t i, sf, dir, numDirections; uint8_t writeTempOther[MASA_FREQUENCY_BANDS]; -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT /* If delay storage has been reserved, then we are in the normal mode for the decoder * (i.e., no delay compensation for PCM) which means that metadata should be delayed * by two or three subframes (10 or 15 ms). Descriptive metadata is a combined result. */ @@ -317,15 +255,6 @@ ivas_error MasaFileWriter_writeFrame( delayMasaMetadata( hMasaExtOutMeta, self->delayStorage, delayFrames ); } -#else - /* If delay storage has been reserved, then we are in the normal mode for the decoder - * (i.e., no delay compensation for PCM) which means that metadata should be delayed - * by two subframes (10 ms). Descriptive metadata is a combined result. */ - if ( self->delayStorage ) - { - delayMasaMetadata( hMasaExtOutMeta, self->delayStorage ); - } -#endif numDirections = hMasaExtOutMeta->descriptiveMeta.numberOfDirections + 1; diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index c3e142254b9e6e365e3f95e9d9bcb97af66cd547..74d098388c0e5acf03f777d75d6868f496bf3c6e 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -47,13 +47,9 @@ ivas_error MasaFileWriter_open( ); ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta, /* i/o: MASA ext out meta handle to be written */ const float *decDelay /* i : decoding audio delay */ -#else - IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ -#endif ); void MasaFileWriter_close( diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2262b1940abf36afd9779ae90468ef2693097bfc..b26003f52a39ea18d7775b8794b8afac9f8d314f 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] */ }; @@ -438,11 +436,7 @@ static ivas_error read_bin_bits( *pTarget = 0; for ( n = 0; n < nBits; n++ ) { -#ifdef FIX_WARNING_RENDER_CONFIG nByte = (uint32_t) ( ( this->readOffset + n ) >> 3 ); -#else - nByte = ( this->readOffset + n ) >> 3; -#endif bit = this->pBitstream[nByte] >> ( 7 - ( ( this->readOffset + n ) % 8 ) ) & 1; *pTarget = ( *pTarget << 1 ) + bit; } @@ -1003,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] @@ -1073,7 +1066,6 @@ static ivas_error get_bin_rolloff( return IVAS_ERR_OK; } -#endif /*-----------------------------------------------------------------------------------------* * Function read_txt_vector() @@ -1202,9 +1194,7 @@ ivas_error RenderConfigReader_checkValues( pRoom_acoustics = &hRenderConfig->roomAcoustics; tab_value_err_count = 0; int16_t wall_idx; -#ifdef CONF_DISTATT int16_t i; -#endif /* Verify the number of frequency bands in the config input data */ if ( ( pRoom_acoustics->nBands > N_BANDS_MAX ) || ( pRoom_acoustics->nBands < N_BANDS_MIN ) ) @@ -1322,7 +1312,6 @@ ivas_error RenderConfigReader_checkValues( } } -#ifdef CONF_DISTATT /* Verify range of distance attenuation parameters: 0.1 <= distAtt[0] <= distAtt[1] */ /* 0.0 <= distAtt[2] <= 10.0 */ hRenderConfig->distAtt[0] = max( 0.1f, hRenderConfig->distAtt[0] ); @@ -1336,7 +1325,6 @@ ivas_error RenderConfigReader_checkValues( hRenderConfig->directivity[i * 3 + 1] = max( 0.0f, min( 360.0f, hRenderConfig->directivity[i * 3 + 1] ) ); hRenderConfig->directivity[i * 3 + 2] = max( 0.0f, min( 1.0f, hRenderConfig->directivity[i * 3 + 2] ) ); } -#endif } @@ -1379,9 +1367,7 @@ ivas_error RenderConfigReader_open( pSelf->pAE = NULL; pSelf->nDP = 0; pSelf->pDP = NULL; -#ifdef CONF_DISTATT pSelf->distAtt[0] = -1; -#endif *ppRenderConfigReader = pSelf; return IVAS_ERR_OK; @@ -1901,7 +1887,6 @@ static ivas_error RenderConfigReader_readBinary( } } } -#ifdef CONF_DISTATT /**********************************/ /* Read the distance attenuation */ /**********************************/ @@ -1929,7 +1914,6 @@ static ivas_error RenderConfigReader_readBinary( return error; } } -#endif /* Cleanup */ @@ -2781,7 +2765,6 @@ ivas_error RenderConfigReader_read( free( pValue ); accDPIdx++; } -#ifdef CONF_DISTATT else if ( strcmp( chapter, "DISTANCEATTENUATION" ) == 0 ) { params_idx = 0; @@ -2827,7 +2810,6 @@ ivas_error RenderConfigReader_read( free( pValue ); } -#endif else if ( strcmp( chapter, "GENERAL" ) == 0 && strlen( pParams ) != 0 ) { params_idx = 0; @@ -2996,12 +2978,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; } } @@ -3052,11 +3032,7 @@ ivas_error RenderConfigReader_getDirectivity( } } /* case when -dpid is not specified, select first directivity pattern from config file */ -#ifdef NONBE_1229_FIX_ISM1_DPID if ( last_specified_id == 65535 ) -#else - if ( n == 0 ) -#endif { last_specified_id = (uint16_t) pRenderConfigReader->pDP[0].id; } @@ -3088,7 +3064,6 @@ ivas_error RenderConfigReader_getDirectivity( return IVAS_ERR_OK; } -#ifdef CONF_DISTATT /*------------------------------------------------------------------------------------------* * RenderConfigReader_getDistanceAttenuation() * @@ -3115,7 +3090,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 561e05f311b4545d50fcfe86b38a038fbf73cf07..8edaecc2f4b6b1c6290010e0f8b2a23fb63ab141 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 */