From 2e07d379baa30c7ee39c748787852d08fce5ae0b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 27 Nov 2025 03:01:26 -0600 Subject: [PATCH] Accept switches as agreed on 2025-11-26 + clang format --- apps/decoder.c | 478 +------------- apps/encoder.c | 51 -- apps/encoder_fmtsw.c | 67 -- apps/isar_post_rend.c | 105 --- apps/renderer.c | 165 ----- lib_com/basop_util.c | 113 ---- lib_com/basop_util.h | 6 - lib_com/bitstream_fx.c | 22 - lib_com/cnst.h | 2 - lib_com/common_api_types.h | 19 +- lib_com/fd_cng_com_fx.c | 5 - lib_com/fft_fx_evs.c | 161 +---- lib_com/hp50_fx.c | 4 - lib_com/ivas_cnst.h | 14 - lib_com/ivas_error.h | 4 - lib_com/ivas_prot_fx.h | 9 - lib_com/ivas_rom_com.h | 4 - lib_com/ivas_rom_com_fx.c | 4 - lib_com/options.h | 79 --- lib_com/preemph_fx.c | 29 - lib_com/prot_fx.h | 20 +- lib_com/stat_com.h | 8 +- lib_dec/FEC_HQ_phase_ecu_fx.c | 4 - lib_dec/TonalComponentDetection_fx.c | 4 - lib_dec/acelp_core_dec_fx.c | 10 - lib_dec/dec_tcx_fx.c | 13 - lib_dec/er_dec_tcx_fx.c | 33 +- lib_dec/fd_cng_dec_fx.c | 109 +-- lib_dec/ivas_binRenderer_internal_fx.c | 6 - lib_dec/ivas_core_dec_fx.c | 17 - lib_dec/ivas_decision_matrix_dec_fx.c | 9 - lib_dec/ivas_dirac_dec_fx.c | 22 - lib_dec/ivas_init_dec_fx.c | 161 +---- lib_dec/ivas_ism_metadata_dec_fx.c | 15 - lib_dec/ivas_ism_param_dec_fx.c | 29 +- lib_dec/ivas_jbm_dec_fx.c | 65 -- lib_dec/ivas_mc_param_dec_fx.c | 9 - lib_dec/ivas_mc_paramupmix_dec_fx.c | 9 - lib_dec/ivas_mct_dec_fx.c | 4 - lib_dec/ivas_mdct_core_dec_fx.c | 2 - lib_dec/ivas_omasa_dec_fx.c | 37 -- lib_dec/ivas_osba_dec_fx.c | 23 - lib_dec/ivas_output_config_fx.c | 51 -- lib_dec/ivas_stat_dec.h | 45 +- lib_dec/ivas_stereo_dft_dec_fx.c | 4 - lib_dec/ivas_stereo_dft_plc_fx.c | 13 - lib_dec/ivas_stereo_mdct_stereo_dec_fx.c | 4 - lib_dec/ivas_stereo_switching_dec_fx.c | 2 - lib_dec/ivas_tcx_core_dec_fx.c | 21 - lib_dec/jbm_pcmdsp_apa_fx.c | 26 +- lib_dec/lib_dec.h | 15 - lib_dec/lib_dec_fx.c | 624 ++---------------- lib_dec/stat_dec.h | 4 - lib_dec/tonalMDCTconcealment_fx.c | 8 - lib_enc/bw_detect_fx.c | 48 +- lib_enc/fd_cng_enc_fx.c | 85 --- lib_enc/ivas_core_pre_proc_front_fx.c | 6 +- lib_enc/ivas_core_pre_proc_fx.c | 4 - lib_enc/ivas_cpe_enc_fx.c | 17 - lib_enc/ivas_enc_fx.c | 8 - lib_enc/ivas_spar_encoder_fx.c | 4 - lib_enc/ivas_stat_enc.h | 6 +- lib_enc/ivas_stereo_dmx_evs_fx.c | 149 ----- lib_enc/ivas_stereo_switching_enc_fx.c | 4 - lib_enc/lib_enc_fx.c | 11 - lib_enc/stat_enc.h | 5 - lib_enc/swb_pre_proc_fx.c | 8 - lib_isar/isar_prot.h | 18 - lib_isar/isar_splitRend_lcld_dec.c | 33 - lib_isar/isar_splitRend_lcld_enc.c | 9 +- lib_isar/isar_splitRendererPost.c | 18 - lib_isar/isar_splitRendererPre.c | 101 +-- lib_isar/isar_stat.h | 2 - lib_isar/lib_isar_pre_rend.c | 49 +- lib_isar/lib_isar_pre_rend.h | 5 - lib_rend/ivas_cldfb_ring_buffer.c | 2 - .../ivas_dirac_dec_binaural_functions_fx.c | 59 +- lib_rend/ivas_prot_rend_fx.h | 21 - lib_rend/ivas_render_config_fx.c | 24 - lib_rend/ivas_rom_rend.h | 6 - lib_rend/ivas_rom_rend_fx.c | 20 - lib_rend/ivas_rotation_fx.c | 39 -- lib_rend/ivas_stat_rend.h | 2 - lib_rend/ivas_td_ring_buffer_fx.c | 100 --- lib_rend/lib_rend.h | 6 - lib_rend/lib_rend_fx.c | 69 +- lib_util/aeid_file_reader.c | 2 - lib_util/aeid_file_reader.h | 2 - lib_util/g192.c | 4 - lib_util/g192.h | 4 - lib_util/ism_file_reader.c | 39 -- lib_util/ism_file_writer.c | 12 - lib_util/ivas_rtp_api.h | 64 +- lib_util/ivas_rtp_file.c | 117 +--- lib_util/ivas_rtp_file.h | 18 - lib_util/ivas_rtp_internal.h | 20 +- lib_util/ivas_rtp_payload.c | 119 +--- lib_util/ivas_rtp_pi_data.c | 561 ++-------------- lib_util/ivas_rtp_pi_data.h | 153 ++--- lib_util/obj_edit_file_reader.c | 12 - lib_util/obj_edit_file_reader.h | 13 +- lib_util/render_config_reader.c | 56 -- lib_util/render_config_reader.h | 2 - lib_util/rtpdump.c | 12 - 104 files changed, 273 insertions(+), 4642 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 176ea7c75..c3a0a6c4b 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -44,17 +44,13 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION #include "aeid_file_reader.h" -#endif #include "split_render_file_read_write.h" #include "obj_edit_file_reader.h" #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "stl.h" -#ifdef IVAS_RTPDUMP #include "ivas_rtp_file.h" -#endif #define WMC_TOOL_SKIP @@ -68,13 +64,7 @@ static #endif int32_t frame = 0; /* Counter of frames */ -#ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS #define RANDOM_INITSEED_DEC ( 0xFADE ) -#else -#ifdef FIXED_RTP_SEQUENCE_NUM -#define RANDOM_INITSEED_DEC ( 0xFEEDFADE ) -#endif -#endif #ifdef DEBUGGING #define MIN_NUM_BITS_ACTIVE_FRAME 56 @@ -140,17 +130,11 @@ typedef struct uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; bool objEditEnabled; char *objEditFileName; -#ifdef IVAS_RTPDUMP bool applyPiData; char *piOutputFilename; bool rtpOutSR; -#endif -#ifdef FIX_1419_MONO_STEREO_UMX bool evsMode; -#endif -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE IVAS_ROOM_SIZE_T roomSize; -#endif } DecArguments; @@ -189,23 +173,13 @@ static ivas_error decodeVoIP( RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, -#endif -#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART IVAS_RENDER_CONFIG_DATA *renderConfig, -#endif -#ifdef DECODER_FORMAT_SWITCHING IVAS_DEC_HANDLE *phIvasDec, -#else - IVAS_DEC_HANDLE hIvasDec, -#endif int16_t *pcmBuf ); static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader ); -#ifdef DECODER_FORMAT_SWITCHING static ivas_error restartDecoder( IVAS_DEC_HANDLE *phIvasDec, const IVAS_DEC_MODE decMode, DecArguments *arg, IVAS_RENDER_CONFIG_DATA *renderConfig, IVAS_CUSTOM_LS_DATA *hLsCustomData ); -#endif /*------------------------------------------------------------------------------------------* @@ -238,13 +212,9 @@ int main( IVAS_RENDER_FRAMESIZE asked_frame_size; IVAS_DEC_HRTF_BINARY_WRAPPER hHrtfBinary; ObjectEditFileReader *objectEditFileReader = NULL; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT IVAS_ROOM_ACOUSTICS_CONFIG_DATA **pAE = NULL; uint32_t aeCount = 0; -#endif -#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART IVAS_RENDER_CONFIG_DATA renderConfig = { 0 }; -#endif #ifdef WMOPS reset_wmops(); reset_mem( USE_BYTES ); @@ -455,25 +425,13 @@ int main( *------------------------------------------------------------------------------------------*/ asked_frame_size = arg.renderFramesize; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : IVAS_DEFAULT_AEID; -#else - uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; -#endif -#ifdef IVAS_RTPDUMP arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; -#endif -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.roomSize, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, 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_fx, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -508,9 +466,6 @@ int main( fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifndef IVAS_RTPDUMP - arg.enableHeadRotation = true; -#endif } /*------------------------------------------------------------------------------------------* @@ -542,9 +497,6 @@ int main( if ( arg.renderConfigEnabled ) { -#ifndef FIX_SPLIT_RENDERING_ON_DECODER_RESTART - IVAS_RENDER_CONFIG_DATA renderConfig; -#endif /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && @@ -573,7 +525,6 @@ int main( goto cleanup; } -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT aeCount = RenderConfigReader_getAcousticEnvironmentCount( renderConfigReader ); if ( aeCount > 0 ) { @@ -613,7 +564,6 @@ int main( } } } -#endif if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity_fx ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] ); @@ -652,11 +602,7 @@ int main( if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#else - if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK ) -#endif { if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK ) { @@ -746,17 +692,9 @@ int main( if ( arg.voipMode ) { error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP &splitRendBits, -#endif -#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART &renderConfig, -#endif -#ifdef DECODER_FORMAT_SWITCHING &hIvasDec, -#else - hIvasDec, -#endif pcmBuf ); } else @@ -792,7 +730,6 @@ cleanup: free( pcmBuf ); -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT if ( pAE != NULL ) { uint16_t n; @@ -804,7 +741,6 @@ cleanup: free( pAE ); } -#endif if ( arg.aeSequence.count > 0 ) { @@ -965,9 +901,7 @@ static bool parseCmdlIVAS_dec( arg->output_Fs = IVAS_MAX_SAMPLING_RATE; arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_IVAS; -#ifdef FIX_1419_MONO_STEREO_UMX arg->evsMode = false; -#endif arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; arg->voipMode = false; @@ -982,11 +916,9 @@ static bool parseCmdlIVAS_dec( arg->referenceVectorTrajFileName = NULL; arg->enableExternalOrientation = false; arg->externalOrientationTrajFileName = NULL; -#ifdef IVAS_RTPDUMP arg->applyPiData = false; arg->piOutputFilename = NULL; arg->rtpOutSR = false; -#endif #ifdef SUPPORT_JBM_TRACEFILE arg->jbmTraceFilename = NULL; @@ -1025,9 +957,7 @@ static bool parseCmdlIVAS_dec( arg->objEditEnabled = false; arg->objEditFileName = NULL; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE arg->roomSize = IVAS_ROOM_SIZE_AUTO; -#endif /*-----------------------------------------------------------------* * Initialization @@ -1069,7 +999,6 @@ static bool parseCmdlIVAS_dec( arg->inputFormat = IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF; i++; } -#ifdef IVAS_RTPDUMP else if ( strcmp( argv_to_upper, "-PIDATAFILE" ) == 0 ) { i++; @@ -1092,7 +1021,6 @@ static bool parseCmdlIVAS_dec( arg->rtpOutSR = true; i++; } -#endif #ifdef SUPPORT_JBM_TRACEFILE else if ( strcmp( argv_to_upper, "-TRACEFILE" ) == 0 ) { @@ -1372,7 +1300,6 @@ static bool parseCmdlIVAS_dec( if ( !is_digits_only( argv[i] ) ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION aeidFileReader *aeidReader = NULL; if ( aeidFileReader_open( argv[i], &aeidReader ) != IVAS_ERR_OK ) { @@ -1388,67 +1315,6 @@ static bool parseCmdlIVAS_dec( } aeidFileReader_close( &aeidReader ); i++; -#else - uint16_t k; - char *s = argv[i]; - char *token = argv[i]; - - for ( k = 0; s[k]; ) - { - s[k] == ',' ? k++ : *s++; - } - k++; - - if ( k == 0 ) - { - fprintf( stdout, "Error: Invalid acoustic environment sequence specified: %s\n\n", argv[i] ); - usage_dec(); - return false; - } - - if ( NULL == ( arg->aeSequence.pID = malloc( sizeof( uint16_t ) * k ) ) || - NULL == ( arg->aeSequence.pValidity = malloc( sizeof( uint16_t ) * k ) ) ) - { - fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", argv[i] ); - usage_dec(); - return false; - } - - arg->aeSequence.count = k; - - k = 0; - token = strtok( argv[i++], ":" ); - - while ( token != NULL ) - { - if ( !is_number( token ) ) - { - fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, argv[i] ); - usage_dec(); - return false; - } - arg->aeSequence.pID[k] = (uint16_t) atoi( token ); - - token = strtok( NULL, "," ); - if ( !is_number( token ) ) - { - fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, argv[i] ); - usage_dec(); - return false; - } - arg->aeSequence.pValidity[k] = (uint16_t) atoi( token ); - - token = strtok( NULL, ":" ); - k++; - } - - if ( k != arg->aeSequence.count ) - { - fprintf( stdout, "Error while parsing acoustic environment sequence: %s\n\n", argv[i] ); - usage_dec(); - return false; - } -#endif } else { @@ -1527,15 +1393,12 @@ static bool parseCmdlIVAS_dec( } i++; } -#ifdef FIX_1419_MONO_STEREO_UMX else if ( strcmp( argv_to_upper, "-EVS" ) == 0 ) { arg->evsMode = true; arg->decMode = IVAS_DEC_MODE_EVS; i++; } -#endif -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE else if ( strcmp( argv_to_upper, "-ROOM_SIZE" ) == 0 ) { i++; @@ -1573,7 +1436,6 @@ static bool parseCmdlIVAS_dec( } i++; } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1624,7 +1486,6 @@ static bool parseCmdlIVAS_dec( usage_dec(); return false; } -#ifdef FIX_1419_MONO_STEREO_UMX else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode ) { fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" ); @@ -1632,7 +1493,6 @@ static bool parseCmdlIVAS_dec( return false; } -#endif if ( arg->outputMdFilename != NULL && arg->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { fprintf( stderr, "Error: Output split rendering metadata file is supported for BINAURAL_SPLIT_PCM output config. only\n\n" ); @@ -1724,9 +1584,7 @@ static bool parseCmdlIVAS_dec( static void usage_dec( void ) { fprintf( stdout, "Usage for EVS: IVAS_dec.exe [Options] Fs bitstream_file output_file\n" ); -#ifdef FIX_1419_MONO_STEREO_UMX fprintf( stdout, " OR usage for IVAS (below) with -evs option and OutputConf\n" ); -#endif fprintf( stdout, "Usage for IVAS: IVAS_dec.exe [Options] OutputConf Fs bitstream_file output_file\n\n" ); fprintf( stdout, "Mandatory parameters:\n" ); @@ -1743,12 +1601,9 @@ static void usage_dec( void ) fprintf( stdout, "Options:\n" ); fprintf( stdout, "--------\n" ); -#ifdef FIX_1419_MONO_STEREO_UMX fprintf( stdout, "-evs : Specify that the supplied bitstream is an EVS bitstream\n" ); -#endif fprintf( stdout, "-VOIP : VoIP mode: RTP in G192\n" ); fprintf( stdout, "-VOIP_hf_only=0 : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" ); -#ifdef IVAS_RTPDUMP fprintf( stdout, "-VOIP_hf_only=1 : VoIP mode: EVS or IVAS RTP Payload Format hf_only=1 in rtpdump\n" ); fprintf( stdout, " The decoder may read rtpdump files containing TS26.445 Annex A.2.2\n" ); fprintf( stdout, " EVS RTP Payload Format or rtpdump files containing TS26.253 Annex A\n" ); @@ -1757,12 +1612,6 @@ static void usage_dec( void ) fprintf( stdout, "-PiDataFile PF Log the timestampped PI data.\n" ); fprintf( stdout, "-ApplyPiData Apply the PI data found in the rtp packet.\n" ); fprintf( stdout, "-rtpOutSR : Split Rendering bitstream RTPDump output \n" ); -#else - fprintf( stdout, "-VOIP_hf_only=1 : VoIP mode: EVS RTP Payload Format hf_only=1 in rtpdump\n" ); - fprintf( stdout, " The decoder may read rtpdump files containing TS26.445 Annex A.2.2\n" ); - fprintf( stdout, " EVS RTP Payload Format. The SDP parameter hf_only is required.\n" ); - fprintf( stdout, " Reading RFC4867 AMR/AMR-WB RTP payload format is not supported.\n" ); -#endif #ifdef SUPPORT_JBM_TRACEFILE fprintf( stdout, "-Tracefile TF : VoIP mode: Generate trace file named TF. Requires -no_delay_cmp to\n" ); fprintf( stdout, " be enabled so that trace contents remain in sync with audio output.\n" ); @@ -1787,10 +1636,8 @@ static void usage_dec( void ) fprintf( stdout, "-rvf File : Reference vector specified by external trajectory File\n" ); fprintf( stdout, " works only in combination with '-otr ref_vec' and 'ref_vec_lev' modes\n" ); fprintf( stdout, "-render_config File : Renderer configuration File\n" ); -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE fprintf( stdout, "-room_size (S|M|L) : Selects default reverb based on a room size (S - small | M - medium | L - large)\n" ); fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration,\n" ); -#endif fprintf( stdout, "-om File : Metadata output File for BINAURAL_SPLIT_PCM OutputConf (only for Fs = 48 kHz)\n" ); fprintf( stdout, "-non_diegetic_pan P : panning mono non-diegetic sound to stereo with panning P, -90<= P <=90,\n" ); fprintf( stdout, " left or l or 90->left, right or r or -90->right, center or c or 0->middle\n" ); @@ -1835,9 +1682,7 @@ static ivas_error initOnFirstGoodFrame( IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], /* o : */ int16_t *pNumOutChannels, /* o : */ uint16_t *pNumObj, /* o : */ -#ifdef IVAS_RTPDUMP - IVAS_RTP *srRtp, /* o : */ -#endif + IVAS_RTP *srRtp, /* o : */ SplitFileReadWrite **splitRendWriter ) { int16_t isSplitRend, isSplitCoded; @@ -1890,23 +1735,12 @@ static ivas_error initOnFirstGoodFrame( int16_t splitRendIsarFrameSizeMs; int16_t lc3plusHighRes; -#ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ uint16_t rtpDecSeed = RANDOM_INITSEED_DEC; uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpDecSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpDecSeed ) << 16 ); uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpDecSeed ); -#else -#ifdef FIXED_RTP_SEQUENCE_NUM - /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we - use fixed seed for random num generator for regression based tests. Any realtime - application should implement this initialization seperately */ - srand( RANDOM_INITSEED_DEC ); - uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); - uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); -#endif -#endif if ( ( error = IVAS_DEC_GetDelay( hIvasDec, delayNumSamples_temp, &delayTimeScale_temp ) ) != IVAS_ERR_OK ) { @@ -1920,7 +1754,6 @@ static ivas_error initOnFirstGoodFrame( return error; } -#ifdef IVAS_RTPDUMP /* Split Rendering RTPDump Output file */ if ( arg.rtpOutSR && srRtp != NULL ) { @@ -1933,36 +1766,20 @@ static ivas_error initOnFirstGoodFrame( fParamsSR = fopen( srParamsFile, "w" ); if ( NULL != fParamsSR ) { -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE fprintf( fParamsSR, "DOF = %d;\nLC3PLUS_HIGHRES = %d;\n", poseCorrection, lc3plusHighRes ); -#else - fprintf( fParamsSR, "CODEC = %s;\nDOF = %d;\nFRAMESIZE = %d;\nRENDERSIZE = %d;\nLC3PLUS_HIGHRES = %d;\n", - splitRendCodec == ISAR_SPLIT_REND_CODEC_LC3PLUS ? "LC3PLUS" : "LCLD", - poseCorrection, - splitRendCodecFrameSizeMs, - splitRendIsarFrameSizeMs, - lc3plusHighRes ); -#endif fclose( fParamsSR ); fParamsSR = NULL; } /* Split Rendering RTPDump Output file */ -#ifdef FIXED_RTP_SEQUENCE_NUM if ( ( error = IVAS_RTP_WRITER_Init( srRtp, arg.outputWavFilename, 1000 / ( IVAS_NUM_FRAMES_PER_SEC * splitRendCodecFrameSizeMs ), ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_RTP_WRITER_Init( srRtp, arg.outputWavFilename, 1000 / ( IVAS_NUM_FRAMES_PER_SEC * splitRendCodecFrameSizeMs ) ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError: Can't open SR output bitstream file for RTP output %s \n\n", arg.outputWavFilename ); return error; } } else if ( isSplitCoded ) -#else - if ( isSplitCoded ) -#endif { if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) { @@ -1996,7 +1813,6 @@ static ivas_error initOnFirstGoodFrame( } } -#ifdef IVAS_RTPDUMP if ( !arg.rtpOutSR ) { int16_t pcmFrameSize; @@ -2016,11 +1832,7 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t i = 0; i < numInitialBadFrames; ++i ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) -#else - if ( *splitRendWriter != NULL ) -#endif { ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero; splitRendBitsZero.bits_buf = NULL; @@ -2038,12 +1850,8 @@ static ivas_error initOnFirstGoodFrame( return error; } } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitCoded ) -#else - else -#endif { if ( *pRemainingDelayNumSamples < *numOutSamples ) { @@ -2063,71 +1871,6 @@ static ivas_error initOnFirstGoodFrame( free( zeroBuf ); } -#else - int16_t pcmFrameSize; - if ( ( error = IVAS_DEC_GetOutputBufferSize( hIvasDec, &pcmFrameSize ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nError in IVAS_DEC_GetOutputBufferSize, error code: %d\n", error ); - return error; - } - - /* Write zeros to the output audio buffer */ - int16_t *zeroBuf = calloc( pcmFrameSize, sizeof( int16_t ) ); - if ( zeroBuf == NULL ) - { - fprintf( stdout, "Error: Unable to allocate memory for output buffer.\n" ); - return IVAS_ERR_FAILED_ALLOC; - } - - for ( int16_t i = 0; i < numInitialBadFrames; ++i ) - { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP - if ( isSplitRend ) -#else - if ( *splitRendWriter != NULL ) -#endif - { - ISAR_SPLIT_REND_BITS_DATA splitRendBitsZero; - splitRendBitsZero.bits_buf = NULL; - splitRendBitsZero.bits_read = 0; - splitRendBitsZero.bits_written = 0; - splitRendBitsZero.buf_len = 0; - splitRendBitsZero.codec = ISAR_SPLIT_REND_CODEC_DEFAULT; - splitRendBitsZero.pose_correction = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; - splitRendBitsZero.codec_frame_size_ms = 0; - splitRendBitsZero.isar_frame_size_ms = 20; - - if ( split_rend_write_bitstream_to_file( *splitRendWriter, splitRendBitsZero.bits_buf, &splitRendBitsZero.bits_read, &splitRendBitsZero.bits_written ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nUnable to write to bitstream file!\n" ); - return error; - } - } - -#ifdef FIX_1119_SPLIT_RENDERING_VOIP - if ( !isSplitCoded ) -#else - else -#endif - { - if ( *pRemainingDelayNumSamples < *numOutSamples ) - { - if ( ( error = AudioFileWriter_write( *ppAfWriter, zeroBuf, *numOutSamples * *pNumOutChannels - ( *pRemainingDelayNumSamples * *pNumOutChannels ) ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nOutput audio file writer error\n" ); - return error; - } - *pRemainingDelayNumSamples = 0; - } - else - { - *pRemainingDelayNumSamples -= *numOutSamples; - } - } - } - - free( zeroBuf ); -#endif /* Open other output files if EXT output config - now details about ISM or MASA are known */ if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) @@ -2221,11 +1964,7 @@ static ivas_error initOnFirstGoodFrame( } } -#ifdef IVAS_RTPDUMP if ( arg.rtpOutSR || *splitRendWriter != NULL ) -#else - if ( *splitRendWriter != NULL ) -#endif { if ( numOutSamples == NULL || vec_pos_len == NULL ) { @@ -2313,13 +2052,11 @@ static ivas_error decodeG192( return error; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( !isSplitRend ) { /* Ensure split rendering output struct is not used when not outputting to a split rendering output configuration */ splitRendBits = NULL; } -#endif if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { @@ -2582,11 +2319,7 @@ static ivas_error decodeG192( } /* decode transport channels, do TSM and feed to renderer */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2680,11 +2413,7 @@ static ivas_error decodeG192( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { -#ifdef IVAS_RTPDUMP if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, NULL, &splitRendWriter ) ) != IVAS_ERR_OK ) -#else - if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, &vec_pos_len, delayNumSamples_orig, &delayNumSamples, &delayTimeScale, &bsFormat, &afWriter, &masaWriter, ismWriters, &nOutChannels, &numObj, &splitRendWriter ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "Error in initOnFirstGoodFrame(): %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3032,17 +2761,9 @@ static ivas_error decodeVoIP( RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, -#endif -#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART IVAS_RENDER_CONFIG_DATA *renderConfig, -#endif -#ifdef DECODER_FORMAT_SWITCHING IVAS_DEC_HANDLE *phIvasDec, -#else - IVAS_DEC_HANDLE hIvasDec, -#endif int16_t *pcmBuf ) { bool decodingFailed = true; /* Assume failure until cleanup is reached without errors */ @@ -3074,29 +2795,13 @@ static ivas_error decodeVoIP( int16_t delayNumSamples = -1; int32_t delayTimeScale = -1; int16_t i; -#ifdef DECODER_FORMAT_SWITCHING IVAS_DEC_HANDLE hIvasDec = *phIvasDec; bool restartNeeded; -#endif -#ifdef IVAS_RTPDUMP IVAS_RTP ivasRtp = { 0 }; IVAS_RTP srRtp = { 0 }; -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE IVAS_RTP_SR_INFO srInfo = { true, false, 0, 20, IVAS_SR_TRANSPORT_LCLD }; -#else - IVAS_RTP_SR_INFO srInfo = { true, false, 0, IVAS_SR_TRANSPORT_LCLD }; -#endif int32_t initialTsOffsetSystemAndRTP = 0; -#else - FILE *f_rtpstream = NULL; - EVS_RTPDUMP_DEPACKER rtpdumpDepacker; - EVS_RTPDUMP_DEPACKER_ERROR rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_NO_ERROR; -#endif uint8_t *auPtr = NULL; -#ifndef IVAS_RTPDUMP - bool isAMRWB_IOmode; - uint16_t frameTypeIndex; -#endif bool qBit; IVAS_DEC_BS_FORMAT bsFormat = IVAS_DEC_BS_UNKOWN; @@ -3108,7 +2813,6 @@ static ivas_error decodeVoIP( bool parametersAvailableForEditing = false; uint16_t nSamplesRendered; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; @@ -3129,7 +2833,6 @@ static ivas_error decodeVoIP( fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } -#endif vec_pos_update = 0; if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK ) @@ -3155,41 +2858,15 @@ static ivas_error decodeVoIP( delayNumSamples_orig[0] = -1; -#ifndef IVAS_RTPDUMP - rtpdumpDepacker.rtpdump = NULL; -#endif switch ( arg.inputFormat ) { case IVAS_DEC_INPUT_FORMAT_RTPDUMP: case IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF: -#ifdef IVAS_RTPDUMP -#ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE -#ifdef RTP_S4_251135_CR26253_0016_REV1 - if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, 0, arg.inputBitstreamFilename, arg.piOutputFilename, arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL, arg.outputWavFilename ) ) != IVAS_ERR_OK ) -#endif -#else if ( ( error = IVAS_RTP_READER_Init( &ivasRtp, arg.inputBitstreamFilename, arg.piOutputFilename, arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL, arg.outputWavFilename ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error ); goto cleanup; } -#else - f_rtpstream = fopen( arg.inputBitstreamFilename, "r" ); - - if ( f_rtpstream == NULL ) - { - fprintf( stderr, "could not open: %s\n", arg.inputBitstreamFilename ); - goto cleanup; - } - - rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_open( &rtpdumpDepacker, f_rtpstream, arg.inputFormat == IVAS_DEC_INPUT_FORMAT_RTPDUMP_HF ); - if ( rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR ) - { - fprintf( stderr, "error in EVS_RTPDUMP_DEPACKER_open(): %d\n", rtpdumpDepackerError ); - goto cleanup; - } -#endif break; case IVAS_DEC_INPUT_FORMAT_G192: auPtr = au; @@ -3231,25 +2908,13 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ -#ifdef IVAS_RTPDUMP -#ifdef RTP_S4_251135_CR26253_0016_REV1 error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); -#else - error = IVAS_RTP_ReadNextFrame( &ivasRtp, auPtr, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit ); -#endif initialTsOffsetSystemAndRTP = rtpTimeStamp - systemTime_ms * 16; /* For time mapping */ -#else - rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_readNextFrame( &rtpdumpDepacker, &rtpSequenceNumber, &rtpTimeStamp, &nextPacketRcvTime_ms, &isAMRWB_IOmode, &frameTypeIndex, &qBit, &auPtr, (uint16_t *) &auSize ); -#endif /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */ rtpTimeStamp = rtpTimeStamp / 16; } -#ifdef IVAS_RTPDUMP if ( error != IVAS_ERR_OK ) -#else - if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR ) -#endif { fprintf( stderr, "failed to read first RTP packet\n" ); goto cleanup; @@ -3278,7 +2943,6 @@ static ivas_error decodeVoIP( { nSamplesRendered = 0; -#ifdef DECODER_FORMAT_SWITCHING /* restart decoder in case of format switching */ if ( ivasRtp.restartNeeded ) { @@ -3287,11 +2951,7 @@ static ivas_error decodeVoIP( &hIvasDec, newDecModeInPacket, &arg, -#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART renderConfig, -#else - NULL, /* ToDo : Provide rendererConfig */ -#endif NULL /* ToDo : Provide LS Custom Data */ ) ) != IVAS_ERR_OK ) { @@ -3302,7 +2962,6 @@ static ivas_error decodeVoIP( *phIvasDec = hIvasDec; /* Update for main()' s free */ ivasRtp.restartNeeded = false; } -#endif /* reference vector */ if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 ) @@ -3446,38 +3105,17 @@ static ivas_error decodeVoIP( else { auPtr = au; /* might have been set to RTP packet in prev call */ -#ifdef IVAS_RTPDUMP -#ifdef RTP_S4_251135_CR26253_0016_REV1 error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, NULL, &qBit ); -#else - error = IVAS_RTP_ReadNextFrame( &ivasRtp, au, &auSize, &rtpTimeStamp, &rtpSequenceNumber, &nextPacketRcvTime_ms, &qBit ); -#endif /* IVAS RTP payload format has timescale 16000, JBM uses 1000 internally */ rtpTimeStamp = rtpTimeStamp / 16; -#else - rtpdumpDepackerError = EVS_RTPDUMP_DEPACKER_readNextFrame( &rtpdumpDepacker, &rtpSequenceNumber, &rtpTimeStamp, - &nextPacketRcvTime_ms, - &isAMRWB_IOmode, &frameTypeIndex, &qBit, - &auPtr, (uint16_t *) &auSize ); - /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */ - rtpTimeStamp = rtpTimeStamp / 16; -#endif } -#ifdef IVAS_RTPDUMP if ( error == IVAS_ERR_END_OF_FILE ) -#else - if ( error == IVAS_ERR_END_OF_FILE || rtpdumpDepackerError == EVS_RTPDUMP_DEPACKER_EOF ) -#endif { /* finished reading */ nextPacketRcvTime_ms = (uint32_t) -1; } -#ifdef IVAS_RTPDUMP else if ( error != IVAS_ERR_OK ) -#else - else if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR ) -#endif { fprintf( stderr, "\nError in BS_Reader_ReadVoipFrame_compact, error code: %d\n", error ); goto cleanup; @@ -3501,7 +3139,6 @@ static ivas_error decodeVoIP( /* decode and get samples */ while ( nSamplesRendered < nOutSamples ) { -#ifdef IVAS_RTPDUMP if ( arg.applyPiData ) { /* Rudimentry Time Mapping to map system time to rtp timestamp */ @@ -3522,9 +3159,7 @@ static ivas_error decodeVoIP( ivasRtp.nProcPiData += numPiData; } -#endif -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) { #ifdef SUPPORT_JBM_TRACEFILE @@ -3539,19 +3174,16 @@ static ivas_error decodeVoIP( } else { -#endif #ifdef SUPPORT_JBM_TRACEFILE if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #else - if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, &bitstreamReadDone, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, &bitstreamReadDone, ¶metersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK ) #endif { fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP } -#endif if ( bitstreamReadDone == true ) { @@ -3563,7 +3195,6 @@ static ivas_error decodeVoIP( return error; } -#ifdef DECODER_FORMAT_SWITCHING /* restart decoder in case of format switching */ if ( ( error = IVAS_DEC_isRestartNeeded( hIvasDec, &restartNeeded ) ) != IVAS_ERR_OK ) { @@ -3594,7 +3225,6 @@ static ivas_error decodeVoIP( *phIvasDec = hIvasDec; /* Update for main()' s free */ } -#endif /* Placeholder for memory reallocation */ /* ... */ @@ -3664,19 +3294,11 @@ static ivas_error decodeVoIP( /* Once good frame decoded, catch up */ if ( decodedGoodFrame ) { -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - SplitFileReadWrite *splitRendWriter = NULL; - -#endif if ( ( error = initOnFirstGoodFrame( hIvasDec, arg, numInitialBadFrames, &nOutSamples, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP &vec_pos_len, -#else - NULL, -#endif delayNumSamples_orig, &delayNumSamples, &delayTimeScale, @@ -3686,9 +3308,7 @@ static ivas_error decodeVoIP( ismWriters, &nOutChannels, &numObj, -#ifdef IVAS_RTPDUMP &srRtp, -#endif &splitRendWriter ) ) != IVAS_ERR_OK ) { goto cleanup; @@ -3701,13 +3321,8 @@ static ivas_error decodeVoIP( } /* Write current frame */ -#ifdef IVAS_RTPDUMP if ( !srRtp.hPack && decodedGoodFrame ) -#else - if ( decodedGoodFrame ) -#endif { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) @@ -3719,7 +3334,6 @@ static ivas_error decodeVoIP( if ( !isSplitCoded ) { -#endif if ( delayNumSamples < nOutSamples ) { if ( ( error = AudioFileWriter_write( afWriter, &pcmBuf[delayNumSamples * nOutChannels], nOutSamples * nOutChannels - ( delayNumSamples * nOutChannels ) ) ) != IVAS_ERR_OK ) @@ -3733,9 +3347,7 @@ static ivas_error decodeVoIP( { delayNumSamples -= nOutSamples; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP } -#endif /* Write ISM metadata to external file(s) */ if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) @@ -3790,20 +3402,15 @@ static ivas_error decodeVoIP( goto cleanup; } } -#ifdef IVAS_RTPDUMP IVAS_RTP_WriteExtPiData( ivasRtp.f_piExtOut, ivasRtp.piData, ivasRtp.nReadPiData, numObj ); -#endif } } -#ifdef IVAS_RTPDUMP else if ( decodedGoodFrame ) { srInfo.bitrateKbps = splitRendBits->bits_written * 1000 / splitRendBits->codec_frame_size_ms; srInfo.codec = ( splitRendBits->codec == ISAR_SPLIT_REND_CODEC_LC3PLUS ) ? IVAS_SR_TRANSPORT_LC3PLUS : IVAS_SR_TRANSPORT_LCLD; -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE srInfo.codecFrameSizeMs = (uint32_t) splitRendBits->codec_frame_size_ms; -#endif if ( ( error = IVAS_RTP_WriteNextFrame( &srRtp, splitRendBits->bits_buf, &srInfo, (int16_t) splitRendBits->bits_written, false, false ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError %s while pushing SR audio bitstream to RTP pack\n", ivas_error_to_string( error ) ); @@ -3812,7 +3419,6 @@ static ivas_error decodeVoIP( splitRendBits->bits_written = 0; splitRendBits->bits_read = 0; } -#endif vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len; if ( vec_pos_update == 0 ) @@ -3844,11 +3450,7 @@ static ivas_error decodeVoIP( goto cleanup; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( nSamplesFlushed && !isSplitCoded ) -#else - if ( nSamplesFlushed ) -#endif { /* Write current frame */ if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, nSamplesFlushed * nOutChannels ) ) != IVAS_ERR_OK ) @@ -3910,10 +3512,8 @@ static ivas_error decodeVoIP( goto cleanup; } } -#ifdef IVAS_RTPDUMP IVAS_RTP_WriteExtPiData( ivasRtp.f_piExtOut, ivasRtp.piData, ivasRtp.nReadPiData, numObj ); -#endif } } @@ -3923,18 +3523,14 @@ static ivas_error decodeVoIP( memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP if ( afWriter != NULL ) { -#endif if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP } -#endif /*------------------------------------------------------------------------------------------* * Printouts after decoding has finished @@ -3967,10 +3563,8 @@ static ivas_error decodeVoIP( { fprintf( stdout, "\nOutput MASA metadata file: %s\n", MasaFileWriter_getFilePath( masaWriter ) ); } -#ifdef IVAS_RTPDUMP fprintf( stdout, "\nOutput PI data file: %s\n", IVAS_RTP_GetExtPiFilePath( &ivasRtp ) ); -#endif } /*------------------------------------------------------------------------------------------* @@ -3981,16 +3575,10 @@ static ivas_error decodeVoIP( cleanup: -#ifdef IVAS_RTPDUMP IVAS_RTP_Term( &srRtp ); IVAS_RTP_Term( &ivasRtp ); -#else - EVS_RTPDUMP_DEPACKER_close( &rtpdumpDepacker ); -#endif AudioFileWriter_close( &afWriter ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP split_rend_reader_writer_close( &splitRendWriter ); -#endif JbmOffsetFileWriter_close( &jbmOffsetWriter ); #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriter_close( &jbmTraceWriter ); @@ -4041,11 +3629,7 @@ static void do_object_editing_fx( if ( readInfo->bg_gain_edited ) { -#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE editableParameters->gain_bed_fx = (Word32) ( readInfo->bg_gain * 536870912 ); /* Q29 */ -#else - editableParameters->gain_bed_fx = (Word32) readInfo->bg_gain * 536870912; /* Q29 */ -#endif } for ( obj_idx = 0; obj_idx < editableParameters->num_obj; obj_idx++ ) @@ -4058,19 +3642,11 @@ static void do_object_editing_fx( if ( readInfo->obj_azi_relative[obj_idx] ) { /* azimuth: apply relative edit + wrap */ -#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE editableParameters->ism_metadata[obj_idx].azimuth_fx = ( ( editableParameters->ism_metadata[obj_idx].azimuth_fx + (Word32) ( readInfo->obj_azi[obj_idx] * 4194304 ) + 2264924160 ) % 1509949440 ) - 754974720; /* Q22 */ -#else - editableParameters->ism_metadata[obj_idx].azimuth_fx = ( ( editableParameters->ism_metadata[obj_idx].azimuth_fx + (Word32) readInfo->obj_azi[obj_idx] * 4194304 + 2264924160 ) % 1509949440 ) - 754974720; /* Q22 */ -#endif } else { -#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE editableParameters->ism_metadata[obj_idx].azimuth_fx = (Word32) ( readInfo->obj_azi[obj_idx] * 4194304 ); /* Q22 */ -#else - editableParameters->ism_metadata[obj_idx].azimuth_fx = (Word32) readInfo->obj_azi[obj_idx] * 4194304; /* Q22 */ -#endif } } if ( readInfo->obj_ele_edited[obj_idx] ) @@ -4078,22 +3654,13 @@ static void do_object_editing_fx( if ( readInfo->obj_ele_relative[obj_idx] ) { /* elevation: apply relative edit + saturation */ -#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE editableParameters->ism_metadata[obj_idx].elevation_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].elevation_fx + (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ), 377487360 ), -377487360 ); /* Q22 */ -#else - editableParameters->ism_metadata[obj_idx].elevation_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].elevation_fx + (Word32) readInfo->obj_ele[obj_idx] * 4194304, 377487360 ), -377487360 ); /* Q22 */ -#endif } else { -#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) ( readInfo->obj_ele[obj_idx] * 4194304 ); /* Q22 */ -#else - editableParameters->ism_metadata[obj_idx].elevation_fx = (Word32) readInfo->obj_ele[obj_idx] * 4194304; /* Q22 */ -#endif } } -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA /* object direction editing only for diegetic objects */ if ( readInfo->obj_yaw_edited[obj_idx] ) { @@ -4143,7 +3710,6 @@ static void do_object_editing_fx( editableParameters->ism_metadata[obj_idx].radius_fx = (Word16) ( readInfo->obj_radius[obj_idx] * 512 ); /* Q9 */ } } -#endif } /* gain editing for all objects */ @@ -4152,23 +3718,11 @@ static void do_object_editing_fx( if ( readInfo->obj_gain_relative[obj_idx] ) { /* gain: apply relative edit + saturation */ -#ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES -#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( L_shl_sat( Mpy_32_32( editableParameters->ism_metadata[obj_idx].gain_fx, (Word32) ( readInfo->obj_gain[obj_idx] * 536870912 ) ), 2 ), OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29*Q29 -> Q27 shift back to Q29 */ -#else - editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( L_shl_sat( Mpy_32_32( editableParameters->ism_metadata[obj_idx].gain_fx, (Word32) readInfo->obj_gain[obj_idx] * 536870912 ), 2 ), OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29*Q29 -> Q27 shift back to Q29 */ -#endif -#else - editableParameters->ism_metadata[obj_idx].gain_fx = L_max( L_min( editableParameters->ism_metadata[obj_idx].gain_fx * (Word32) readInfo->obj_gain[obj_idx] * 536870912, OBJ_EDIT_GAIN_MAX_FX ), OBJ_EDIT_GAIN_MIN_FX ); /* Q29 */ -#endif } else { -#ifdef FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE editableParameters->ism_metadata[obj_idx].gain_fx = (Word32) ( readInfo->obj_gain[obj_idx] * 536870912 ); /* Q29 */ -#else - editableParameters->ism_metadata[obj_idx].gain_fx = (Word32) readInfo->obj_gain[obj_idx] * 536870912; /* Q29 */ -#endif } } } @@ -4377,7 +3931,6 @@ static ivas_error load_hrtf_from_file( return IVAS_ERR_OK; } -#ifdef DECODER_FORMAT_SWITCHING /*---------------------------------------------------------------------* * restartDecoder() @@ -4418,15 +3971,9 @@ static ivas_error restartDecoder( uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : 65535; IVAS_AUDIO_CONFIG outputConfig = ( decMode == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, arg->renderFramesize, arg->customLsOutputEnabled, arg->hrtfReaderEnabled, arg->enableHeadRotation, arg->enableExternalOrientation, arg->orientation_tracking, arg->renderConfigEnabled, arg->roomSize, arg->non_diegetic_pan_enabled, arg->non_diegetic_pan_gain_fx, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, outputConfig, 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_fx, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -4438,24 +3985,6 @@ static ivas_error restartDecoder( goto cleanup; } -#ifndef FIX_SPLIT_RENDERING_ON_DECODER_RESTART - if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - - if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg->renderFramesize ) ) != IVAS_ERR_OK ) - { - fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); - goto cleanup; - } - - arg->enableHeadRotation = true; - } -#endif if ( arg->voipMode ) { @@ -4472,14 +4001,12 @@ static ivas_error restartDecoder( goto cleanup; } -#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART /* ISAR frame size is set from command line, not renderer config file. * This will be ignored if output format is not split rendering. */ if ( renderConfig != NULL ) { renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->renderFramesize /* given in number of 5ms subframes */ * 5; } -#endif if ( arg->renderConfigEnabled && renderConfig != NULL ) { @@ -4507,6 +4034,5 @@ cleanup: return error; } -#endif #undef WMC_TOOL_SKIP diff --git a/apps/encoder.c b/apps/encoder.c index 551eee9af..1eecfdd51 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -44,10 +44,8 @@ #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" -#ifdef IVAS_RTPDUMP #include "rotation_file_reader.h" #include "ivas_rtp_file.h" -#endif #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. @@ -74,13 +72,7 @@ static #endif int32_t frame = 0; /* Counter of frames */ -#ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS #define RANDOM_INITSEED_ENC ( 0xDEAF ) -#else -#ifdef FIXED_RTP_SEQUENCE_NUM -#define RANDOM_INITSEED_ENC ( 0xFEEDDEAF ) -#endif -#endif #define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */ @@ -167,12 +159,10 @@ typedef struct #endif bool pca; bool ism_extended_metadata; -#ifdef IVAS_RTPDUMP bool rtpdumpOutput; uint32_t numFramesPerPacket; char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; -#endif } EncArguments; @@ -216,10 +206,8 @@ int main( MasaFileReader *masaReader = NULL; IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL }; int16_t *pcmBuf = NULL; -#ifdef IVAS_RTPDUMP RotFileReader *sceneOrientationFileReader = NULL; RotFileReader *deviceOrientationFileReader = NULL; -#endif #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif @@ -229,28 +217,15 @@ int main( reset_mem( USE_BYTES ); #endif -#ifdef IVAS_RTPDUMP uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; IVAS_RTP ivasRtp = { 0 }; -#endif -#ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ uint16_t rtpEncSeed = RANDOM_INITSEED_ENC; uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 ); uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed ); -#else -#ifdef FIXED_RTP_SEQUENCE_NUM - /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we - use fixed seed for random num generator for regression based tests. Any realtime - application should implement this initialization seperately */ - srand( RANDOM_INITSEED_ENC ); - uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); - uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); -#endif -#endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments @@ -278,11 +253,7 @@ int main( const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192; -#ifdef IVAS_RTPDUMP if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) -#else - if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename ); goto cleanup; @@ -640,18 +611,13 @@ int main( } } -#ifdef IVAS_RTPDUMP /*------------------------------------------------------------------------------------------* * RTPDump *------------------------------------------------------------------------------------------*/ if ( arg.rtpdumpOutput ) { -#ifdef FIXED_RTP_SEQUENCE_NUM if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_RTP_WRITER_Init( &ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename ); goto cleanup; @@ -683,7 +649,6 @@ int main( goto cleanup; } } -#endif /*------------------------------------------------------------------------------------------* * Run the encoder @@ -853,7 +818,6 @@ int main( } /* *** Encode one frame *** */ -#ifdef IVAS_RTPDUMP if ( ivasRtp.hPack ) { bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO ); @@ -901,11 +865,7 @@ int main( goto cleanup; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_RTP_WriteNextFrame( &ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; @@ -913,7 +873,6 @@ int main( } else { -#endif if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); @@ -926,9 +885,7 @@ int main( fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error ); goto cleanup; } -#ifdef IVAS_RTPDUMP } -#endif frame++; if ( !arg.quietModeEnabled ) @@ -997,7 +954,6 @@ cleanup: fclose( f_bitrateProfile ); } -#ifdef IVAS_RTPDUMP if ( sceneOrientationFileReader ) { RotationFileReader_close( &sceneOrientationFileReader ); @@ -1009,7 +965,6 @@ cleanup: } IVAS_RTP_Term( &ivasRtp ); -#endif IVAS_ENC_Close( &hIvasEnc ); @@ -1066,11 +1021,9 @@ static bool parseCmdlIVAS_enc( arg->mimeOutput = false; arg->ism_extended_metadata = false; arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE; -#ifdef IVAS_RTPDUMP arg->rtpdumpOutput = false; arg->sceneOrientationTrajFileName = NULL; arg->deviceOrientationTrajFileName = NULL; -#endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; @@ -1849,7 +1802,6 @@ static bool parseCmdlIVAS_enc( i++; } -#ifdef IVAS_RTPDUMP /*-----------------------------------------------------------------* * RTPDump output *-----------------------------------------------------------------*/ @@ -1915,7 +1867,6 @@ static bool parseCmdlIVAS_enc( i++; } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -2129,14 +2080,12 @@ static void usage_enc( void ) #endif fprintf( stdout, "-q : Quiet mode, no frame counters\n" ); fprintf( stdout, " default is deactivated\n" ); -#ifdef IVAS_RTPDUMP fprintf( stdout, "-rtpdump : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" ); fprintf( stdout, " bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" ); fprintf( stdout, " writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" ); fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" ); fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" ); fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" ); -#endif fprintf( stdout, "\n" ); return; diff --git a/apps/encoder_fmtsw.c b/apps/encoder_fmtsw.c index 10d81fc2f..9ab7b017b 100644 --- a/apps/encoder_fmtsw.c +++ b/apps/encoder_fmtsw.c @@ -44,10 +44,8 @@ #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "wmc_auto.h" -#ifdef IVAS_RTPDUMP #include "rotation_file_reader.h" #include "ivas_rtp_file.h" -#endif #ifdef DEBUG_FORCE_DIR /* Windows does not define the S_ISREG and S_ISDIR macros in stat.h, so we do. @@ -77,13 +75,7 @@ static #endif int32_t frame = 0; /* Counter of frames */ -#ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS #define RANDOM_INITSEED_ENC ( 0xDEAF ) -#else -#ifdef FIXED_RTP_SEQUENCE_NUM -#define RANDOM_INITSEED_ENC ( 0xFEEDDEAF ) -#endif -#endif #define DEFAULT_FIXED_SID_RATE 8 /* DTX SID rate */ @@ -170,12 +162,10 @@ typedef struct #endif bool pca; bool ism_extended_metadata; -#ifdef IVAS_RTPDUMP bool rtpdumpOutput; uint32_t numFramesPerPacket; char *sceneOrientationTrajFileName; char *deviceOrientationTrajFileName; -#endif } EncArguments; @@ -193,11 +183,7 @@ static ivas_error readForcedMode( FILE *file, IVAS_ENC_FORCED_MODE *forcedMode, static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ); #endif static void str2arg( char *str, int *argc_local, char *argv_local[] ); -#ifdef IVAS_RTPDUMP static int encoder_main( int argc, char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ); -#else -static int encoder_main( int argc, char *argv[] ); -#endif /*------------------------------------------------------------------------------------------* * main() @@ -215,11 +201,9 @@ int main( char line[2048]; int argc_local = 0; char *argv_local[MAX_ARGV] = { 0 }; -#ifdef IVAS_RTPDUMP IVAS_RTP ivasRtp = { 0 }; char prev_outputBitstreamFilename[2048] = { 0 }; int rtp_term = 0; -#endif IVAS_ENC_PrintDisclaimer(); @@ -244,7 +228,6 @@ int main( printf( "Processing format switching commandline: %s\n", line ); str2arg( line, &argc_local, argv_local ); -#ifdef IVAS_RTPDUMP if ( strcmp( argv_local[argc_local - 1], (char *) prev_outputBitstreamFilename ) == 0 ) { /* append to last Rtp file */ @@ -269,9 +252,6 @@ int main( rtp_term = 1; } strcpy( (char *) prev_outputBitstreamFilename, argv_local[argc_local - 1] ); -#else - encoder_main( argc_local, argv_local ); -#endif } /*------------------------------------------------------------------------------------------* @@ -282,9 +262,7 @@ int main( cleanup: -#ifdef IVAS_RTPDUMP IVAS_RTP_Term( &ivasRtp ); -#endif if ( FmtSWFile ) { fclose( FmtSWFile ); @@ -318,13 +296,9 @@ void str2arg( int encoder_main( int argc, -#ifdef IVAS_RTPDUMP char *argv[], IVAS_RTP *ivasRtp, int init_RtpWriter ) -#else - char *argv[] ) -#endif { bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */ EncArguments arg; @@ -341,10 +315,8 @@ int encoder_main( MasaFileReader *masaReader = NULL; IsmFileReader *ismReaders[IVAS_MAX_NUM_OBJECTS] = { NULL, NULL, NULL, NULL }; int16_t *pcmBuf = NULL; -#ifdef IVAS_RTPDUMP RotFileReader *sceneOrientationFileReader = NULL; RotFileReader *deviceOrientationFileReader = NULL; -#endif #ifdef DEBUGGING FILE *f_forcedModeProfile = NULL; #endif @@ -354,28 +326,15 @@ int encoder_main( reset_mem( USE_BYTES ); #endif -#ifdef IVAS_RTPDUMP uint8_t au[IVAS_MAX_BITS_PER_FRAME / 8]; /* IVAS_RTP ivasRtp = { 0 }; */ -#endif -#ifdef NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we use fixed seed for random num generator for regression based tests. Any realtime application should implement this initialization seperately */ uint16_t rtpEncSeed = RANDOM_INITSEED_ENC; uint32_t ssrc = ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) & 0x0000FFFF ) | ( (uint32_t) IVAS_RTP_OwnRandom( &rtpEncSeed ) << 16 ); uint16_t seqNumInitVal = IVAS_RTP_OwnRandom( &rtpEncSeed ); -#else -#ifdef FIXED_RTP_SEQUENCE_NUM - /* Ideally ssrc is negotiated via SDP and sequence number is radomized but we - use fixed seed for random num generator for regression based tests. Any realtime - application should implement this initialization seperately */ - srand( RANDOM_INITSEED_ENC ); - uint32_t ssrc = ( (uint32_t) rand() & 0x0000FFFF ) | ( (uint32_t) rand() << 16 ); - uint16_t seqNumInitVal = (uint16_t) ( rand() & 0xFFFF ); -#endif -#endif /*------------------------------------------------------------------------------------------* * Parse command-line arguments @@ -401,11 +360,7 @@ int encoder_main( const BS_WRITER_FORMAT bsWriterFormat = arg.mimeOutput ? BS_WRITER_FORMAT_MIME : BS_WRITER_FORMAT_G192; -#ifdef IVAS_RTPDUMP if ( !arg.rtpdumpOutput && BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) -#else - if ( BS_Writer_Open_filename( &hBsWriter, arg.outputBitstreamFilename, bsWriterFormat ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nCan't open %s\n\n", arg.outputBitstreamFilename ); goto cleanup; @@ -763,18 +718,13 @@ int encoder_main( } } -#ifdef IVAS_RTPDUMP /*------------------------------------------------------------------------------------------* * RTPDump *------------------------------------------------------------------------------------------*/ if ( arg.rtpdumpOutput && init_RtpWriter ) { -#ifdef FIXED_RTP_SEQUENCE_NUM if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket, ssrc, seqNumInitVal ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_RTP_WRITER_Init( ivasRtp, arg.outputBitstreamFilename, arg.numFramesPerPacket ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError: Can't open output bitstream file for RTP output %s \n\n", arg.outputBitstreamFilename ); goto cleanup; @@ -806,7 +756,6 @@ int encoder_main( goto cleanup; } } -#endif /*------------------------------------------------------------------------------------------* * Run the encoder @@ -976,7 +925,6 @@ int encoder_main( } /* *** Encode one frame *** */ -#ifdef IVAS_RTPDUMP if ( ivasRtp->hPack ) { bool isMono = ( arg.inputFormat == IVAS_ENC_INPUT_MONO ); @@ -1024,11 +972,7 @@ int encoder_main( goto cleanup; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, NULL, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_RTP_WriteNextFrame( ivasRtp, au, numBits, isMono, forcePacket ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError %s while pushing audio frame to RTP pack\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; @@ -1036,7 +980,6 @@ int encoder_main( } else { -#endif if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); @@ -1049,9 +992,7 @@ int encoder_main( fprintf( stderr, "\nBS_Writer_WriteFrame_short failed, error code %d\n\n", error ); goto cleanup; } -#ifdef IVAS_RTPDUMP } -#endif frame++; if ( !arg.quietModeEnabled ) @@ -1120,7 +1061,6 @@ cleanup: fclose( f_bitrateProfile ); } -#ifdef IVAS_RTPDUMP if ( sceneOrientationFileReader ) { RotationFileReader_close( &sceneOrientationFileReader ); @@ -1132,7 +1072,6 @@ cleanup: } /* IVAS_RTP_Term( &ivasRtp ); */ -#endif IVAS_ENC_Close( &hIvasEnc ); @@ -1185,11 +1124,9 @@ static bool parseCmdlIVAS_enc( arg->mimeOutput = false; arg->ism_extended_metadata = false; arg->complexityLevel = IVAS_ENC_COMPLEXITY_LEVEL_THREE; -#ifdef IVAS_RTPDUMP arg->rtpdumpOutput = false; arg->sceneOrientationTrajFileName = NULL; arg->deviceOrientationTrajFileName = NULL; -#endif #ifdef DEBUGGING arg->forcedMode = IVAS_ENC_FORCE_UNFORCED; arg->forcedModeFile = NULL; @@ -1968,7 +1905,6 @@ static bool parseCmdlIVAS_enc( i++; } -#ifdef IVAS_RTPDUMP /*-----------------------------------------------------------------* * RTPDump output *-----------------------------------------------------------------*/ @@ -2032,7 +1968,6 @@ static bool parseCmdlIVAS_enc( i++; } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -2246,14 +2181,12 @@ static void usage_enc( void ) #endif fprintf( stdout, "-q : Quiet mode, no frame counters\n" ); fprintf( stdout, " default is deactivated\n" ); -#ifdef IVAS_RTPDUMP fprintf( stdout, "-rtpdump : RTPDump output, hf_only=1 by default. The encoder will packetize the \n" ); fprintf( stdout, " bitstream frames into TS26.253 Annex A IVAS RTP Payload Format packets and \n" ); fprintf( stdout, " writes those to the output file. In EVS mono operating mode, TS26.445 Annex A.2.2 \n" ); fprintf( stdout, " EVS RTP Payload Format is used. Optional N represents number of frames per RTP packet\n" ); fprintf( stdout, "-scene_orientation : Scene orientation trajectory file. Only used with rtpdump output.\n" ); fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" ); -#endif fprintf( stdout, "\n" ); return; diff --git a/apps/isar_post_rend.c b/apps/isar_post_rend.c index a2933f432..63877b4e6 100644 --- a/apps/isar_post_rend.c +++ b/apps/isar_post_rend.c @@ -47,9 +47,7 @@ #endif #include "stl.h" #include "wmc_auto.h" -#ifdef RTP_S4_251135_CR26253_0016_REV1 #include "ivas_rtp_file.h" -#endif #define WMC_TOOL_SKIP @@ -82,9 +80,7 @@ static typedef struct { -#ifdef RTP_S4_251135_CR26253_0016_REV1 bool srRtp; -#endif IVAS_AUDIO_CONFIG audioConfig; int32_t inputChannelIndex; float gain_dB; @@ -106,9 +102,7 @@ typedef struct char executableName[POST_REND_MAX_CLI_ARG_LENGTH]; char inputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; char outputFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; -#ifdef RTP_S4_251135_CR26253_0016_REV1 char srParamsFilePath[POST_REND_MAX_CLI_ARG_LENGTH]; -#endif int32_t sampleRate; InputConfig inConfig; OutputConfig outConfig; @@ -138,9 +132,7 @@ typedef enum CmdLnOptionId_listFormats, CmdLnOptionId_SplitRendBFIFile, CmdLnOptionId_framing, -#ifdef RTP_S4_251135_CR26253_0016_REV1 CmdLnOptionId_srParamsFile, -#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -216,14 +208,12 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "fr", .description = "Set Render audio framing.", }, -#ifdef RTP_S4_251135_CR26253_0016_REV1 { .id = CmdLnOptionId_srParamsFile, .match = "sr_params", .matchShort = "s", .description = "Path to the split rendering init params file", }, -#endif }; @@ -235,11 +225,7 @@ static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_ static void printSupportedAudioConfigs( void ); -#ifdef RTP_S4_251135_CR26253_0016_REV1 static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString, bool *srRtp ); -#else -static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); -#endif static void convertOutputBuffer( const Word32 *fixedBuffer, Word16 q, const int16_t numSamplesPerChannel, const int16_t numChannels, int16_t *intBuffer ); @@ -327,20 +313,14 @@ static bool parseInConfig( } /* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 bool srRtp = false; IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr, &srRtp ); -#else - IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr ); -#endif switch ( audioConfig ) { case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: inConfig->numBinBuses = 1; -#ifdef RTP_S4_251135_CR26253_0016_REV1 inConfig->binBuses[0].srRtp = srRtp; -#endif inConfig->binBuses[0].audioConfig = audioConfig; inConfig->binBuses[0].inputChannelIndex = 0; inConfig->binBuses[0].gain_dB = 0.0f; @@ -391,19 +371,13 @@ static bool parseRenderFramesize( static IVAS_AUDIO_CONFIG parseAudioConfig( -#ifdef RTP_S4_251135_CR26253_0016_REV1 const char *configString, bool *srRtp ) -#else - const char *configString ) -#endif { char charBuf[25]; charBuf[24] = '\0'; -#ifdef RTP_S4_251135_CR26253_0016_REV1 *srRtp = false; -#endif strncpy( charBuf, configString, sizeof( charBuf ) - 1 ); charBuf[sizeof( charBuf ) - 1] = '\0'; to_upper( charBuf ); @@ -420,13 +394,11 @@ static IVAS_AUDIO_CONFIG parseAudioConfig( { return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( strcmp( charBuf, "RTPDUMP" ) == 0 ) { *srRtp = true; return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } -#endif return IVAS_AUDIO_CONFIG_INVALID; } @@ -483,9 +455,7 @@ static CmdlnArgs defaultArgs( strncpy( args.executableName, executableName, POST_REND_MAX_CLI_ARG_LENGTH ); clearString( args.inputFilePath ); clearString( args.outputFilePath ); -#ifdef RTP_S4_251135_CR26253_0016_REV1 clearString( args.srParamsFilePath ); -#endif args.sampleRate = 0; args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; @@ -593,12 +563,10 @@ static void parseOption( } break; -#ifdef RTP_S4_251135_CR26253_0016_REV1 case CmdLnOptionId_srParamsFile: assert( numOptionValues == 1 ); strncpy( args->srParamsFilePath, optionValues[0], POST_REND_MAX_CLI_ARG_LENGTH - 1 ); break; -#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; @@ -635,9 +603,7 @@ static void printSupportedAudioConfigs( void ) "BINAURAL (output only)", "BINAURAL_SPLIT_PCM", "BINAURAL_SPLIT_CODED", -#ifdef RTP_S4_251135_CR26253_0016_REV1 "RTPDUMP", -#endif }; fprintf( stdout, "Supported audio formats:\n" ); @@ -729,7 +695,6 @@ static void convertOutputBuffer( return; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 static void trim( char *str ) { char c; @@ -749,9 +714,7 @@ static void trim( char *str ) static ivas_error parseSRParamsFile( const char *srParamsFilePath, -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE const char *rtpFilePath, -#endif ISAR_SPLIT_REND_CODEC *codec, ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, int16_t *codec_frame_size_ms, @@ -778,7 +741,6 @@ static ivas_error parseSRParamsFile( trim( key ); trim( value ); -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE if ( 0 == strncmp( key, "DOF", 3 ) ) { int val = atoi( value ); @@ -795,51 +757,11 @@ static ivas_error parseSRParamsFile( *lc3plusHighRes = (int16_t) val; } } -#else - if ( 0 == strncmp( key, "CODEC", 5 ) ) - { - *codec = ( 0 == strncmp( value, "LCLD", 4 ) ) ? ISAR_SPLIT_REND_CODEC_LCLD : *codec; - *codec = ( 0 == strncmp( value, "LC3PLUS", 7 ) ) ? ISAR_SPLIT_REND_CODEC_LC3PLUS : *codec; - } - else if ( 0 == strncmp( key, "DOF", 3 ) ) - { - int val = atoi( value ); - if ( val == 0 || val == 1 ) - { - *poseCorrection = ( val == 0 ) ? ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE : ISAR_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB; - } - } - else if ( 0 == strncmp( key, "FRAMESIZE", 9 ) ) - { - int val = atoi( value ); - if ( val == 5 || val == 10 || val == 20 ) - { - *codec_frame_size_ms = (int16_t) val; - } - } - else if ( 0 == strncmp( key, "RENDERSIZE", 9 ) ) - { - int val = atoi( value ); - if ( val == 5 || val == 10 || val == 20 ) - { - *isar_frame_size_ms = (int16_t) val; - } - } - else if ( 0 == strncmp( key, "LC3PLUS_HIGHRES", 15 ) ) - { - int val = atoi( value ); - if ( val == 0 || val == 1 ) - { - *lc3plusHighRes = (int16_t) val; - } - } -#endif } } fclose( fParamSR ); -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE { /* Peek the RTP stream to ascertain the codec and codec_frame_size */ ivas_error error = IVAS_ERR_OK; @@ -877,11 +799,9 @@ static ivas_error parseSRParamsFile( } IVAS_RTP_Term( &srRtp ); } -#endif return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------------------------* @@ -923,9 +843,7 @@ int main( int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; bool splitBinNeedsNewFrame = true; -#ifdef RTP_S4_251135_CR26253_0016_REV1 IVAS_RTP srRTP = { 0 }; -#endif #ifdef WMOPS reset_wmops(); @@ -955,9 +873,7 @@ int main( convert_backslash( args.inputFilePath ); convert_backslash( args.outputFilePath ); convert_backslash( args.headRotationFilePath ); -#ifdef RTP_S4_251135_CR26253_0016_REV1 convert_backslash( args.srParamsFilePath ); -#endif /*------------------------------------------------------------------------------------------* * Open head-rotation file @@ -1008,13 +924,10 @@ int main( } } -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].srRtp ) ) { error = parseSRParamsFile( args.srParamsFilePath, -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE args.inputFilePath, -#endif &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, @@ -1026,28 +939,18 @@ int main( goto cleanup; } -#ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE - if ( ( error = IVAS_RTP_READER_Init( &srRTP, (uint32_t) bitsBuffer.config.codec_frame_size_ms, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK ) -#else if ( ( error = IVAS_RTP_READER_Init( &srRTP, args.inputFilePath, NULL, false, NULL ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "error in IVAS_RTP_READER_Init(): %d\n", error ); goto cleanup; } audioReader = NULL; -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE /* Force owerwrite of command line provided rendersize to align with codec frame size */ args.render_framesize = bitsBuffer.config.isar_frame_size_ms / 5; -#endif } /*if split renderer is running in post renderer mode*/ else if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) -#else - /*if split renderer is running in post renderer mode*/ - if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) -#endif { error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath, @@ -1254,7 +1157,6 @@ int main( num_in_channels = inBuffer.config.numChannels; numSamplesRead = 0; -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( srRTP.hRtpFile && splitBinNeedsNewFrame ) { IVAS_RTP_SR_INFO srInfo = { 0 }; @@ -1277,9 +1179,7 @@ int main( if ( error == IVAS_ERR_END_OF_FILE ) { numSamplesRead = 0; -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE break; -#endif } else { @@ -1301,9 +1201,6 @@ int main( } } else if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) -#else - if ( ( hSplitRendFileReadWrite != NULL ) && splitBinNeedsNewFrame ) -#endif { ivas_error error_tmp; numSamplesRead = (int16_t) inBufferSize; @@ -1416,7 +1313,6 @@ int main( goto cleanup; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /* Set BFI if frame is empty */ int16_t frameEmpty = (int16_t) ( bitsBuffer.config.bitsWritten == 0 ); if ( frameEmpty ) @@ -1427,7 +1323,6 @@ int main( goto cleanup; } } -#endif } } diff --git a/apps/renderer.c b/apps/renderer.c index 22af62baa..7137efd83 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -46,9 +46,7 @@ #include "masa_file_writer.h" #include "render_config_reader.h" #include "rotation_file_reader.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION #include "aeid_file_reader.h" -#endif #include "split_render_file_read_write.h" #include "split_rend_bfi_file_reader.h" #include "vector3_pair_file_reader.h" @@ -198,9 +196,7 @@ typedef struct IVAS_RENDER_FRAMESIZE render_framesize; uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS]; AcousticEnvironmentSequence aeSequence; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE IVAS_ROOM_SIZE_T reverbRoomSize; -#endif } CmdlnArgs; typedef enum @@ -231,12 +227,8 @@ typedef enum CmdLnOptionId_framing, CmdLnOptionId_syncMdDelay, CmdLnOptionId_directivityPatternId, -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE CmdLnOptionId_acousticEnvironmentId, CmdLnOptionId_roomSize, -#else - CmdLnOptionId_acousticEnvironmentId -#endif } CmdLnOptionId; static const CmdLnParser_Option cliOptions[] = { @@ -400,20 +392,14 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_acousticEnvironmentId, .match = "acoustic_environment_id", .matchShort = "aeid", -#ifdef FIX_1053_REVERB_RECONFIGURATION .description = "Acoustic environment ID (number > 0) alternatively, it can be a text file where each line contains \"ID duration\" for BINAURAL_ROOM_REVERB output configuration.", -#else - .description = "Acoustic environment ID( number > 0 ) 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.", -#endif }, -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE { .id = CmdLnOptionId_roomSize, .match = "room_size", .matchShort = "rsz", .description = "Selects default reverb based on a room size (S - small | M - medium | L - large)", } -#endif }; @@ -818,9 +804,7 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; uint16_t aeID; -#ifdef FIX_1053_REVERB_RECONFIGURATION IVAS_RENDER_CONFIG_DATA renderConfig; -#endif ivas_error error = IVAS_ERR_OK; #ifdef WMOPS @@ -1184,9 +1168,6 @@ int main( if ( args.renderConfigFilePath[0] != '\0' ) { -#ifndef FIX_1053_REVERB_RECONFIGURATION - IVAS_RENDER_CONFIG_DATA renderConfig; -#endif /* sanity check */ if ( ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL ) && @@ -1258,7 +1239,6 @@ int main( goto cleanup; } -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE /* Set reverb room size if specified */ if ( args.reverbRoomSize != IVAS_ROOM_SIZE_AUTO ) @@ -1269,7 +1249,6 @@ int main( goto cleanup; } } -#endif /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) @@ -1553,16 +1532,12 @@ int main( audioWriter = NULL; } -#ifdef FIX_1437_LC3PLUS_EXTREND_HIRES if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms, &bitsBuffer.config.lc3plus_highres ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_GetSplitRendBitstreamHeader( hIvasRend, &bitsBuffer.config.codec, &bitsBuffer.config.poseCorrection, &bitsBuffer.config.codec_frame_size_ms, &bitsBuffer.config.isar_frame_size_ms ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nError in IVAS_REND_GetSplitRendBitstreamHeader(): %s!\n", ivas_error_to_string( error ) ); goto cleanup; @@ -1687,9 +1662,6 @@ int main( { if ( ++args.aeSequence.frameCounter >= args.aeSequence.pValidity[args.aeSequence.selected] ) { -#ifndef FIX_1053_REVERB_RECONFIGURATION - IVAS_RENDER_CONFIG_DATA renderConfig; -#endif if ( ++args.aeSequence.selected >= args.aeSequence.count ) { args.aeSequence.selected = 0; @@ -2665,7 +2637,6 @@ static bool parseAcousticEnvironmentIds( const char *value, AcousticEnvironmentSequence *aeSequence ) { -#ifdef FIX_1053_REVERB_RECONFIGURATION char config_string[RENDERER_MAX_METADATA_LINE_LENGTH]; strncpy( config_string, value, RENDERER_MAX_METADATA_LINE_LENGTH ); if ( !is_digits_only( config_string ) ) @@ -2683,72 +2654,6 @@ static bool parseAcousticEnvironmentIds( } aeidFileReader_close( &aeidReader ); } -#else - uint16_t k; - char config_string[RENDERER_MAX_METADATA_LINE_LENGTH]; - char *s; - char *token; - - strncpy( config_string, value, RENDERER_MAX_METADATA_LINE_LENGTH ); - s = config_string; - token = config_string; - - if ( !is_digits_only( config_string ) ) - { - - for ( k = 0; s[k]; ) - { - s[k] == ',' ? k++ : *s++; - } - k++; - - if ( k == 0 ) - { - fprintf( stdout, "Error: Invalid acoustic environment sequence specified: %s\n\n", config_string ); - return false; - } - - if ( NULL == ( aeSequence->pID = malloc( sizeof( uint16_t ) * k ) ) || - NULL == ( aeSequence->pValidity = malloc( sizeof( uint16_t ) * k ) ) ) - { - fprintf( stdout, "Error: Unable to allocate memory for acoustic environment sequence: %s\n\n", config_string ); - return false; - } - - aeSequence->count = k; - - k = 0; - - token = strtok( config_string, ":" ); - - while ( token != NULL ) - { - if ( !is_number( token ) ) - { - fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, config_string ); - return false; - } - aeSequence->pID[k] = (uint16_t) atoi( token ); - - token = strtok( NULL, "," ); - if ( !is_number( token ) ) - { - fprintf( stdout, "Error: Invalid token %s found in acoustic environment sequence: %s\n\n", token, config_string ); - return false; - } - aeSequence->pValidity[k] = (uint16_t) atoi( token ); - - token = strtok( NULL, ":" ); - k++; - } - - if ( k != aeSequence->count ) - { - fprintf( stdout, "Error while parsing acoustic environment sequence: %s\n\n", config_string ); - return false; - } - } -#endif else { /* A single acoustic environment */ @@ -2765,7 +2670,6 @@ static bool parseAcousticEnvironmentIds( return true; } -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE static bool parseReverbRoomSize( @@ -2797,7 +2701,6 @@ static bool parseReverbRoomSize( return true; } -#endif static bool checkRequiredArgs( @@ -2919,10 +2822,8 @@ static CmdlnArgs defaultArgs( args.aeSequence.pValidity = NULL; args.aeSequence.selected = 0; args.aeSequence.frameCounter = 0; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE args.reverbRoomSize = IVAS_ROOM_SIZE_AUTO; -#endif return args; } @@ -3104,7 +3005,6 @@ static void parseOption( /* Metadata Delay to sync with audio delay in ms */ args->syncMdDelay = (int16_t) strtol( optionValues[0], NULL, 10 ); break; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE case CmdLnOptionId_roomSize: assert( numOptionValues == 1 ); if ( !parseReverbRoomSize( optionValues[0], &args->reverbRoomSize ) ) @@ -3113,7 +3013,6 @@ static void parseOption( exit( -1 ); } break; -#endif default: assert( 0 && "This should be unreachable - all command line options should be explicitly handled." ); break; @@ -3208,25 +3107,11 @@ void getMetadataFromFileReader( fprintf( stderr, "\nError (%s) while reading ISM metadata from: %s\n\n", ivas_error_to_string( error ), IsmFileReader_getFilePath( ismReader ) ); exit( -1 ); } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS objectMetadataBuffer->positions[objIdx].azimuth_fx = ismMetadata.azimuth_fx; objectMetadataBuffer->positions[objIdx].elevation_fx = ismMetadata.elevation_fx; objectMetadataBuffer->positions[objIdx].radius_fx = ismMetadata.radius_fx; objectMetadataBuffer->positions[objIdx].yaw_fx = ismMetadata.yaw_fx; objectMetadataBuffer->positions[objIdx].pitch_fx = ismMetadata.pitch_fx; -#else - objectMetadataBuffer->positions[objIdx].azimuth_fx = (Word32) ( ismMetadata.azimuth * ( 1 << 22 ) ); - objectMetadataBuffer->positions[objIdx].elevation_fx = (Word32) ( ismMetadata.elevation * ( 1 << 22 ) ); - objectMetadataBuffer->positions[objIdx].radius_fx = (Word16) ( ismMetadata.radius * ( 1 << 9 ) ); - objectMetadataBuffer->positions[objIdx].yaw_fx = (Word32) ( ismMetadata.yaw * ( 1 << 22 ) ); - objectMetadataBuffer->positions[objIdx].pitch_fx = (Word32) ( ismMetadata.pitch * ( 1 << 22 ) ); - - objectMetadataBuffer->positions[objIdx].azimuth = ismMetadata.azimuth; - objectMetadataBuffer->positions[objIdx].elevation = ismMetadata.elevation; - objectMetadataBuffer->positions[objIdx].radius = ismMetadata.radius; - objectMetadataBuffer->positions[objIdx].yaw = ismMetadata.yaw; - objectMetadataBuffer->positions[objIdx].pitch = ismMetadata.pitch; -#endif objectMetadataBuffer->positions[objIdx].non_diegetic_flag = ismMetadata.non_diegetic_flag; return; @@ -3280,25 +3165,15 @@ static void IsmPositionProvider_getNextFrame( /* Otherwise fall back to default position */ else { -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS objectMetadataBuffer->positions[objIdx].azimuth_fx = 0; objectMetadataBuffer->positions[objIdx].elevation_fx = 0; objectMetadataBuffer->positions[objIdx].radius_fx = 512; // 1.f in Q9 objectMetadataBuffer->positions[objIdx].yaw_fx = 0; objectMetadataBuffer->positions[objIdx].pitch_fx = 0; objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0; -#else - objectMetadataBuffer->positions[objIdx].azimuth = 0.0f; - objectMetadataBuffer->positions[objIdx].elevation = 0.0f; - objectMetadataBuffer->positions[objIdx].radius = 1.0f; - objectMetadataBuffer->positions[objIdx].yaw = 0.0f; - objectMetadataBuffer->positions[objIdx].pitch = 0.0f; - objectMetadataBuffer->positions[objIdx].non_diegetic_flag = 0; -#endif } /* Wrap azimuth to lie within (-180, 180] range */ -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS while ( LT_32( objectMetadataBuffer->positions[objIdx].azimuth_fx, 0 ) ) { objectMetadataBuffer->positions[objIdx].azimuth_fx = L_add( objectMetadataBuffer->positions[objIdx].azimuth_fx, DEG_360_IN_Q22 ); @@ -3323,35 +3198,6 @@ static void IsmPositionProvider_getNextFrame( /* Clamp pitch to lie within [-90, 90] range (can't be wrapped easily) */ objectMetadataBuffer->positions[objIdx].pitch_fx = L_min( L_max( objectMetadataBuffer->positions[objIdx].pitch_fx, -DEG_90_IN_Q22 ), DEG_90_IN_Q22 ); -#else - while ( objectMetadataBuffer->positions[objIdx].azimuth < 0.0f ) - { - objectMetadataBuffer->positions[objIdx].azimuth += 360.0f; - } - while ( objectMetadataBuffer->positions[objIdx].azimuth >= 360.0f ) - { - objectMetadataBuffer->positions[objIdx].azimuth -= 360.0f; - } - - /* Clamp elevation to lie within [-90, 90] range (can't be wrapped easily) */ - objectMetadataBuffer->positions[objIdx].elevation = min( max( objectMetadataBuffer->positions[objIdx].elevation, -90 ), 90 ); - objectMetadataBuffer->positions[objIdx].azimuth_fx = (Word32) ( objectMetadataBuffer->positions[objIdx].azimuth * ( 1 << 22 ) ); - objectMetadataBuffer->positions[objIdx].elevation_fx = (Word32) ( objectMetadataBuffer->positions[objIdx].elevation * ( 1 << 22 ) ); - /* Wrap yaw to lie within (-180, 180] range */ - while ( objectMetadataBuffer->positions[objIdx].yaw < 0.0f ) - { - objectMetadataBuffer->positions[objIdx].yaw += 360.0f; - } - while ( objectMetadataBuffer->positions[objIdx].yaw >= 360.0f ) - { - objectMetadataBuffer->positions[objIdx].yaw -= 360.0f; - } - - /* Clamp pitch to lie within [-90, 90] range (can't be wrapped easily) */ - objectMetadataBuffer->positions[objIdx].pitch = min( max( objectMetadataBuffer->positions[objIdx].pitch, -90 ), 90 ); - objectMetadataBuffer->positions[objIdx].yaw_fx = (Word32) ( ( objectMetadataBuffer->positions[objIdx].yaw ) * ( 1 << Q22 ) ); - objectMetadataBuffer->positions[objIdx].pitch_fx = (Word32) ( ( objectMetadataBuffer->positions[objIdx].pitch ) * ( 1 << Q22 ) ); -#endif } ++positionProvider->frameCounter; @@ -3657,23 +3503,12 @@ static void parseObjectPosition( exit( -1 ); } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS position->azimuth_fx = (Word32) ( meta_prm[0] * ( 1 << Q22 ) ); /* Q22 */ position->elevation_fx = (Word32) ( meta_prm[1] * ( 1 << Q22 ) ); /* Q22 */ position->radius_fx = (Word16) ( meta_prm[2] * ( 1 << Q9 ) ); /* Q9 */ position->yaw_fx = (Word32) ( meta_prm[5] * ( 1 << Q22 ) ); /* Q22 */ position->pitch_fx = (Word32) ( meta_prm[6] * ( 1 << Q22 ) ); /* Q22 */ position->non_diegetic_flag = (Word16) meta_prm[7]; -#else - position->azimuth = meta_prm[0]; - position->elevation = meta_prm[1]; - position->azimuth_fx = (Word32) ( meta_prm[0] * ( 1 << 22 ) ); - position->elevation_fx = (Word32) ( meta_prm[1] * ( 1 << 22 ) ); - position->radius = meta_prm[2]; - position->yaw = meta_prm[5]; - position->pitch = meta_prm[6]; - position->non_diegetic_flag = (int16_t) meta_prm[7]; -#endif return; } diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 3a0a72bc3..b116ef6c7 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -987,59 +987,6 @@ Word32 div_w( Word32 L_num, Word32 L_den ) } } -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence -Word32 BASOP_Util_Divide3232_Scale_cadence( Word32 x, Word32 y, Word16 *s ) -{ - Word32 z; - Word16 sx; - Word16 sy; - Word32 sign; - - /* assert (x >= (Word32)0); */ - assert( y != (Word32) 0 ); - - sign = 0; - move16(); - - IF( x < 0 ) - { - x = L_negate( x ); - sign = L_xor( sign, 1 ); - } - - IF( y < 0 ) - { - y = L_negate( y ); - sign = L_xor( sign, 1 ); - } - - IF( x == (Word32) 0 ) - { - *s = 0; - return ( (Word32) 0 ); - } - - sx = norm_l( x ); - x = L_shl( x, sx ); - x = L_shr( x, 1 ); - move16(); - *s = sub( 1, sx ); - - sy = norm_l( y ); - y = L_shl( y, sy ); - move16(); - *s = add( *s, sy ); - - z = div_w( x, y ); - - if ( sign != 0 ) - { - z = L_negate( z ); - } - - return z; -} -#endif Word32 div_w_newton( Word32 num, Word32 den ); /* @@ -2565,7 +2512,6 @@ Word16 BASOP_Util_Cmp_Mant32Exp /*!< o: flag: result of comparison */ headroom is introduced into acc */ -#ifdef OPT_2146_BASOP_UTIL_ADD_MANT32EXP Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ ( Word32 a_m, /* i : Mantissa of 1st operand a */ Word16 a_e, /* i : Exponent of 1st operand a */ @@ -2629,65 +2575,6 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ return ( a_m ); } -#else -Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */ - ( Word32 a_m, /* i : Mantissa of 1st operand a */ - Word16 a_e, /* i : Exponent of 1st operand a */ - Word32 b_m, /* i : Mantissa of 2nd operand b */ - Word16 b_e, /* i : Exponent of 2nd operand b */ - Word16 *ptr_e ) /* o : exponent of result */ -{ - Word32 L_tmp; - Word16 shift; - - /* Compare exponents: the difference is limited to +/- 30 - The Word32 mantissa of the operand with lower exponent is shifted right by the exponent difference. - Then, the unshifted mantissa of the operand with the higher exponent is added. The addition result - is normalized and the result represents the mantissa to return. The returned exponent takes into - account all shift operations. - */ - if ( !a_m ) - { - a_e = b_e; - move16(); - } - - if ( !b_m ) - { - b_e = a_e; - move16(); - } - - shift = sub( a_e, b_e ); - shift = s_max( -31, shift ); - shift = s_min( 31, shift ); - if ( shift < 0 ) - { - /* exponent of b is greater than exponent of a, shr a_m */ - a_m = L_shl( a_m, shift ); - } - if ( shift > 0 ) - { - /* exponent of a is greater than exponent of b */ - b_m = L_shr( b_m, shift ); - } - a_e = add( s_max( a_e, b_e ), 1 ); - L_tmp = L_add( L_shr( a_m, 1 ), L_shr( b_m, 1 ) ); - shift = norm_l( L_tmp ); - if ( shift ) - L_tmp = L_shl( L_tmp, shift ); - if ( L_tmp == 0 ) - { - a_e = 0; - move16(); - } - if ( L_tmp != 0 ) - a_e = sub( a_e, shift ); - *ptr_e = a_e; - - return ( L_tmp ); -} -#endif static const Word16 shift_lc[] = { 9, 10 }; diff --git a/lib_com/basop_util.h b/lib_com/basop_util.h index 7929db932..1df2c8010 100644 --- a/lib_com/basop_util.h +++ b/lib_com/basop_util.h @@ -328,12 +328,6 @@ Word16 BASOP_Util_Divide3232_Scale( Word32 x, /*!< i : Numerator*/ Word32 y, /*!< i : Denominator*/ Word16 *s ); /*!< o : Additional scalefactor difference*/ -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence -Word32 BASOP_Util_Divide3232_Scale_cadence( Word32 x, /*!< i : Numerator*/ - Word32 y, /*!< i : Denominator*/ - Word16 *s ); /*!< o : Additional scalefactor difference*/ -#endif - Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, /*!< i : Numerator*/ Word32 y, /*!< i : Denominator*/ diff --git a/lib_com/bitstream_fx.c b/lib_com/bitstream_fx.c index 5979c1030..030c4746d 100644 --- a/lib_com/bitstream_fx.c +++ b/lib_com/bitstream_fx.c @@ -3839,7 +3839,6 @@ ivas_error write_indices_ivas_fx( return error; } -#ifdef IVAS_RTPDUMP /*---------------------------------------------------------------------* @@ -3900,7 +3899,6 @@ void convertSerialToBytestream_fx( return; } -#endif /*-------------------------------------------------------------------* @@ -5296,23 +5294,3 @@ void evs_dec_previewFrame( return; } - -#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG -void dtx_read_padding_bits_fx( - DEC_CORE_HANDLE st, - const Word16 num_bits ) -{ - /* TODO: temporary hack, need to decide what to do with core-coder bitrate */ - Word32 tmp; - - tmp = st->total_brate; - move32(); - st->total_brate = L_add( st->total_brate, L_mult0( num_bits, FRAMES_PER_SEC ) ); - move32(); - get_next_indice_fx( st, num_bits ); - st->total_brate = tmp; - move32(); - - return; -} -#endif diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 03bcc42b8..320cac081 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -2790,9 +2790,7 @@ enum #define LOG2_10 27213 /* log base 2 of 10 in Q12 */ #define LOG2_10_Q29 1783446566 /* log base 2 of 10 in Q12 */ #define LOG10_2_Q31 646456993 /* inverse log base 10 of 2 in Q31 */ -#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA #define INV_LOG2_10 9864 /* 1/log2(10), Q15*/ -#endif #define MU_MA_FX 10923 /* original prediction factor for the AMR WB tables (Q15) */ #define E_MIN_FXQ15 115 /* Q15*/ diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 27290eb18..c411a1be0 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -62,9 +62,7 @@ #define IVAS_REVERB_PREDELAY_MAX 20 /* Max input delay for reverb module */ #define IVAS_ER_LIST_HEIGHT 1.6f #define IVAS_ER_LIST_HEIGHT_FX 6710886 /* 1.6f in Q.22 */ -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT -#define IVAS_DEFAULT_AEID 65535 -#endif +#define IVAS_DEFAULT_AEID 65535 /* JBM constants for adaptive-playout */ #define IVAS_TIME_SCALE_MIN 50 /* min. time-scaling [%] */ @@ -135,15 +133,6 @@ typedef struct _IVAS_ISM_METADATA Word32 gainFactor_fx; /* Q29 */ Word32 yaw_fx; /* Q22 */ Word32 pitch_fx; /* Q22 */ -#ifndef FIX_2084_FLOATING_POINT_LEFTOVERS - float azimuth; - float elevation; - float radius; - float spread; - float gainFactor; - float yaw; - float pitch; -#endif Word16 non_diegetic_flag; Word32 gain_fx; /* Q29 */ @@ -192,7 +181,6 @@ typedef enum } IVAS_RENDER_FRAMESIZE; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE typedef enum { IVAS_ROOM_SIZE_AUTO = -1, @@ -200,7 +188,6 @@ typedef enum IVAS_ROOM_SIZE_MEDIUM, IVAS_ROOM_SIZE_LARGE } IVAS_ROOM_SIZE_T; -#endif typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; @@ -343,9 +330,7 @@ typedef enum #endif typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG { -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - UWord16 aeID; /* Acoustic environment ID */ -#endif + UWord16 aeID; /* Acoustic environment ID */ Word16 nBands; /* Number of frequency bands for which reverb properties are provided, integer, range [2..256] */ Word32 pFc_input_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q16 Center frequencies for which following values are provided: */ Word32 pAcoustic_rt60_fx[IVAS_CLDFB_NO_CHANNELS_MAX]; /*Q26 - The room's T60 per center frequency */ diff --git a/lib_com/fd_cng_com_fx.c b/lib_com/fd_cng_com_fx.c index 0f5fd72ea..dfd05b70d 100644 --- a/lib_com/fd_cng_com_fx.c +++ b/lib_com/fd_cng_com_fx.c @@ -162,12 +162,7 @@ void ivas_initFdCngCom_fx( HANDLE_FD_CNG_COM hFdCngCom, Word16 scale ) hFdCngCom->exp_cldfb_periodog = 0; move16(); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG set16_fx( hFdCngCom->coherence_fx, 16384 /* 0.5 in Q15 */, MDCT_ST_DTX_NUM_COHERENCE_BANDS ); -#else - hFdCngCom->coherence_fx = 16384; /* 0.5 in Q15 */ - move16(); -#endif set32_fx( hFdCngCom->olapBufferSynth_fx, 0, FFTLEN ); set32_fx( hFdCngCom->olapBufferSynth2_fx, 0, FFTLEN ); diff --git a/lib_com/fft_fx_evs.c b/lib_com/fft_fx_evs.c index 7fba7c41c..a7b2461cb 100644 --- a/lib_com/fft_fx_evs.c +++ b/lib_com/fft_fx_evs.c @@ -2322,36 +2322,20 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = sub( shr( n, 3 ), 1 ); /* (3*m/8) - 1 = (n/8) - 1 */ FOR( i = 0; i < l; i++ ) { -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0++, 15 ); /* Align with the following non-fractional mode so as to gain 1 more bit headroom. Q15 + Qx*/ acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0++, 15 ); /* Align with the following non-fractional mode so as to gain 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); /* bit growth = 1 (compensated by non-fractional mode MAC). Qx - 1*/ + *RY++ = round_fx( acc ); /* bit growth = 1 (compensated by non-fractional mode MAC). Qx - 1*/ move16(); -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_shl( *IZ0--, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#endif - *IY-- = round_fx( acc ); // Qx - 1 + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = add( c1_ind, c1_step ); @@ -2364,36 +2348,20 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = shr( m, 3 ); /* (4*m/8) - (3*m/8) = m/8 */ FOR( i = 0; i < l; i++ ) { -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); // Qx - 1 + *RY++ = round_fx( acc ); // Qx - 1 move16(); -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_shl( *IZ0--, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#endif - *IY-- = round_fx( acc ); // Qx - 1 + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = add( c1_ind, c1_step ); @@ -2403,16 +2371,10 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) } /* special case: i = m/2 i.e. 1/3 */ -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0--, 15 ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0--, 15 ); // Q15 + Qx - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); // Qx - 1 + *RY++ = round_fx( acc ); // Qx - 1 move16(); acc = 0; @@ -2434,35 +2396,20 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = sub( shr( m, 2 ), 1 ); /* (6*m/8) - ((m/2)+1) = m/4 - 1 */ FOR( i = 0; i < l; i++ ) { -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0--, 15 ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ acc = L_msu0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0--, 15 ); // Q15 + Qx - acc = L_mac0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_msu0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); // Qx - 1 - move16(); - - acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx -#ifdef FIX_2170_ASSERT_IN_FFT3 + *RY++ = round_fx( acc ); // Qx - 1 + move16(); + + acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_msu0( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx -#endif - *IY-- = round_fx( acc ); // Qx - 1 + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = add( c1_ind, c1_step ); @@ -2476,35 +2423,20 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = shr( m, 2 ); FOR( i = 0; i < l; i++ ) { -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0--, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ acc = L_msu0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0--, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_msu0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); // Qx - 1 - move16(); - - acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx -#ifdef FIX_2170_ASSERT_IN_FFT3 + *RY++ = round_fx( acc ); // Qx - 1 + move16(); + + acc = L_mult0( *IZ0++, -32768 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_msu0( acc, *RZ1--, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ1++, t_sin[c1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2--, t_sin[s2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2++, t_sin[c2_ind] ); // Q15 + Qx -#endif - *IY-- = round_fx( acc ); // Qx - 1 + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = sub( c1_ind, c1_step ); @@ -2514,27 +2446,16 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) } /* special case: i = m, i.e 2/3 */ -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); // Qx - 1 + *RY++ = round_fx( acc ); // Qx - 1 move16(); acc = L_deposit_l( 0 ); -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx -#else - acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx -#endif - *IY-- = round_fx( acc ); // Qx - 1 + *IY-- = round_fx( acc ); // Qx - 1 move16(); IZ0--; /* Just decrement the address counter */ IZ1--; @@ -2549,36 +2470,20 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = sub( shr( m, 3 ), 1 ); /* (9*m/8) - (m +1) = m/8 - 1 */ FOR( i = 0; i < l; i++ ) { -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); // Qx - 1 + *RY++ = round_fx( acc ); // Qx - 1 move16(); -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_shl( *IZ0--, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#endif - *IY-- = round_fx( acc ); // Qx - 1 + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = sub( c1_ind, c1_step ); @@ -2591,36 +2496,20 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) l = shr( n, 3 ); /* (12*m/8) - (9*m/8) = 3*m/8 = n/8 */ FOR( i = 0; i < l; i++ ) { -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0++, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ acc = L_mac0_sat( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0++, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); /* Non-fractional mode gains 1 more bit headroom. Q15 + Qx*/ - acc = L_mac0( acc, *IZ1, t_sin[s1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ2, t_sin[s2_ind] ); // Q15 + Qx -#endif - *RY++ = round_fx( acc ); // Qx - 1 + *RY++ = round_fx( acc ); // Qx - 1 move16(); -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *IZ0--, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx acc = L_msu0_sat( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_shl( *IZ0--, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1++, t_sin[s1_ind] ); // Q15 + Qx - acc = L_msu0( acc, *IZ1--, t_sin[c1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2++, t_sin[s2_ind] ); // Q15 + Qx - acc = L_mac0( acc, *IZ2--, t_sin[c2_ind] ); // Q15 + Qx -#endif - *IY-- = round_fx( acc ); // Qx - 1 + *IY-- = round_fx( acc ); // Qx - 1 move16(); c1_ind = sub( c1_ind, c1_step ); @@ -2630,16 +2519,10 @@ void fft3_fx( const Word16 X[] /*Qx*/, Word16 Y[] /*Qx*/, const Word16 n ) } /* special case: i = 3*m/2 */ -#ifdef FIX_2170_ASSERT_IN_FFT3 acc = L_shl_sat( *RZ0, 15 ); // Q15 + Qx acc = L_msu0_sat( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx acc = L_mac0_sat( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx -#else - acc = L_shl( *RZ0, 15 ); // Q15 + Qx - acc = L_msu0( acc, *RZ1, t_sin[c1_ind] ); // Q15 + Qx - acc = L_mac0( acc, *RZ2, t_sin[c2_ind] ); // Q15 + Qx -#endif - *RY = round_fx( acc ); // Qx - 1 + *RY = round_fx( acc ); // Qx - 1 move16(); return; diff --git a/lib_com/hp50_fx.c b/lib_com/hp50_fx.c index 88c819d82..bef9956e4 100644 --- a/lib_com/hp50_fx.c +++ b/lib_com/hp50_fx.c @@ -316,12 +316,8 @@ void hp20_fx_32_opt( prescale = s_min( prescale, diff ); prescale = sub( 1 + HP20_FX_COEFF_SCALE, prescale ); -#ifdef FIX_2086_ENABLE_HP20_OPT_FOR_ENC if ( EQ_16( prescale_current_frame, 1 + HP20_FX_COEFF_SCALE - 31 ) || // signal_fx buffer contains only zeros, so use the mem_fx scale_factor instead LT_16( prescale_current_frame, prescale ) ) // To avoid overflow in the subsequent shr() scaling for W_y1, W_y2, x2, and x1 calculations before the for loop. -#else - if ( EQ_16( prescale_current_frame, 1 + HP20_FX_COEFF_SCALE - 31 ) ) // signal_fx buffer contains only zeros, so use the mem_fx scale_factor instead -#endif { prescale_current_frame = prescale; } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 1ca2ca994..b4411fe50 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -197,12 +197,10 @@ typedef enum #define MAX_SPAR_INTERNAL_CHANNELS IVAS_SPAR_MAX_CH #define MAX_CLDFB_DIGEST_CHANNELS 3 /* == maximum of ParamISM TCs and ParamMC TCs */ -#ifdef FIX_GAIN_EDIT_LIMITS #define EDIT_GAIN_MIN_Q29 33874260 /* Minimum allowed object gain edit with parametric modes in Q29: 0.0630957f, -24 dB */ #define EDIT_GAIN_MAX_Q29 2137321728 /* Maximum allowed object gain edit in Q29: 3.9810719f, +12 dB */ #define EDIT_GAIN_MIN_Q12 258 /* Minimum allowed object gain edit with parametric modes in Q12: 0.0630957f, -24 dB */ #define EDIT_GAIN_MAX_Q12 16306 /* Maximum allowed object gain edit in Q12: 3.9810719f, +12 dB */ -#endif @@ -891,10 +889,8 @@ enum fea_names #define MDCT_ST_PLC_FADEOUT_TO_ZERO_LEN 20 #define MDCT_ST_PLC_FADEOUT_DELAY_4_LSP_FADE 3 -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG #define MDCT_ST_DTX_NUM_COHERENCE_BANDS 5 #define MDCT_ST_DTX_FIRST_BAND_OFFSET 2 -#endif typedef enum { NOISE_GEN_MODE_UNDEF = -1, @@ -1297,11 +1293,7 @@ typedef enum *----------------------------------------------------------------------------------*/ #define MC_LS_SETUP_BITS 3 /* number of bits for writing the MC LS configuration */ -#ifdef FIX_1419_MONO_STEREO_UMX #define LS_SETUP_CONVERSION_NUM_MAPPINGS 41 /* number of mappings for LS setup conversion */ -#else -#define LS_SETUP_CONVERSION_NUM_MAPPINGS 35 /* number of mappings for LS setup conversion */ -#endif typedef enum { @@ -1654,18 +1646,13 @@ typedef enum #define RV_LENGTH_NR_FC ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1 #define RV_LENGTH_NR_FC_16KHZ ( RV_FILTER_MAX_FFT_SIZE / 4 ) + 1 -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE #define IVAS_REVERB_DEFAULT_L_N_BANDS 31 #define IVAS_REVERB_DEFAULT_M_N_BANDS 31 #define IVAS_REVERB_DEFAULT_S_N_BANDS 60 -#else -#define IVAS_REVERB_DEFAULT_N_BANDS 31 -#endif #define LR_IAC_LENGTH_NR_FC ( RV_LENGTH_NR_FC ) #define LR_IAC_LENGTH_NR_FC_16KHZ ( RV_LENGTH_NR_FC_16KHZ ) -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE typedef enum { DEFAULT_REVERB_UNSET = -1, @@ -1673,7 +1660,6 @@ typedef enum DEFAULT_REVERB_MEDIUM, DEFAULT_REVERB_LARGE } IVAS_DefaultReverbSize; -#endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 8c91179a1..1b69f35ef 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -145,7 +145,6 @@ typedef enum IVAS_ERR_LC3PLUS_INVALID_BITRATE, IVAS_ERR_INVALID_SPLIT_REND_CONFIG, -#ifdef IVAS_RTPDUMP /*----------------------------------------* * rtp errors * *----------------------------------------*/ @@ -153,7 +152,6 @@ typedef enum IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, IVAS_ERR_RTP_UNPACK_PI_DATA, IVAS_ERR_RTP_UNSUPPORTED_FRAME, -#endif /*----------------------------------------* * unknown error * @@ -292,7 +290,6 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) { return "data error"; } -#ifdef IVAS_RTPDUMP if ( ( error_code & 0x7000 ) == 0x7000 ) { switch ( error_code ) @@ -309,7 +306,6 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "rtp error"; } } -#endif return "Unknown error"; } diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index b75b38137..5e5d3c5bd 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -1490,13 +1490,6 @@ ivas_error ivas_dirac_config_fx( void *st_ivas, /* i/o: IVAS encoder/decoder state structure */ const Word16 enc_dec /* i : encoder or decoder flag */ ); -#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG - -void dtx_read_padding_bits_fx( - DEC_CORE_HANDLE st, - const Word16 num_bits -); -#endif void FdCngEncodeMDCTStereoSID_fx( CPE_ENC_HANDLE hCPE /* i/o: CPE encoder state structure */ @@ -6695,7 +6688,6 @@ void ivas_binaural_hrtf_close_fx( HRTFS_FASTCONV_HANDLE *hHrtfFastConv /* i/o: decoder binaural hrtf handle */ ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------------------* * Multi-pose ring buffer Prototypes @@ -6731,7 +6723,6 @@ void ivas_CLDFB_RINGBUF_GetByIdx( const Word16 idx ); -#endif /*----------------------------------------------------------------------------------* * renderer prototypes diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 9773d0715..bcc0c26f1 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -133,10 +133,8 @@ extern const SpectrumWarping sw32000Hz[]; /* PsychLPC */ extern const MDCTStereoBands_config mdctStereoBands_32000_640[]; -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG extern const Word16 mdct_stereo_dtx_coherence_bandlengths[MDCT_ST_DTX_NUM_COHERENCE_BANDS]; extern const Word16 get_next_index_4_by_15[16]; -#endif /*----------------------------------------------------------------------------------* @@ -300,9 +298,7 @@ extern const Word32 diffuseness_thresholds_hr_fx[HR_MASA_ER_LEVELS + 1]; extern const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; extern const Word32 azimuth_cb_fx[8]; extern const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2]; -#ifdef OBJ_EDIT_BASOP extern const Word32 delta_theta_masa_inv_fx[NO_SPHERICAL_GRIDS - 2]; -#endif extern const Word16 coherence_cb0_masa_Q14[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH]; extern const Word32 coherence_cb0_masa_fx[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH]; extern const Word16 coherence_cb1_masa_Q15[MASA_NO_CV_COH1 * MASA_MAXIMUM_CODING_SUBBANDS]; /* 25 */ diff --git a/lib_com/ivas_rom_com_fx.c b/lib_com/ivas_rom_com_fx.c index a5af89655..f0ae9f860 100644 --- a/lib_com/ivas_rom_com_fx.c +++ b/lib_com/ivas_rom_com_fx.c @@ -546,7 +546,6 @@ const MDCTStereoBands_config mdctStereoBands_32000_640[] = {33, 29, 26, 18}/*number of bands for frame lengths 480, 320, 256, 160 respectively*/ }}; -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG const Word16 mdct_stereo_dtx_coherence_bandlengths[MDCT_ST_DTX_NUM_COHERENCE_BANDS] = { 6, /* 8 - MDCT_ST_DTX_FIRST_BAND_OFFSET */ 8, 16, 16, 80 }; @@ -554,7 +553,6 @@ const Word16 mdct_stereo_dtx_coherence_bandlengths[MDCT_ST_DTX_NUM_COHERENCE_BAN const Word16 get_next_index_4_by_15[16] = { 0, 2184, 4369, 6553, 8738, 10922, 13107, 15291, 17476, 19660, 21845, 24029, 26214, 28398, 30583, 32767 }; -#endif const Word16 dft_cng_coh_u2i[9] = { 4, 5, 3, 6, 2, 7, 1, 8, 0 }; /* Coherence unary codeword -> residual codeword conversion table */ @@ -4416,12 +4414,10 @@ const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2] = { 188743680, 188743680, 150994944, 106954752, 83886080, 62914560, 45214596, 28101836, 20971520 }; -#ifdef OBJ_EDIT_BASOP // Q31 const Word32 delta_theta_masa_inv_fx[NO_SPHERICAL_GRIDS - 2] = { 47721859, 47721859, 59652324, 84215045, 107374182, 143165577, 199209986, 320519947, 429496730 }; -#endif // q = 14 const Word16 coherence_cb0_masa_Q14[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH] = { diff --git a/lib_com/options.h b/lib_com/options.h index 0f23d8082..708e7f633 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -71,94 +71,15 @@ /* ################### Start FIXES switches ########################### */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -#define REMOVE_BASOP_Util_Divide3232_Scale_cadence /* remove this division variant */ #define FIX_1990_SANITIZER_IN_REVERB_LOAD /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */ #define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/ -#define TEMP_FIX_2088_MSAN_INIT_ERROR /* Eri: Temporary fix for Issue 2088 - MSAN error. Will come with later port of JBM+Split rendering update */ -#define FIX_2092_ASSERT_IN_OMASA_RENDER /* FhG, Nokia: Fix LTV crash due to overflow in OMASA EXT output */ -#define FIX_2084_FLOATING_POINT_LEFTOVERS /* FhG: convert floating-point leftovers in IVAS_ENC_FeedObjectMetadata() */ -#define FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING /* FhG: Replace L_shl with L_shl_sat to prevent overflow when calculating scale factors for very small numbers in the logarithmic domain */ -#define FIX_APA_EXECS_SCALING /* VA: fix scaling of JBM APA buffer */ -#define FIX_2164_ASSERT_IN_OMASA_PREPROC_FOR_EDIT /* Nokia: Issue 2164: Prevent overflow when calculating equalization coefficient for editing before clamping to safe range */ -#define FIX_BASOP_ASSERT_IN_TONAL_MDCT_PLC /* FhG: fix for issue 2165 - using saturating addition in tonal MDCT PLC function */ -#define OPT_2146_BASOP_UTIL_ADD_MANT32EXP /* Dlb: optimized version of BASOP_Util_Add_Mant32Exp() */ -#define FIX_2166_ASSERT_OSBA_PLC_STEREO_OUT /* FhG: fix for issue 2166 - add missing averaging factor 0.5 in for the sum of energies in function stereo_dft_dmx_swb_nrg_fx()*/ -#define FIX_2086_ENABLE_HP20_OPT_FOR_ENC /* FhG: Enable hp20_fx_32_opt() for Encoder */ -#define FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE /* FhG: Use dynamic Q factor for synth_fx and synthFB_fx to prevent overflow */ -#define FIX_2170_ASSERT_IN_FFT3 /* Eri: Assert in fft3_fx from EVS, adding _sat */ -#define FIX_2082_FP_LEFTOVERS_OMASA_DEC /* Nokia: fix for issue 2082, cleaning remaining floating point code */ -#define FIX_2174_JBM_BASOP_ALIGNMENT /* VoiceAge, Nokia: Fixes to JBM BASOP implementation and alignment to float */ -#define FIX_GAIN_EDIT_LIMITS /* Harmonize gain edit limits for all opertation points. For all modes, limit to max +12dB. For parametric modes, limit to min -24dB. */ - -#define FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO /* FhG: Reduce hStereoDft->q_smooth_buf_fx by one to prevent overflow in the subframe_band_nrg[][] calculation */ -#define FIX_2015_PREMPH_SAT_ALT /* VA: saturation can happen during preemphasis filtering due to a too aggressive scaling factor, allows preemphis to get 1 more bit headroom */ -#define FIX_2178_FL_TO_FX_WITH_OBJ_EDIT_FILE_INTERFACE /* Nokia: Fixes float to fx conversion in decoder app with object edit file interface */ -#define FIX_2070_JBM_TC_CHANNEL_RESCALING_ISSUE /* Eri/Orange: scale_sig32 problem on p_tc_fx[] */ - -#define FIX_2173_UBSAN_IN_JBM_PCMDSP_APA /* FhG: Fix UBSAN problems in jbm_pcmdsp_apa_fx.c */ -#define FIX_1947_DEC_HIGH_MLD_FOR_STEREO2MONO /* FhG: Make Q-factor of synth_16_fx and output_16_fx dynamic to prevent overflow in HQ_CORE mode */ - -#define FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING /* Orange: Fix for issue 2184 - to prevent one channel from becoming inaudible in the mono downmix output */ -#define FIX_2148_OBJ_EDIT_ISSUE_WITH_OSBA /* Nokia: Add missing code to solve issue */ -#define FIX_2200_ISAR_PLC_CRASH /* Dolby: Fix for ISAR PLC crash observed with newly added BASOP tests */ -#define FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA /* FhG: Resolve overflow by swapping the order of addition and multiplication */ -#define FIX_2217_ASSERT_IN_IVAS_CORE_DECODER_WITH_MC /* FhG: Adjust Q_real to prevent overflow in st->cldfbSyn->cldfb_state_fx scaling */ -#define FIX_2211_ASSERT_IN_REND_CREND_CONVOLER /* FhG: Add headroom to p_output_fx to prevent overflow in ivas_rend_crendProcessSubframe_fx() */ - -#define NONBE_FIX_2205_SATURATE_ALTERNATIVE -#define NONBE_FIX_2206_SATURATE_ALTERNATIVE -#define FIX_2226_ISAR_PRE_CRASH_CLDFB_NO_CHANNELS /* Dolby: Fix crash of ISAR pre-renderer due to an attempt of re-scaling uninitialized values in the CLDFB filter bank */ -#define RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE /* Dolby: CR for split rendering codec framesize signalling in Toc Byte */ - - -#define NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES /* FhG: Adjust scaleFactor according to st->cldfbSyn->cldfb_state_fx too to avoid overflow in cldfbSynthesis_ivas_fx() */ - -#define NONBE_FIX_BASOP_2233_RTPDUMP_DIFFERING_BITSTREAMS /* Nokia: fix basop issue 2233: Fix differing rtpdump streams */ - -#define NONBE_FIX_2237_ZERO_CURR_NOISE_PROBLEM /* FhG: Modify sum of hTonalMDCTConc->curr_noise_nrg to avoid inaccurate zero */ /* ################### End FIXES switches ########################### */ /* #################### Start BASOP porting switches ############################ */ -#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_1053_REVERB_RECONFIGURATION -#define FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add split rendering support to decoder in VoIP mode */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ -#define FIX_1413_IGF_INIT_PRINTOUT /* FhG: use correct variable for IGF initiliazation */ -#define FIX_1330_JBM_MEMORY_FIX /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */ -#define FIX_1411_IGF_CRASH_BW_SWITCHING /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/ -#define FIX_1419_MONO_STEREO_UMX /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */ -#define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */ -#define FIX_1437_LC3PLUS_EXTREND_HIRES /* FhG: fix external renderer split bitstream header writing causing a crash for LC3plus High-res mode */ -#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV /* FhG: Avoid rounding when passing azimuth and elevation to efap_determine_gains() */ -#define FIX_1318_ROOM_SIZE_CMD_LINE /* Philips/Nokia/FhG: Default room sizes support */ -#define NONBE_FIX_1442_MASA_EXT_REND_ORIENT_IDX /* Nokia: Fix issue 1442 of wrong index to combinedOrientationData */ -#define BE_FIX_1391_COVERAGE_SPAR_DYN__CHANNEL /* Dolby: Fix coverage of SBA SPAR Dynamic active W not getting hit by the tests */ - -// object-editing feature porting -#define TMP_FIX_SPLIT_REND // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions) -/*#define TMP_FIX_OMASA_SR_BE*/ // temporary fix to keep OMASA split-rendering BE - mul, 20251112: disabled, since this causes diffs to ivas-codec/main -#define NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES // Nokia: Fix 1399_1400 issue in float, this is essential for the BASOP porting -#define OBJ_EDIT_BASOP -#define FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES /* Nokia: Issue 2140, fixes three different sanitizer issues persisting in object editing code. */ -#define FIX_2193_ISM_GAINS_WITH_OE /* FhG: fix issue 2193: use edited angles in ISM gain calculation */ -#define FIX_2192_OBJ_EDITING_EXT_METADATA /* Eri: Add support for extended metadata in object editing */ -#define FIX_BASOP_ISSUE_1585_CUT_BS_CRASH /* FhG: Fix for BASOP issue 1585 crash of a cut bitstream, also valid for float code*/ - -// RTPDUMP porting -#define RTP_S4_251135_CR26253_0016_REV1 /* RTP Pack/Unpack API corresponding to CR 26253 */ -#define IVAS_RTPDUMP /* RTPDUMP writing and reading for IVAS payloads */ -#define FIXED_RTP_SEQUENCE_NUM /* Remove random sequence number initialization */ -#define IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /* RTPDUMP acoustic environment */ -#define ISM_PI_DATA /* Add reading and packing/unpacking of ISM PI data */ -#define REVERSE_ISM_PI_DATA /* Add reading and packing/unpacking of reverse ISM PI data */ -#define PI_LATENCY /* Support for PI latency */ -#define DECODER_FORMAT_SWITCHING /* Re-initialize the decoder when the format/subformat of the incoming stream is changed */ -#define FIX_SPLIT_RENDERING_ON_DECODER_RESTART /* Re-configure split rendering on decoder restart */ -#define RTP_UPDATES_SA4_134 /* Updates to RTP during SA4 134 */ -#define COMPACT_ORIENTATION_PI_DATA /* #################### End BASOP porting switches ############################ */ diff --git a/lib_com/preemph_fx.c b/lib_com/preemph_fx.c index 2b5c4e1c8..8b0657bd5 100644 --- a/lib_com/preemph_fx.c +++ b/lib_com/preemph_fx.c @@ -39,34 +39,6 @@ void preemph_copy_fx( return; } -#ifndef FIX_2015_PREMPH_SAT_ALT -void preemph_copy_32fx( - const Word16 x[], /* i : input signal Qx */ - Word32 y[], /* o : output signal Qx */ - const Word16 mu, /* i : preemphasis coefficient Q15 */ - const Word16 lg, /* i : vector size Q0 */ - Word16 *mem /* i/o: memory (x[-1]) Qx */ -) -{ - Word16 i, temp; - - temp = x[lg - 1]; /* Qx */ - move16(); - - FOR( i = lg - 1; i > 0; i-- ) - { - y[i] = L_msu_sat( L_deposit_h( x[i] ), x[i - 1], mu ); /* Qx+16 */ - move16(); - } - y[0] = L_msu_sat( L_deposit_h( x[0] ), *mem, mu ); /* Qx+16 */ - move16(); - - *mem = temp; /* Qx */ - move16(); - - return; -} -#else void preemph_copy_32fx2( const Word16 x[], /* i : input signal Qx */ Word32 y[], /* o : output signal Qx-1*/ @@ -93,7 +65,6 @@ void preemph_copy_32fx2( return; } -#endif /*-------------------------------------------------------------* * preemph_ivas_fx() * diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 624d5aefa..40136fe0a 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -2687,12 +2687,8 @@ void lag_wind_32( ); // preemp_fx.c -#define PREEMPH_FX( signal, mu, L, mem ) preemph_copy_fx( ( signal ), ( signal ), ( mu ), ( L ), ( mem ) ) -#ifndef FIX_2015_PREMPH_SAT_ALT -#define PREEMPH_32FX( signal, signal_out, mu, L, mem ) preemph_copy_32fx( ( signal ), ( signal_out ), ( mu ), ( L ), ( mem ) ) -#else +#define PREEMPH_FX( signal, mu, L, mem ) preemph_copy_fx( ( signal ), ( signal ), ( mu ), ( L ), ( mem ) ) #define PREEMPH_32FX( signal, signal_out, mu, L, mem ) preemph_copy_32fx2( ( signal ), ( signal_out ), ( mu ), ( L ), ( mem ) ) -#endif void preemph_copy_fx( const Word16 x[], /* i : i signal Qx */ Word16 y[], /* o : output signal Qx */ @@ -2701,15 +2697,6 @@ void preemph_copy_fx( Word16 *mem /* i/o: memory (x[-1]) Qx */ ); -#ifndef FIX_2015_PREMPH_SAT_ALT -void preemph_copy_32fx( - const Word16 x[], /* i : i signal Qx */ - Word32 y[], /* o : output signal Qx */ - const Word16 mu, /* i : preemphasis coefficient Q15 */ - const Word16 lg, /* i : vector size Q0 */ - Word16 *mem /* i/o: memory (x[-1]) Qx */ -); -#else void preemph_copy_32fx2( const Word16 x[], /* i : i signal Qx */ Word32 y[], /* o : output signal Qx */ @@ -2717,7 +2704,6 @@ void preemph_copy_32fx2( const Word16 lg, /* i : vector size Q0 */ Word16 *mem /* i/o: memory (x[-1]) Qx */ ); -#endif void E_UTIL_f_preemph2( Word16 shift, /* Q0 */ @@ -9029,9 +9015,7 @@ void decoder_tcx_ivas_fx( Word16 Aind[], Word16 synth_fx[], Word16 synthFB_fx[], -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 *synth_q, -#endif const Word16 bfi, const Word16 frame_cnt, const Word16 sba_dirac_stereo_flag ); @@ -11082,14 +11066,12 @@ void ivas_set_bitstream_pointers( Decoder_State **reset_elements( Decoder_Struct *st_ivas /* i/o: IVAS decoder structure */ ); -#ifdef IVAS_RTPDUMP void convertSerialToBytestream_fx( const UWord16 *const serial, /* i : input serial bitstream with values 0 and 1 */ const UWord16 num_bits, /* i : number of bits in the input bitstream */ UWord8 *const bytestream /* o : output compact bitstream (bytestream) */ ); -#endif void mdct_switching_dec_fx( Decoder_State *st /* i/o: decoder state structure */ diff --git a/lib_com/stat_com.h b/lib_com/stat_com.h index ba1af8281..2a37faef6 100644 --- a/lib_com/stat_com.h +++ b/lib_com/stat_com.h @@ -443,13 +443,9 @@ typedef struct Word16 CngBandwidth; Word16 flag_noisy_speech; - Word16 likelihood_noisy_speech; /* Q15 */ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + Word16 likelihood_noisy_speech; /* Q15 */ Word16 coherence_fx[MDCT_ST_DTX_NUM_COHERENCE_BANDS]; /* inter-channel coherence of noise Q15 */ -#else - Word16 coherence_fx; /* inter-channel coherence of noise Q15 */ -#endif - Word16 no_side_flag; /* indicates whether the side noise shape should be zeroed-out or not */ + Word16 no_side_flag; /* indicates whether the side noise shape should be zeroed-out or not */ } FD_CNG_COM, *HANDLE_FD_CNG_COM; diff --git a/lib_dec/FEC_HQ_phase_ecu_fx.c b/lib_dec/FEC_HQ_phase_ecu_fx.c index fbf8f96f5..8e1cbb7b9 100644 --- a/lib_dec/FEC_HQ_phase_ecu_fx.c +++ b/lib_dec/FEC_HQ_phase_ecu_fx.c @@ -2139,11 +2139,7 @@ static void ivas_subst_spec_fx( im = *pImX; move16(); tmp = sub_sat( mult_r( re, cos_F ), mult_r( im, sin_F ) ); -#ifdef FIX_2170_ASSERT_IN_FFT3 im = add_sat( mult_r( re, sin_F ), mult_r( im, cos_F ) ); -#else - im = add( mult_r( re, sin_F ), mult_r( im, cos_F ) ); -#endif IF( LT_16( alpha[k], 32766 ) ) { alpha_local = mag_chg_local; diff --git a/lib_dec/TonalComponentDetection_fx.c b/lib_dec/TonalComponentDetection_fx.c index 4d12457d7..b1ffd7580 100644 --- a/lib_dec/TonalComponentDetection_fx.c +++ b/lib_dec/TonalComponentDetection_fx.c @@ -453,11 +453,7 @@ static void getEnvelope( FOR( i = 0; i < n2; i++ ) { -#ifdef FIX_BASOP_ASSERT_IN_TONAL_MDCT_PLC sum = L_add_sat( sum, powerSpec[i] ); /*powerSpec_exp*/ -#else - sum = L_add( sum, powerSpec[i] ); /*powerSpec_exp*/ -#endif } /* No need for PTR_INIT for powerSpec[i+n2] as we continue from the previous loop */ FOR( i = 0; i < n1; i++ ) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index ad55c29c2..958b8064d 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -124,11 +124,7 @@ ivas_error acelp_core_dec_fx( ivas_error error; Word32 bpf_error_signal_fx[L_FRAME16k]; Word16 bpf_error_signal_16fx[L_FRAME16k]; -#ifdef FIX_2217_ASSERT_IN_IVAS_CORE_DECODER_WITH_MC Word16 Q_real, scf; -#else - Word16 Q_real; -#endif Word32 max_real, max_imag, max_val; set32_fx( bpf_error_signal_fx, 0, L_FRAME16k ); @@ -2087,22 +2083,16 @@ ivas_error acelp_core_dec_fx( } max_val = L_max( max_real, max_imag ); Q_real = sub( norm_l( max_val ), 3 ) /* Guard bits */; -#ifdef FIX_2217_ASSERT_IN_IVAS_CORE_DECODER_WITH_MC scf = L_norm_arr( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length ); scf = s_min( scf, sub( Q_real, Q11 ) ); Q_real = add( scf, Q11 ); -#endif FOR( i = 0; i < CLDFB_NO_COL_MAX; i++ ) { scale_sig32( realBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real scale_sig32( imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real ); // Q_real } -#ifdef FIX_2217_ASSERT_IN_IVAS_CORE_DECODER_WITH_MC scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, scf ); // Q10 - > (Q_real-1) -#else - scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub( Q_real, Q11 ) ); // Q10 - > (Q_real-1) -#endif st->cldfbSyn->Q_cldfb_state = sub( Q_real, 1 ); move16(); diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index aad249425..f9377d53f 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -3970,14 +3970,9 @@ void decoder_tcx_ivas_fx( Word16 prm[], Word16 A_fx[], // Q: 14 - norm_s(A_fx[0]) Word16 Aind[], // Q: 14 - norm_s(Aind[0]) -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 synth_fx[], Word16 synthFB_fx[], Word16 *synth_q, -#else - Word16 synth_fx[], // Q_syn - Word16 synthFB_fx[], // Q_syn -#endif const Word16 bfi, const Word16 frame_cnt, const Word16 sba_dirac_stereo_flag ) @@ -4067,9 +4062,6 @@ void decoder_tcx_ivas_fx( move16(); q_winFB = st->Q_syn; move16(); -#ifndef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE - assert( q_win == 0 ); -#endif Scale_sig( synth_fx, L_frame_glob, sub( q_win, st->Q_syn ) ); // Scaling to Q_syn Scale_sig( synthFB_fx, L_frameTCX_glob, sub( q_winFB, st->Q_syn ) ); // Scaling to Q_syn @@ -4078,17 +4070,12 @@ void decoder_tcx_ivas_fx( fUseTns, &synth_fx[0], &synthFB_fx[0], bfi, frame_cnt, sba_dirac_stereo_flag ); /* Scaling up again */ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 q_min = s_min( add( q_win, getScaleFactor16( synth_fx, L_frame_glob ) ), add( q_winFB, getScaleFactor16( synthFB_fx, L_frameTCX_glob ) ) ); q_min = s_min( q_min, st->Q_syn ); Scale_sig( synth_fx, L_frame_glob, sub( q_min, q_win ) ); Scale_sig( synthFB_fx, L_frameTCX_glob, sub( q_min, q_winFB ) ); *synth_q = q_min; -#else - Scale_sig( synth_fx, L_frame_glob, sub( st->Q_syn, q_win ) ); - Scale_sig( synthFB_fx, L_frameTCX_glob, sub( st->Q_syn, q_winFB ) ); -#endif // Scale_sig( st->hTcxDec->syn_Overl, L_FRAME32k / 2, 1 ); diff --git a/lib_dec/er_dec_tcx_fx.c b/lib_dec/er_dec_tcx_fx.c index 762ead66e..e59e3c0e3 100644 --- a/lib_dec/er_dec_tcx_fx.c +++ b/lib_dec/er_dec_tcx_fx.c @@ -101,11 +101,7 @@ void con_tcx_fx( Word16 pre_emph_buf; Word16 hp_filt[L_FIR_FER2]; Word16 alpha; -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 tmp_deemph, gain, gainCNG, gain_inov, scf; -#else - Word16 tmp_deemph, gain, gainCNG, gain_inov; -#endif Word16 *pt_exc, *pt1_exc; Word16 Tc, tmpSeed; Word16 fUseExtrapolatedPitch; @@ -190,16 +186,10 @@ void con_tcx_fx( IF( ( EQ_16( st->nbLostCmpt, 1 ) ) || hTcxDec->tcxConceal_recalc_exc ) { /* apply pre-emphasis to the signal */ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE mem = shl( synth[( -( ( ( shr( L_frame, 1 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )], st->Q_syn_factor ); /*Q0*/ -#else - mem = synth[( -( ( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + M + M ) ) - 1 )]; /*Q0*/ -#endif move16(); Q_exc = E_UTIL_f_preemph3( &( synth[-( ( ( L_frame / 2 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), st->preemph_fac, add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl( M, 1 ) ), &mem, 1 ); -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Scale_sig( &( synth[-( ( shr( L_frame, 1 ) + hTcxDec->pit_max_TCX ) + 2 * M )] ), add( add( shr( L_frame, 1 ), hTcxDec->pit_max_TCX ), shl( M, 1 ) ), negate( st->Q_syn_factor ) ); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */ -#endif st->Mode2_lp_gainc = L_deposit_l( 0 ); st->Mode2_lp_gainp = get_gain2( synth - shl( L_subfr, 1 ), synth - add( shl( L_subfr, 1 ), Tc ), shl( L_subfr, 1 ) ); /*Q16*/ @@ -238,17 +228,11 @@ void con_tcx_fx( ELSE { /* apply pre-emphasis to the signal */ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE mem = shl( synth[( -L_frame - 1 )], st->Q_syn_factor ); /*Q0*/ -#else - mem = synth[( -L_frame - 1 )]; /*Q0*/ -#endif move16(); Q_exc = E_UTIL_f_preemph3( &( synth[-L_frame] ), st->preemph_fac, L_frame, &mem, 1 ); -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Scale_sig( &synth[-L_frame], L_frame, negate( st->Q_syn_factor ) ); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */ -#endif - Copy( st->old_Aq_12_8_fx, A_local, M + 1 ); /*Q12*/ + Copy( st->old_Aq_12_8_fx, A_local, M + 1 ); /*Q12*/ offset = shr( L_frame, 1 ); IF( GE_16( st->last_good, UNVOICED_TRANSITION ) ) @@ -778,9 +762,8 @@ void con_tcx_fx( * - compute the synthesis speech * *----------------------------------------------------------*/ - syn = buf + M; /*Q_syn*/ - Copy( synth - M, buf, M ); /*Q_syn*/ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE + syn = buf + M; /*Q_syn*/ + Copy( synth - M, buf, M ); /*Q_syn*/ IF( NE_32( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness { scf = norm_s( tmp_deemph ); @@ -796,10 +779,6 @@ void con_tcx_fx( scf = 0; move16(); } -#else - new_Q = sub( Q_exc, 3 ); - new_Q = s_max( new_Q, -1 ); -#endif tmp16 = s_min( new_Q, st->prev_Q_syn ); st->prev_Q_syn = new_Q; @@ -810,8 +789,7 @@ void con_tcx_fx( move16(); Copy_Scale_sig( buf, mem_syn, M, exp_scale ); /*Q: tmp16*/ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE - IF( NE_32( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness + IF( NE_32( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness { if ( GT_16( sub( Q_syn, st->Q_syn_factor ), scf ) ) { @@ -825,9 +803,6 @@ void con_tcx_fx( } st->Q_syn_factor = 0; move16(); -#else - tmp_deemph = shl_sat( tmp_deemph, Q_syn ); /*Q_syn*/ -#endif st->Q_syn = Q_syn; move16(); diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index d0432c771..0f8cec8e0 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -2928,20 +2928,12 @@ void generate_comfort_noise_dec_ivas_fx( temp = 0; move16(); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG c1 = Sqrt16( hFdCngCom->coherence_fx[0], &temp ); /*Q15 - temp*/ -#else - c1 = Sqrt16( hFdCngCom->coherence_fx, &temp ); /*Q15 - temp*/ -#endif - c1 = shl( c1, temp ); /*Q15*/ + c1 = shl( c1, temp ); /*Q15*/ temp = 0; move16(); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG c2 = Sqrt16( sub( MAX_16, hFdCngCom->coherence_fx[0] ), &temp ); /*Q15 - temp*/ -#else - c2 = Sqrt16( sub( MAX_16, hFdCngCom->coherence_fx ), &temp ); /*Q15 - temp*/ -#endif - c2 = shl( c2, temp ); /*Q15*/ + c2 = shl( c2, temp ); /*Q15*/ temp = getScaleFactor32( fftBuffer, FFTLEN ); scale_sig32( fftBuffer, FFTLEN, temp ); /*Q31 - hFdCngCom->fftBuffer_exp + temp*/ @@ -2968,12 +2960,8 @@ void generate_comfort_noise_dec_ivas_fx( { test(); test(); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG test(); IF( ( EQ_16( st->element_mode, IVAS_CPE_MDCT && NE_16( nchan_out, 1 ) ) ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) -#else - IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) -#endif { rand_gauss_fx( &tmp1, seed, Q15 ); rand_gauss_fx( &tmp2, seed2, Q15 ); @@ -3009,7 +2997,6 @@ void generate_comfort_noise_dec_ivas_fx( } ptr_i = ptr_r + 1; /*Q31 - fftBuffer_exp*/ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG test(); IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) && NE_16( nchan_out, 1 ) ) { @@ -3146,65 +3133,6 @@ void generate_comfort_noise_dec_ivas_fx( } } -#else - FOR( ; ptr_level < cngNoiseLevel + sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); ptr_level++ ) - { - /* Real part in FFT bins */ - test(); - test(); - IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) - { - rand_gauss_fx( &tmp1, seed, Q15 ); /*Q15*/ - rand_gauss_fx( &tmp2, seed2, Q15 ); /*Q15*/ - *ptr_r = L_add( Mpy_32_16_1( tmp1, c1 ), Mpy_32_16_1( tmp2, c2 ) ); /*Q15*/ - move32(); - fftBuffer_temp_exp[idx] = Q16; - move16(); - } - ELSE - { - rand_gauss_fx( ptr_r, seed, Q15 ); /*Q15*/ - fftBuffer_temp_exp[idx] = Q16; - move16(); - } - - sqrtNoiseLevel_exp = sub( cngNoiseLevel_exp, 1 ); - sqrtNoiseLevel = Sqrt32( *ptr_level, &sqrtNoiseLevel_exp ); /*Q31 - sqrtNoiseLevel_exp*/ - ( *ptr_r ) = Mpy_32_32( ( *ptr_r ), sqrtNoiseLevel ); /*Q15 - sqrtNoiseLevel_exp*/ - move32(); - fftBuffer_temp_exp[idx] = add( fftBuffer_temp_exp[idx], sqrtNoiseLevel_exp ); - move16(); - idx = add( idx, 1 ); - ptr_r += 2; - - /* Imaginary part in FFT bins */ - test(); - test(); - IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) - { - rand_gauss_fx( &tmp1, seed, Q15 ); /*Q15*/ - rand_gauss_fx( &tmp2, seed2, Q15 ); /*Q15*/ - *ptr_i = L_add( Mpy_32_16_1( tmp1, c1 ), Mpy_32_16_1( tmp2, c2 ) ); /*Q15*/ - move32(); - fftBuffer_temp_exp[idx] = Q16; - move16(); - } - ELSE - { - rand_gauss_fx( ptr_i, seed, Q15 ); /*Q15*/ - fftBuffer_temp_exp[idx] = Q16; - move16(); - } - sqrtNoiseLevel_exp = sub( cngNoiseLevel_exp, 1 ); - sqrtNoiseLevel = Sqrt32( *ptr_level, &sqrtNoiseLevel_exp ); /*Q31 - sqrtNoiseLevel_exp*/ - ( *ptr_i ) = Mpy_32_32( ( *ptr_i ), sqrtNoiseLevel ); /*Q15 - sqrtNoiseLevel_exp*/ - move32(); - fftBuffer_temp_exp[idx] = add( fftBuffer_temp_exp[idx], sqrtNoiseLevel_exp ); - move16(); - idx = add( idx, 1 ); - ptr_i += 2; - } -#endif /* Remaining FFT bins are set to zero */ set32_fx( fftBuffer + shl( hFdCngCom->stopFFTbin, 1 ), 0, sub( hFdCngCom->fftlen, shl( hFdCngCom->stopFFTbin, 1 ) ) ); @@ -3315,12 +3243,10 @@ void generate_comfort_noise_dec_ivas_fx( /* Generate Gaussian random noise in real and imaginary parts of the CLDFB bands Amplitudes are adjusted to the estimated noise level cngNoiseLevel_flt in each band */ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* * Note: for the stereo DTX noise mixing, c1 and c2 at this point are set to the value calculated for the last band * as all the coherence bands are in the FFT region, we do not need the special handling here */ -#endif test(); IF( bufferReal != NULL && ( LT_16( hFdCngCom->numCoreBands, hFdCngCom->regularStopBand ) ) ) @@ -3337,12 +3263,8 @@ void generate_comfort_noise_dec_ivas_fx( FOR( i = 0; i < hFdCngCom->numSlots; i++ ) { /* Real part in CLDFB band */ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG test(); IF( ( EQ_16( st->element_mode, IVAS_CPE_MDCT ) && NE_16( nchan_out, 1 ) ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) -#else - IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) -#endif { rand_gauss_fx( &tmp1, seed, Q15 ); /*Q15*/ rand_gauss_fx( &tmp2, seed2, Q15 ); /*Q15*/ @@ -3365,12 +3287,8 @@ void generate_comfort_noise_dec_ivas_fx( move16(); /* Imaginary part in CLDFB band */ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG test(); IF( ( EQ_16( st->element_mode, IVAS_CPE_MDCT ) && NE_16( nchan_out, 1 ) ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) -#else - IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) || ( EQ_16( st->element_mode, IVAS_SCE ) && st->cng_ism_flag ) ) -#endif { rand_gauss_fx( &tmp1, seed, Q15 ); /*Q15*/ rand_gauss_fx( &tmp2, seed2, Q15 ); /*Q15*/ @@ -3717,21 +3635,13 @@ void generate_comfort_noise_dec_hf_ivas_fx( s = 0; move16(); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG c1 = Sqrt16( hFdCngCom->coherence_fx[sub( MDCT_ST_DTX_NUM_COHERENCE_BANDS, 1 )], &s ); /*Q15 - s*/ -#else - c1 = Sqrt16( hFdCngCom->coherence_fx, &s ); /*Q15 - s*/ -#endif - c1 = shl( c1, s ); // Q15 + c1 = shl( c1, s ); // Q15 s = 0; move16(); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG c2 = Sqrt16( sub( MAX16B, hFdCngCom->coherence_fx[sub( MDCT_ST_DTX_NUM_COHERENCE_BANDS, 1 )] ), &s ); /*Q15 - s*/ -#else - c2 = Sqrt16( sub( MAX16B, hFdCngCom->coherence_fx ), &s ); /*Q15 - s*/ -#endif - c2 = shl( c2, s ); // Q15 + c2 = shl( c2, s ); // Q15 } sn = 0; @@ -5397,7 +5307,6 @@ void FdCngDecodeMDCTStereoSID_fx( Scale_sig32( ms_ptr_fx[ch], N, shift ); // Q20 } -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG tmp32 = sts[1]->total_brate; sts[1]->total_brate = L_add( sts[1]->total_brate, 800 /* 16 * FRAMES_PER_SEC */ ); /* read the four additional coherence values */ @@ -5410,9 +5319,6 @@ void FdCngDecodeMDCTStereoSID_fx( sts[1]->hFdCngDec->hFdCngCom->coherence_fx[b] = sts[0]->hFdCngDec->hFdCngCom->coherence_fx[b]; } sts[1]->total_brate = tmp32; -#else - dtx_read_padding_bits_fx( sts[1], mult( sub( IVAS_SID_5k2, 4400 ), ONE_BY_FRAMES_PER_SEC_Q15 ) ); -#endif IF( sts[0]->hFdCngDec->hFdCngCom->no_side_flag ) { @@ -5597,7 +5503,6 @@ void FdCngDecodeDiracMDCTStereoSID_fx( lpc_from_spectrum( hFdCngCom, hFdCngCom->startBand, hFdCngCom->stopFFTbin, sts[ch]->preemph_fac ); } -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG FOR( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) { sts[0]->hFdCngDec->hFdCngCom->coherence_fx[i] = 0; @@ -5606,12 +5511,6 @@ void FdCngDecodeDiracMDCTStereoSID_fx( move16(); } -#else - sts[0]->hFdCngDec->hFdCngCom->coherence_fx = 0; - move16(); - sts[1]->hFdCngDec->hFdCngCom->coherence_fx = 0; - move16(); -#endif IF( EQ_16( hCPE->nchan_out, 1 ) ) { diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 5d4a6d964..3ed7f6d88 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -1237,9 +1237,7 @@ ivas_error ivas_binRenderer_open_fx( { test(); test(); -#ifdef IVAS_RTPDUMP test(); -#endif IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) { FOR( k = 0; k < 11; k++ ) @@ -1248,11 +1246,7 @@ ivas_error ivas_binRenderer_open_fx( // Q29: hBinRenderer->hReverb->foa_enc_fx[k] } } -#ifdef IVAS_RTPDUMP ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) -#else - ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) -#endif { IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth_fx, st_ivas->hIntSetup.ls_elevation_fx, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) ) { diff --git a/lib_dec/ivas_core_dec_fx.c b/lib_dec/ivas_core_dec_fx.c index 23f75172a..37aa3747f 100644 --- a/lib_dec/ivas_core_dec_fx.c +++ b/lib_dec/ivas_core_dec_fx.c @@ -516,7 +516,6 @@ ivas_error ivas_core_dec_fx( Scale_sig( st->hFdCngDec->hFdCngCom->A_cng, add( M, 1 ), sub( norm_s( sub( st->hFdCngDec->hFdCngCom->A_cng[0], 1 ) ), 3 ) ); // Qx } -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE IF( ( EQ_32( st->last_core, TCX_10_CORE ) || EQ_32( st->last_core, TCX_20_CORE ) ) || // st->Q_syn_factor is set in TCX mode; otherwise, it may be uninitialized ( hCPE != NULL && ( GT_16( hCPE->element_mode, IVAS_CPE_DFT ) && EQ_16( hCPE->last_element_mode, IVAS_CPE_DFT ) && ( ( EQ_32( sts[0]->last_core, TCX_10_CORE ) || EQ_32( sts[0]->last_core, TCX_20_CORE ) ) ) ) ) ) // In this case, sts[1] gets its value from sts[0]. { @@ -525,7 +524,6 @@ ivas_error ivas_core_dec_fx( } st->Q_syn_factor = 0; move16(); -#endif IF( NE_32( ( error = acelp_core_dec_fx( st, output_16_fx[n], synth_16_fx[n], save_hb_synth_16_fx, bwe_exc_extended_fx[n], voice_factors_fx[n], old_syn_12k8_16k_fx_16, sharpFlag[n], pitch_buf_fx[n], &unbits[n], &sid_bw[n], hStereoTD, tdm_lsfQ_PCh_fx, use_cldfb_for_dft, last_element_mode, last_element_brate, flag_sec_CNA, nchan_out, hStereoCng, read_sid_info ) ), IVAS_ERR_OK ) ) { return error; @@ -601,11 +599,7 @@ ivas_error ivas_core_dec_fx( } stereo_tcx_core_dec_fx( st, frameMode[n], output_16_fx[n], synth_16_fx[n], pitch_buf_fx[n], sba_dirac_stereo_flag, hStereoTD, last_element_mode, flag_sec_CNA, hStereoCng, nchan_out, ivas_format ); -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], output_frame, sub( Q11, st->Q_syn_factor ) ); // Q11 -#else - Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], output_frame, Q11 ); // Q11 -#endif IF( st->hTcxDec ) { @@ -629,22 +623,15 @@ ivas_error ivas_core_dec_fx( move16(); Q_synth = 0; move16(); -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE st->Q_syn_factor = 0; move16(); -#endif ivas_hq_core_dec_fx( st, synth_16_fx[n], &Q_synth, output_frame, NORMAL_HQ_CORE, core_switching_flag[n], output_16_fx[n], &Q_output ); Copy_Scale_sig_16_32_DEPREC( output_16_fx[n], output_32_fx[n], L_FRAME48k, sub( Q11, Q_output ) ); // Q11 -#ifdef FIX_1947_DEC_HIGH_MLD_FOR_STEREO2MONO st->Q_syn_factor = s_min( 0, s_min( Q_synth, Q_output ) ); Scale_sig( synth_16_fx[n], output_frame, sub( st->Q_syn_factor, Q_synth ) ); // st->Q_syn_factor Scale_sig( output_16_fx[n], L_FRAME48k, sub( st->Q_syn_factor, Q_output ) ); // st->Q_syn_factor -#else - Scale_sig( synth_16_fx[n], output_frame, negate( Q_synth ) ); // Q0 - Scale_sig( output_16_fx[n], L_FRAME48k, negate( Q_output ) ); // Q0 -#endif } /*---------------------------------------------------------------------* @@ -822,11 +809,7 @@ ivas_error ivas_core_dec_fx( *---------------------------------------------------------------------*/ /*core_switching_post_dec*/ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Q_synth = add( sub( 15, e_sig[0] ), st->Q_syn_factor ); -#else - Q_synth = sub( 15, e_sig[0] ); -#endif /*------------------fix-to-fix-end-----------------------*/ diff --git a/lib_dec/ivas_decision_matrix_dec_fx.c b/lib_dec/ivas_decision_matrix_dec_fx.c index 3eac102a3..e0d9c6ac6 100644 --- a/lib_dec/ivas_decision_matrix_dec_fx.c +++ b/lib_dec/ivas_decision_matrix_dec_fx.c @@ -46,11 +46,6 @@ * Read ACELP signaling bits from the bitstream * Set extension layers *-----------------------------------------------------------------*/ -#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG -static Word16 get_next_index_4_by_15[16] = { - 0, 2184, 4369, 6553, 8738, 10922, 13107, 15291, 17476, 19660, 21845, 24029, 26214, 28398, 30583, 32767 -}; -#endif void ivas_decision_matrix_dec_fx( Decoder_State *st, /* i/o: decoder state structure */ Word16 *sharpFlag, /* o : formant sharpening flag */ @@ -131,11 +126,7 @@ void ivas_decision_matrix_dec_fx( /* read channel coherence */ Word16 index; index = get_next_indice_fx( st, 4 ); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG st->hFdCngDec->hFdCngCom->coherence_fx[0] = get_next_index_4_by_15[index]; -#else - st->hFdCngDec->hFdCngCom->coherence_fx = get_next_index_4_by_15[index]; -#endif move16(); /* read flag for no side noise shape */ diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 11d80c14f..9ddcfe4e5 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -2165,9 +2165,6 @@ static void binRenderer_split_fx( Word32 Cldfb_ImagBuffer_Binaural_fx[][BINAURAL_CHANNELS][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* o : Rotated Binaural signals */ Word32 RealBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ Word32 ImagBuffer_fx[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i : LS signals */ -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - const Word16 slot_idx_start, -#endif const Word16 num_freq_bands, const Word16 nchan_out ) { @@ -2200,16 +2197,11 @@ static void binRenderer_split_fx( { FOR( ch = 0; ch < nchan_out; ch++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_CLDFB_RINGBUF_Push( hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx], Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx], num_freq_bands ); -#else - Copy32( Cldfb_RealBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands ); - Copy32( Cldfb_ImagBuffer_Binaural_loc[pos_idx][ch][slot_idx], hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[( pos_idx * BINAURAL_CHANNELS ) + ch][slot_idx_start + slot_idx], num_freq_bands ); -#endif } } } @@ -2286,9 +2278,6 @@ void ivas_dirac_dec_render_sf_fx( Word16 surCohRatio_q_fx = 0, temp_q = 0; move16(); move16(); -#ifndef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES - Word16 cldfb_buf_q; -#endif Word16 offset = 0, buff_len = 0; move16(); move16(); @@ -2792,11 +2781,7 @@ void ivas_dirac_dec_render_sf_fx( IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) { -#ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &q_cldfb, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#else - ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( st_ivas, Cldfb_RealBuffer_Binaural_fx[0], Cldfb_ImagBuffer_Binaural_fx[0], &cldfb_buf_q, hSpatParamRendCom->num_freq_bands, subframe_idx ); -#endif } } @@ -3033,12 +3018,8 @@ void ivas_dirac_dec_render_sf_fx( test(); test(); -#ifdef IVAS_RTPDUMP test(); IF( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) -#else - IF( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && st_ivas->hCombinedOrientationData->shd_rot_max_order == 0 ) -#endif { num_freq_bands = hDirAC->band_grouping[hDirAC->hConfig->enc_param_start_band]; move16(); @@ -3823,9 +3804,6 @@ void ivas_dirac_dec_render_sf_fx( binRenderer_split_fx( st_ivas->hBinRenderer, st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural_fx, Cldfb_ImagBuffer_Binaural_fx, Cldfb_RealBuffer_fx, Cldfb_ImagBuffer_fx, -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - slot_idx_start, -#endif hSpatParamRendCom->num_freq_bands, st_ivas->hDecoderConfig->nchan_out ); } ELSE diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index c437ca0f2..de5d9e470 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -111,9 +111,7 @@ ivas_error ivas_dec_get_format_fx( Word16 nchan_ism, element_mode_flag; Word16 sba_order, sba_planar, sba_analysis_order; Word32 ivas_total_brate; -#ifdef DECODER_FORMAT_SWITCHING int16_t Opt_tsm; -#endif UWord16 *bit_stream_orig; AUDIO_CONFIG signaled_config; @@ -126,10 +124,8 @@ ivas_error ivas_dec_get_format_fx( ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; move32(); -#ifdef DECODER_FORMAT_SWITCHING Opt_tsm = st_ivas->hDecoderConfig->Opt_tsm; move16(); -#endif bit_stream_orig = st_ivas->bit_stream; /*-------------------------------------------------------------------* @@ -150,7 +146,6 @@ ivas_error ivas_dec_get_format_fx( !( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_ISM_FORMAT ) ) && !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -165,12 +160,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); -#endif } /*-------------------------------------------------------------------* @@ -208,7 +197,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -223,12 +211,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); -#endif } st_ivas->nchan_ism = nchan_ism; @@ -252,7 +234,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -267,12 +248,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA planar/3D layout is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" ); -#endif } /* read Ambisonic (SBA) order */ @@ -283,7 +258,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -298,12 +272,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); -#endif } sba_analysis_order = ivas_sba_get_analysis_order_fx( ivas_total_brate, sba_order ); @@ -311,23 +279,19 @@ ivas_error ivas_dec_get_format_fx( } ELSE IF( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) ) { -#ifdef DECODER_FORMAT_SWITCHING UWord8 masaRestartCandidate; masaRestartCandidate = 0; move16(); -#endif /* read number of MASA transport channels */ k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ); IF( st_ivas->bit_stream[k - 1] ) { -#ifdef DECODER_FORMAT_SWITCHING test(); if ( st_ivas->nchan_transport == 1 && Opt_tsm ) { masaRestartCandidate = 1; move16(); } -#endif st_ivas->nchan_transport = 2; move16(); element_mode_flag = 1; @@ -335,14 +299,12 @@ ivas_error ivas_dec_get_format_fx( } ELSE { -#ifdef DECODER_FORMAT_SWITCHING test(); if ( st_ivas->nchan_transport == 2 && Opt_tsm ) { masaRestartCandidate = 1; move16(); } -#endif st_ivas->nchan_transport = 1; move16(); } @@ -376,7 +338,6 @@ ivas_error ivas_dec_get_format_fx( element_mode_flag = 1; move16(); } -#ifdef DECODER_FORMAT_SWITCHING ELSE IF( masaRestartCandidate > 0 ) { st_ivas->restartNeeded = 1; @@ -384,12 +345,10 @@ ivas_error ivas_dec_get_format_fx( return IVAS_ERR_OK; } -#endif test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -404,12 +363,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); -#endif } st_ivas->nchan_ism = nchan_ism; @@ -428,7 +381,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -443,12 +395,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); -#endif } st_ivas->nchan_ism = nchan_ism; @@ -463,7 +409,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -478,12 +423,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); -#endif } st_ivas->nchan_ism = nchan_ism; @@ -511,7 +450,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -526,12 +464,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" ); -#endif } st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism ); @@ -558,7 +490,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -573,12 +504,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" ); -#endif } st_ivas->mc_mode = ivas_mc_mode_select_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), ivas_total_brate ); @@ -677,7 +602,6 @@ ivas_error ivas_dec_get_format_fx( test(); IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) ) { -#ifdef DECODER_FORMAT_SWITCHING IF( Opt_tsm ) { st_ivas->restartNeeded = 1; @@ -692,12 +616,6 @@ ivas_error ivas_dec_get_format_fx( #endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); } -#else -#ifdef DEBUGGING - fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" ); -#endif - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" ); -#endif } st_ivas->nchan_ism = nchan_ism; @@ -1735,16 +1653,12 @@ ivas_error ivas_init_decoder_fx( IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { test(); -#ifdef FIX_1419_MONO_STEREO_UMX IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) { hDecoderConfig->nchan_out = 1; move16(); } ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) -#else - IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) -#endif { hDecoderConfig->nchan_out = CPE_CHANNELS; } @@ -1811,14 +1725,12 @@ ivas_error ivas_init_decoder_fx( st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( st_ivas->intern_config ); move16(); } -#ifdef FIX_1419_MONO_STEREO_UMX test(); IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { st_ivas->transport_config = EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; } -#endif /* Only initialize transport setup if it is used */ IF( NE_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_INVALID ) ) @@ -1886,7 +1798,6 @@ ivas_error ivas_init_decoder_fx( } } -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE /*--------------------------------------------------------------------------* * Allocate and initialize HRTF Statistics handle, get default reverb values *--------------------------------------------------------------------------*/ @@ -1957,20 +1868,6 @@ ivas_error ivas_init_decoder_fx( } } } -#else - /*--------------------------------------------------------------------* - * Allocate and initialize HRTF Statistics handle - *--------------------------------------------------------------------*/ - - IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) - { - /* Init HRTF statistics */ - IF( NE_32( ( error = ivas_HRTF_statistics_init_fx( &st_ivas->hHrtfStatistics, output_Fs ) ), IVAS_ERR_OK ) ) - { - return error; - } - } -#endif /*-----------------------------------------------------------------* * Allocate and initialize SCE/CPE and other handles @@ -2000,10 +1897,6 @@ ivas_error ivas_init_decoder_fx( { st_ivas->nchan_transport = CPE_CHANNELS; move16(); -#ifndef FIX_1419_MONO_STEREO_UMX /* already set now by renderer_select() */ - st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO; - move32(); -#endif st_ivas->nSCE = 0; move16(); @@ -2884,12 +2777,8 @@ ivas_error ivas_init_decoder_fx( test(); test(); test(); -#ifdef IVAS_RTPDUMP test(); IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( hDecoderConfig->Opt_Headrotation || hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) -#else - IF( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( hDecoderConfig->Opt_Headrotation || hDecoderConfig->Opt_ExternalOrientation ) ) -#endif { IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth_fx, st_ivas->hIntSetup.ls_elevation_fx, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) ) { @@ -3462,11 +3351,9 @@ void ivas_initialize_handles_dec( st_ivas->hRenderConfig = NULL; st_ivas->hExtOrientationData = NULL; st_ivas->hCombinedOrientationData = NULL; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT st_ivas->acousticEnvironmentsCount = 0; move16(); st_ivas->pAcousticEnvironments = NULL; -#endif st_ivas->hSplitBinRend = NULL; for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) @@ -3688,14 +3575,12 @@ void ivas_destroy_dec_fx( /* Config. Renderer */ ivas_render_config_close_fx( &( st_ivas->hRenderConfig ) ); -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /* Acoustic environments */ IF( st_ivas->pAcousticEnvironments != NULL ) { free( st_ivas->pAcousticEnvironments ); st_ivas->pAcousticEnvironments = NULL; } -#endif /* Limiter struct */ ivas_limiter_close_fx( &( st_ivas->hLimiter ) ); @@ -4054,28 +3939,6 @@ static ivas_error doSanityChecks_IVAS( return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Non-diegetic panning not supported in this IVAS format" ); } -#ifndef FIX_1419_MONO_STEREO_UMX /* we now support basically everything for stereo */ - /* Verify stereo output configuration */ - IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) - { - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - IF( NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) && NE_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) && NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" ); - } - } - /* Verify output configuration for other formats */ - ELSE - { - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_INVALID ) ) -#else /* exclude invalid configs instead of matching valid ones */ test(); test(); test(); @@ -4089,22 +3952,16 @@ static ivas_error doSanityChecks_IVAS( EQ_32( output_config, IVAS_AUDIO_CONFIG_ISM4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_MASA1 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_MASA2 ) ) -#endif - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); - } -#ifdef FIX_1419_MONO_STEREO_UMX - test(); - test(); - IF( ( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) && - ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) - { - return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); - } -#endif -#ifndef FIX_1419_MONO_STEREO_UMX + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); + } + test(); + test(); + IF( ( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) && + ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" ); } -#endif test(); diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 54cc5da15..a193cba2e 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -1248,21 +1248,15 @@ void ivas_ism_metadata_sid_dec_fx( { IF( EQ_16( ch, *sce_id_dtx ) ) { -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG FOR( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) { hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[i] = 32767; } -#else - hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx = 32767; // 1.0f in Q15 - move16(); -#endif CONTINUE; } idx = get_next_indice_fx( st0, nBits_coh ); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[0] = get_next_index_4_by_15[idx]; // Q15 move16(); FOR( i = 1; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) @@ -1270,25 +1264,16 @@ void ivas_ism_metadata_sid_dec_fx( hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[i] = hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[0]; move16(); } -#else - hSCE[ch]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx = div_s( idx, sub( ( shl( 1, nBits_coh ) ), 1 ) ); // Q15 - move16(); -#endif } } IF( EQ_32( ism_mode, ISM_MODE_PARAM ) ) { -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG FOR( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) { hSCE[*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[i] = hSCE[!*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[i]; move16(); } -#else - hSCE[*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx = hSCE[!*sce_id_dtx]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx; - move16(); -#endif } /*----------------------------------------------------------------* diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index 6af94ea97..a342481a0 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -942,9 +942,6 @@ void ivas_ism_dec_digest_tc_fx( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_MIXER_CONV_ROOM ) && st_ivas->hDecoderConfig->Opt_Headrotation == 0 ) ) { Word16 i; -#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV - Word32 azimuth_fx, elevation_fx; -#endif /* we have a full frame interpolator, adapt it */ /* for BE testing */ @@ -1013,11 +1010,6 @@ void ivas_ism_dec_digest_tc_fx( } ELSE { -#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV - // TODO tmu review when #215 is resolved - azimuth_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 - elevation_fx = L_shr( L_add( st_ivas->hIsmMetaData[i]->edited_elevation_fx, 2097152 ), Q22 ); // Q0 ,2097152 = .5f in Q22 -#endif test(); test(); @@ -1033,9 +1025,7 @@ void ivas_ism_dec_digest_tc_fx( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) && EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) ) && st_ivas->hCombinedOrientationData == NULL ) { -#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV Word32 elevation_fx = st_ivas->hIsmMetaData[i]->edited_elevation_fx; -#endif if ( st_ivas->hIntSetup.is_planar_setup ) { /* If no elevation support in output format, then rendering should be done with zero elevation */ @@ -1045,17 +1035,9 @@ void ivas_ism_dec_digest_tc_fx( IF( st_ivas->hEFAPdata != NULL ) { -#ifndef NONBE_1412_AVOID_ROUNDING_AZ_ELEV - azimuth_fx = L_shl( azimuth_fx, Q22 ); // Q22 - elevation_fx = L_shl( elevation_fx, Q22 ); // Q22 -#endif -#ifdef NONBE_1412_AVOID_ROUNDING_AZ_ELEV efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIsmMetaData[i]->edited_azimuth_fx, elevation_fx, EFAP_MODE_EFAP ); -#else - efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], azimuth_fx, elevation_fx, EFAP_MODE_EFAP ); -#endif // TODO: align Q values properly IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) ) { @@ -1069,13 +1051,8 @@ void ivas_ism_dec_digest_tc_fx( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) { /*get HOA gets for direction (ACN/SN3D)*/ -#ifdef FIX_2193_ISM_GAINS_WITH_OE Word16 azi = round_fx( L_shr( st_ivas->hIsmMetaData[i]->edited_azimuth_fx, Q22 - Q16 ) ); // Q0 Word16 ele = round_fx( L_shr( st_ivas->hIsmMetaData[i]->edited_elevation_fx, Q22 - Q16 ) ); // Q0 -#else - Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 ); // Q0 - Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0 -#endif ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 ); @@ -1837,12 +1814,8 @@ void ivas_param_ism_params_to_masa_param_mapping_fx( IF( st_ivas->hISMDTX.dtx_flag ) { - Word32 energy_ratio_fx; /* Q30 */ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG + Word32 energy_ratio_fx; /* Q30 */ energy_ratio_fx = L_mult0( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[0], st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx[0] ); /* Q15 + Q15 -> Q30 */ -#else - energy_ratio_fx = L_mult0( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx, st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->coherence_fx ); /* Q15 + Q15 -> Q30 */ -#endif hSpatParamRendCom->numSimultaneousDirections = 1; move16(); diff --git a/lib_dec/ivas_jbm_dec_fx.c b/lib_dec/ivas_jbm_dec_fx.c index f8664b60b..c968e81b8 100644 --- a/lib_dec/ivas_jbm_dec_fx.c +++ b/lib_dec/ivas_jbm_dec_fx.c @@ -1559,9 +1559,7 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx( FOR( ch = 0; ch < s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch++ ) { hTcBuffer->tc_fx[ch] = &hTcBuffer->tc_buffer_fx[offset]; -#ifdef FIX_1330_JBM_MEMORY_FIX st_ivas->p_output_fx[ch] = hTcBuffer->tc_fx[ch]; -#endif offset = add( offset, len_offset ); } } @@ -1739,28 +1737,17 @@ ivas_error ivas_jbm_dec_render_fx( ivas_jbm_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx ); } -#ifdef FIX_1419_MONO_STEREO_UMX ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) -#else - ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) -#endif { -#ifdef FIX_1419_MONO_STEREO_UMX *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); move16(); -#endif /* Rendering */ IF( EQ_32( st_ivas->renderer_type, RENDERER_MC ) ) { -#ifndef FIX_1419_MONO_STEREO_UMX - *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - move16(); -#endif ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc_fx, p_output_fx ); } -#ifdef FIX_1419_MONO_STEREO_UMX ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) ) { IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) @@ -1779,7 +1766,6 @@ ivas_error ivas_jbm_dec_render_fx( } } } -#endif /* FIX_1419_MONO_STEREO_UMX */ } ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { @@ -2419,7 +2405,6 @@ ivas_error ivas_jbm_dec_render_fx( IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP const Word32 *p_output_fx_const[MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS]; nchan_out_syn_output = i_mult( BINAURAL_CHANNELS, st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ); @@ -2442,23 +2427,13 @@ ivas_error ivas_jbm_dec_render_fx( nchan_out_syn_output = BINAURAL_CHANNELS; move16(); } -#endif -#else - FOR( i = 0; i < st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; i++ ) - { - Copy32( p_output_fx[i], st_ivas->hSplitBinRend->hMultiBinCldfbData->output_fx[i], *nSamplesRendered ); - } #endif } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ELSE { -#endif nchan_out_syn_output = nchan_out; move16(); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP } -#endif IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) { @@ -2540,11 +2515,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( { /* move it at the beginning of the TC buffer with zero padding */ Copy32( hTcBuffer->tc_buffer_old_fx[ch_idx], hTcBuffer->tc_fx[ch_idx], n_samples_to_render ); -#ifdef FIX_2174_JBM_BASOP_ALIGNMENT set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, sub( hTcBuffer->n_samples_granularity, n_samples_to_render ) ); -#else - set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render ); -#endif } /* simple change of the slot info */ @@ -2641,7 +2612,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( { return error; } -#ifdef FIX_2211_ASSERT_IN_REND_CREND_CONVOLER Word16 subframe_len, gd_bits; subframe_len = imult1616( st_ivas->hTcBuffer->subframe_nbslots[0], st_ivas->hTcBuffer->n_samples_granularity ); gd_bits = find_guarded_bits_fx( subframe_len ); @@ -2650,10 +2620,6 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( { scale_sig32( p_output_fx[i], *nSamplesRendered, sub( *st_ivas->hCrendWrapper->p_io_qfactor, Q11 ) ); // Q = *st_ivas->hCrendWrapper->p_io_qfactor } -#else - *st_ivas->hCrendWrapper->p_io_qfactor = 11; - move16(); -#endif IF( NE_32( error = ivas_rend_crendProcessSubframe_fx( 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_fx : st_ivas->hTcBuffer->tc_fx, p_output_fx, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ), IVAS_ERR_OK ) ) @@ -2662,12 +2628,10 @@ ivas_error ivas_jbm_dec_flush_renderer_fx( } ivas_binaural_add_LFE_fx( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc_fx, p_output_fx ); -#ifdef FIX_2211_ASSERT_IN_REND_CREND_CONVOLER FOR( Word16 i = 0; i < nchan_in; i++ ) { scale_sig32( p_output_fx[i], *nSamplesRendered, sub( Q11, *st_ivas->hCrendWrapper->p_io_qfactor ) ); // Q11 } -#endif } ELSE IF( EQ_16( renderer_type_old, RENDERER_BINAURAL_OBJECTS_TD ) ) { @@ -3140,16 +3104,7 @@ Word16 ivas_jbm_dec_get_num_tc_channels_fx( test(); test(); test(); -#ifndef FIX_1419_MONO_STEREO_UMX /* since we support more output formats for mono, this is no longer sensible; leave it at the default from above */ - IF( EQ_16( st_ivas->ivas_format, MONO_FORMAT ) ) - { - num_tc = st_ivas->hDecoderConfig->nchan_out; - move16(); - } - ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) ) -#else IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) ) -#endif { num_tc = 1; move16(); @@ -3358,11 +3313,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx( { n_samp_full = NS2SA_FX2( output_Fs, MAX_JBM_L_FRAME_NS ); n_samp_full = s_max( n_samp_full, L_FRAME48k ); /* buffers are shared between 'hTcBuffer->tc[]' and 'p_output_f[]': ensure minimal length */ -#ifdef FIX_2174_JBM_BASOP_ALIGNMENT n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 ); -#else - n_samp_residual = add( hTcBuffer->n_samples_granularity, 1 ); -#endif } ELSE { @@ -3371,11 +3322,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx( move16(); } -#ifdef FIX_2174_JBM_BASOP_ALIGNMENT nsamp_to_allocate = imult1616( s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ), n_samp_full ); -#else - nsamp_to_allocate = s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ) * n_samp_full; -#endif IF( Opt_tsm ) { @@ -3388,11 +3335,7 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx( offset = 0; move16(); -#ifdef FIX_2174_JBM_BASOP_ALIGNMENT FOR( ch_idx = 0; ch_idx < s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) -#else - FOR( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ ) -#endif { hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset]; offset = add( offset, n_samp_full ); @@ -4166,11 +4109,7 @@ void ivas_dec_prepare_renderer_fx( ivas_omasa_gain_masa_tc_fx( st_ivas->hTcBuffer->tc_fx, st_ivas->hMasaIsmData->gain_masa_edited_fx, st_ivas->nchan_ism, st_ivas->hTcBuffer->n_samples_available ); } } -#ifdef FIX_1419_MONO_STEREO_UMX ELSE IF( EQ_16( st_ivas->ivas_format, MONO_FORMAT ) || EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) ) -#else - ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) ) -#endif { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); } @@ -4353,7 +4292,6 @@ void ivas_dec_prepare_renderer_fx( move16(); } -#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES test(); test(); IF( st_ivas->hDecoderConfig->Opt_tsm && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) ) @@ -4368,7 +4306,6 @@ void ivas_dec_prepare_renderer_fx( } } } -#endif FOR( n = 0; n < nchan_transport_ism; n++ ) { @@ -4383,10 +4320,8 @@ void ivas_dec_prepare_renderer_fx( Scale_sig32( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, Q3 ); // Q8 -> Q11 } } -#ifndef TMP_FIX_OMASA_SR_BE test(); IF( NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && NE_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) -#endif { delay_signal32_fx( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer_fx[n], st_ivas->hMasaIsmData->delayBuffer_size ); // TODO: check if tis is a bug in main already diff --git a/lib_dec/ivas_mc_param_dec_fx.c b/lib_dec/ivas_mc_param_dec_fx.c index ca35d80e7..478a4d00d 100644 --- a/lib_dec/ivas_mc_param_dec_fx.c +++ b/lib_dec/ivas_mc_param_dec_fx.c @@ -461,12 +461,8 @@ ivas_error ivas_param_mc_dec_open_fx( test(); test(); test(); -#ifdef IVAS_RTPDUMP test(); IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) -#else - IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) -#endif { IF( ( hParamMC->hoa_encoder_fx = (Word32 *) malloc( st_ivas->hTransSetup.nchan_out_woLFE * MAX_INTERN_CHANNELS * sizeof( Word32 ) ) ) == NULL ) { @@ -2208,16 +2204,11 @@ void ivas_param_mc_dec_render_fx( { FOR( ch = 0; ch < nchan_out_cldfb; ch++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], Cldfb_RealBuffer_Binaural_fx[pos_idx][ch][slot_idx], Cldfb_ImagBuffer_Binaural_fx[pos_idx][ch][slot_idx], hParamMC->num_freq_bands ); -#else - Copy32( Cldfb_RealBuffer_Binaural_fx[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[add( i_mult( pos_idx, BINAURAL_CHANNELS ), ch )][add( slot_idx_start, slot_idx )], hParamMC->num_freq_bands ); - Copy32( Cldfb_ImagBuffer_Binaural_fx[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[add( i_mult( pos_idx, BINAURAL_CHANNELS ), ch )][add( slot_idx_start, slot_idx )], hParamMC->num_freq_bands ); -#endif } } } diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index b80a08286..889a7b378 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -381,15 +381,11 @@ ivas_error ivas_mc_paramupmix_dec_open( } /* Head or external rotation */ -#ifdef IVAS_RTPDUMP test(); test(); test(); test(); IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) -#else - IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) -#endif { IF( ( hMCParamUpmix->hoa_encoder_fx = (Word32 *) malloc( st_ivas->hTransSetup.nchan_out_woLFE * MAX_INTERN_CHANNELS * sizeof( Word32 ) ) ) == NULL ) @@ -909,16 +905,11 @@ static void ivas_mc_paramupmix_dec_sf( { FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], Cldfb_RealBuffer_Binaural_fx[pos_idx][ch][slot_idx], Cldfb_ImagBuffer_Binaural_fx[pos_idx][ch][slot_idx], maxBand ); -#else - Copy32( Cldfb_RealBuffer_Binaural_fx[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[add( i_mult( pos_idx, BINAURAL_CHANNELS ), ch )][add( slot_index_start, slot_idx )], maxBand ); - Copy32( Cldfb_ImagBuffer_Binaural_fx[pos_idx][ch][slot_idx], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[add( i_mult( pos_idx, BINAURAL_CHANNELS ), ch )][add( slot_index_start, slot_idx )], maxBand ); -#endif } } } diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 49b4edb18..b88d95b18 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1368,12 +1368,8 @@ static ivas_error ivas_mc_dec_reconfig_fx( ivas_binRenderer_close_fx( &st_ivas->hBinRenderer ); test(); -#ifdef IVAS_RTPDUMP test(); IF( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) ) -#else - IF( ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) -#endif { efap_free_data_fx( &st_ivas->hEFAPdata ); } diff --git a/lib_dec/ivas_mdct_core_dec_fx.c b/lib_dec/ivas_mdct_core_dec_fx.c index a0915452e..695051171 100644 --- a/lib_dec/ivas_mdct_core_dec_fx.c +++ b/lib_dec/ivas_mdct_core_dec_fx.c @@ -185,14 +185,12 @@ static void dec_prm_tcx_sidebits_fx( move16(); } -#ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH /* for first frame reset last_core to initialization value for better error-robustness*/ IF( EQ_16( st->ini_frame, 0 ) ) { st->last_core = TCX_20_CORE; move16(); } -#endif getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st0 ); diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 0c6c13d19..8b691a279 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -46,18 +46,10 @@ * Local constants *------------------------------------------------------------------------*/ -#ifdef FIX_2082_FP_LEFTOVERS_OMASA_DEC #define MULT_17_DIV_20_Q15 27853 /* (Word16) ( ( 17.0/20.0 ) * 2^15 + 0.5 ) */ #define MULT_1_DIV_CLDFB_NO_COL_MAX_Q15 2048 /* (Word16) ( ( 1.0 / CLDFB_NO_COL_MAX ) * 2^15 + 0.5 ) */ #define ONEMINUX_EXT_RENDER_IIR_FAC_Q31 107374182 /* (Word32) ( ( 1.0 - 0.95 ) * 2^31 + 0.5f ); 0.95 is EXT_RENDER_IIR_FAC */ #define EXT_RENDER_IIR_FAC_Q31 2040109465 /* (Word32) ( 0.95 * 2^31 + 0.5 ) */ -#else -#define EXT_RENDER_IIR_FAC 0.95f -#define MULT_17_DIV_20_Q15 ( Word16 )( ( 17.0 / 20.0f ) * pow( 2, 15 ) + 0.5f ) -#define MULT_1_DIV_CLDFB_NO_COL_MAX_Q15 ( Word16 )( ( 1.0 / CLDFB_NO_COL_MAX ) * pow( 2, 15 ) + 0.5f ) -#define ONEMINUX_EXT_RENDER_IIR_FAC_Q31 ( Word32 )( ( 1.0f - EXT_RENDER_IIR_FAC ) * pow( 2, 31 ) + 0.5f ) -#define EXT_RENDER_IIR_FAC_Q31 ( Word32 )( EXT_RENDER_IIR_FAC * pow( 2, 31 ) + 0.5f ) -#endif // Calculated as (Word16)(((1.0f / (50 * MAX_PARAM_SPATIAL_SUBFRAMES)) * pow(2, 15)) + 0.5f) #define OMASA_DELAYFRAMES_PER_SEC_Q15 (Word16) 164 // Q15 @@ -1111,11 +1103,7 @@ void ivas_omasa_dirac_rend_jbm_fx( { Copy32( &output_fx[CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[0], *nSamplesRendered ); -#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#else - IF( !st_ivas->hDecoderConfig->Opt_tsm && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) ) -#endif { /* Gain separated object, if edited */ FOR( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -1136,11 +1124,7 @@ void ivas_omasa_dirac_rend_jbm_fx( Copy32( &output_fx[n + CPE_CHANNELS][st_ivas->hTcBuffer->n_samples_rendered], data_separated_objects[n], *nSamplesRendered ); /* Gain discrete objects, if edited */ -#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES IF( st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) -#else - IF( !st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hMasaIsmData->ism_gain_is_edited[n] ) -#endif { v_multc_fx_16( data_separated_objects[n], st_ivas->hMasaIsmData->gain_ism_edited_fx[n], data_separated_objects[n], *nSamplesRendered ); // Q = 8 Scale_sig32( data_separated_objects[n], *nSamplesRendered, Q3 ); // Q = 11 @@ -1198,14 +1182,7 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( ivas_error error; Word32 *p_sepobj_fx[BINAURAL_CHANNELS]; // Q11 Word32 data_separated_objects_fx[BINAURAL_CHANNELS][L_FRAME48k]; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *re, *im; -#else - Word16 slot_idx_start; - - slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; - move16(); -#endif FOR( n = 0; n < BINAURAL_CHANNELS; n++ ) { @@ -1265,15 +1242,9 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm_fx( Scale_sig32( Cldfb_RealBuffer, num_cldfb_bands, sub( Q6, q_cldfb ) ); Scale_sig32( Cldfb_ImagBuffer, num_cldfb_bands, sub( Q6, q_cldfb ) ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_CLDFB_RINGBUF_GetByIdx( st_ivas->hSplitBinRend->hMultiBinCldfbData[n], &re, &im, sub( slot_idx, cldfb_slots ) ); v_add_fx( re, Cldfb_RealBuffer, re, num_cldfb_bands ); v_add_fx( im, Cldfb_ImagBuffer, im, num_cldfb_bands ); -#else - /* note: this intentionally differs from OSBA by: no scaling by 0.5 */ - v_add_fx( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][slot_idx_start + slot_idx], Cldfb_RealBuffer, st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][slot_idx_start + slot_idx], num_cldfb_bands ); - v_add_fx( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][slot_idx_start + slot_idx], Cldfb_ImagBuffer, st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][slot_idx_start + slot_idx], num_cldfb_bands ); -#endif } } } @@ -2155,19 +2126,11 @@ void ivas_omasa_render_objects_from_mix_fx( outSlotImPr = &( outIm[n][slot][0] ); move32(); move32(); -#ifdef FIX_2092_ASSERT_IN_OMASA_RENDER mantissa_exp_to_qvalue( &outRe_exp[n][slot][0], &outRe[n][slot][0], Q20 + Q2, nBins ); // + Q2: add two bits headroom to prevent overflow in cldfbSynthesis_ivas_fx(). mantissa_exp_to_qvalue( &outIm_exp[n][slot][0], &outIm[n][slot][0], Q20 + Q2, nBins ); cldfbSynthesis_ivas_fx( &outSlotRePr, &outSlotImPr, &rendered_objects[n][index], nBins, 0, 1 + Q2, st_ivas->cldfbSynDec[index2] ); -#else - mantissa_exp_to_qvalue( &outRe_exp[n][slot][0], &outRe[n][slot][0], Q20, nBins ); - mantissa_exp_to_qvalue( &outIm_exp[n][slot][0], &outIm[n][slot][0], Q20, nBins ); - - cldfbSynthesis_ivas_fx( &outSlotRePr, &outSlotImPr, &rendered_objects[n][index], - nBins, 0, 1, st_ivas->cldfbSynDec[index2] ); -#endif } } diff --git a/lib_dec/ivas_osba_dec_fx.c b/lib_dec/ivas_osba_dec_fx.c index 20cd3d414..47eed0b12 100644 --- a/lib_dec/ivas_osba_dec_fx.c +++ b/lib_dec/ivas_osba_dec_fx.c @@ -137,14 +137,7 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( Word32 output_separated_objects_fx[BINAURAL_CHANNELS][L_FRAME48k]; Word32 *p_sepobj_fx[BINAURAL_CHANNELS]; Word16 channel_offset; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *re, *im; -#else - Word16 slot_idx_start; - - slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; - move16(); -#endif FOR( Word16 i = 0; i < BINAURAL_CHANNELS; i++ ) { @@ -168,9 +161,6 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( IF( EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { Word16 slot_idx, num_cldfb_bands, nchan_transport_orig; -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - Word16 b; -#endif Word16 cldfb_slots; Word32 Cldfb_RealBuffer[CLDFB_NO_CHANNELS_MAX]; Word32 Cldfb_ImagBuffer[CLDFB_NO_CHANNELS_MAX]; @@ -206,22 +196,9 @@ ivas_error ivas_osba_dirac_td_binaural_jbm_fx( Scale_sig32( Cldfb_RealBuffer, num_cldfb_bands, sub( Q6, q_cldfb ) ); Scale_sig32( Cldfb_ImagBuffer, num_cldfb_bands, sub( Q6, q_cldfb ) ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_CLDFB_RINGBUF_GetByIdx( st_ivas->hSplitBinRend->hMultiBinCldfbData[n], &re, &im, sub( slot_idx, cldfb_slots ) ); v_add_fx( re, Cldfb_RealBuffer, re, num_cldfb_bands ); v_add_fx( im, Cldfb_ImagBuffer, im, num_cldfb_bands ); -#else - FOR( b = 0; b < num_cldfb_bands; b++ ) - { - st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] = - L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_RealBuffer[b] ); - move32(); - - st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][slot_idx_start + slot_idx][b] = - L_add( st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[n][add( slot_idx_start, slot_idx )][b], Cldfb_ImagBuffer[b] ); - move32(); - } -#endif } } } diff --git a/lib_dec/ivas_output_config_fx.c b/lib_dec/ivas_output_config_fx.c index 9c988937b..48305b524 100644 --- a/lib_dec/ivas_output_config_fx.c +++ b/lib_dec/ivas_output_config_fx.c @@ -37,7 +37,6 @@ #include "wmc_auto.h" #include "ivas_prot_fx.h" -#ifdef FIX_1419_MONO_STEREO_UMX static void ms_bin_upmix_renderer_select( const IVAS_FORMAT ivas_format, /* i : Decoder format */ IVAS_AUDIO_CONFIG *internal_config, /* o : Internal configuration for rendering */ @@ -60,7 +59,6 @@ static void ms_bin_upmix_renderer_select( return; } -#endif /*-------------------------------------------------------------------------* * ivas_renderer_select() @@ -94,12 +92,8 @@ void ivas_renderer_select( *-----------------------------------------------------------------*/ test(); -#ifdef IVAS_RTPDUMP test(); IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) -#else - IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) -#endif { st_ivas->hCombinedOrientationData->shd_rot_max_order = -1; move16(); @@ -116,15 +110,11 @@ void ivas_renderer_select( test(); test(); test(); -#ifdef FIX_1419_MONO_STEREO_UMX IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { ms_bin_upmix_renderer_select( st_ivas->ivas_format, internal_config, renderer_type ); } ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) -#else - IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) -#endif { IF( EQ_32( st_ivas->ism_mode, ISM_MODE_PARAM ) ) { @@ -200,12 +190,8 @@ void ivas_renderer_select( } test(); -#ifdef IVAS_RTPDUMP test(); IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) -#else - IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) -#endif { nchan_internal = ivas_sba_get_nchan_metadata_fx( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); test(); @@ -262,12 +248,8 @@ void ivas_renderer_select( test(); test(); test(); -#ifdef IVAS_RTPDUMP test(); IF( ( EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_7_1 ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) && EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) ) -#else - IF( ( EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_7_1 ) ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && EQ_32( st_ivas->mc_mode, MC_MODE_MCT ) ) -#endif { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; move16(); @@ -286,12 +268,8 @@ void ivas_renderer_select( } test(); -#ifdef IVAS_RTPDUMP test(); IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation || st_ivas->hCombinedOrientationData ) -#else - IF( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) -#endif { /* force HOA3 domain for rotation*/ *internal_config = IVAS_AUDIO_CONFIG_HOA3; @@ -320,7 +298,6 @@ void ivas_renderer_select( * Non-binaural rendering configurations *-----------------------------------------------------------------*/ -#ifdef FIX_1419_MONO_STEREO_UMX ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) { *internal_config = EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO; @@ -364,26 +341,6 @@ void ivas_renderer_select( BREAK; } } -#else - ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ) - { - IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) ) - { - *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; - move16(); - } - } - ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) ) - { - test(); - test(); - IF( NE_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_MONO ) && NE_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) - { - *renderer_type = RENDERER_MC; - move16(); - } - } -#endif ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) ) { test(); @@ -727,25 +684,17 @@ RENDERER_TYPE ivas_renderer_secondary_select_fx( test(); test(); test(); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP test(); test(); test(); test(); IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) ) -#endif { renderer_type = RENDERER_BINAURAL_OBJECTS_TD; move32(); } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) && ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) -#else - ELSE IF( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) && ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) -#endif { renderer_type = RENDERER_BINAURAL_OBJECTS_TD; move32(); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index c3c161668..16c164cc4 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -870,37 +870,18 @@ typedef struct renderer_struct * IVAS decoder specific ISAR wrapper structures *----------------------------------------------------------------------------------*/ -#ifndef FIX_1119_SPLIT_RENDERING_VOIP typedef struct { - Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - Word32 output_fx[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k]; - -} ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA, *ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE; - -#endif -typedef struct -{ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; /* Double space to account for TSM */ Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][2 * CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -#else - Word32 Cldfb_RealBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_fx[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; -#endif IVAS_AUDIO_CONFIG config; } ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA, *ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE; typedef struct { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP TD_RINGBUF_HANDLE hMultiBinTdData; ISAR_CLDFB_RINGBUF_HANDLE hMultiBinCldfbData[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; -#else - ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE hMultiBinCldfbData; /*scratch buffer for frame by frame processing*/ -#endif ISAR_SPLIT_REND_BITS_HANDLE hSplitRendBits; /*scratch buffer for frame by frame processing*/ SPLIT_REND_WRAPPER splitrend; ISAR_DEC_SPLIT_REND_CLDFB_OUT_DATA_HANDLE hCldfbDataOut; /*buffer to store cldfb data before binauralization*/ @@ -1069,18 +1050,16 @@ typedef struct jbm_metadata_structure typedef struct decoder_config_structure { - Word32 ivas_total_brate; /* IVAS total bitrate in bps */ - Word32 last_ivas_total_brate; /* last IVAS total bitrate in bps */ - Word32 output_Fs; /* output signal sampling frequency in Hz */ - Word16 nchan_out; /* number of output audio channels */ - AUDIO_CONFIG output_config; /* output audio configuration */ - Word16 Opt_LsCustom; /* indicates whether loudspeaker custom setup is used */ - Word16 Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ - Word16 Opt_Headrotation; /* indicates whether head-rotation is used */ - Word16 Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE - IVAS_ROOM_SIZE_T Opt_RoomSize; /* Selected room size */ -#endif + Word32 ivas_total_brate; /* IVAS total bitrate in bps */ + Word32 last_ivas_total_brate; /* last IVAS total bitrate in bps */ + Word32 output_Fs; /* output signal sampling frequency in Hz */ + Word16 nchan_out; /* number of output audio channels */ + AUDIO_CONFIG output_config; /* output audio configuration */ + Word16 Opt_LsCustom; /* indicates whether loudspeaker custom setup is used */ + Word16 Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ + Word16 Opt_Headrotation; /* indicates whether head-rotation is used */ + Word16 Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ + IVAS_ROOM_SIZE_T Opt_RoomSize; /* Selected room size */ IVAS_HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ Word16 Opt_non_diegetic_pan; /* indicates diegetic or not */ Word16 non_diegetic_pan_gain_fx; /* non diegetic panning gain, Q15 */ @@ -1194,10 +1173,8 @@ typedef struct Decoder_Struct MASA_ISM_DATA_HANDLE hMasaIsmData; /* OMASA rendering handle */ SBA_ISM_DATA_HANDLE hSbaIsmData; /* OSBA rendering handle */ -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pAcousticEnvironments; /* Acoustic environment array */ Word16 acousticEnvironmentsCount; /* Number of acoustic environments in the array*/ -#endif Word16 flag_omasa_brate; @@ -1215,9 +1192,7 @@ typedef struct Decoder_Struct #ifdef TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR Word16 flushing; #endif -#ifdef DECODER_FORMAT_SWITCHING Word16 restartNeeded; /* Flag to signal decoder restart */ -#endif } Decoder_Struct; diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index b5e19dad5..625606678 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -220,11 +220,7 @@ void stereo_dft_dec_reset_fx( { set32_fx( hStereoDft->smooth_buf_fx[i], 0, SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); } -#ifdef FIX_2176_ASSERT_DEC_MAP_PARAMS_DIRAC2STEREO hStereoDft->q_smooth_buf_fx = Q6; -#else - hStereoDft->q_smooth_buf_fx = Q7; -#endif move16(); set16_fx( hStereoDft->smooth_fac_fx[0], 0, SBA_DIRAC_STEREO_NUM_BANDS ); set16_fx( hStereoDft->smooth_fac_fx[1], 0, SBA_DIRAC_STEREO_NUM_BANDS ); diff --git a/lib_dec/ivas_stereo_dft_plc_fx.c b/lib_dec/ivas_stereo_dft_plc_fx.c index 93588a356..6e4af32e5 100644 --- a/lib_dec/ivas_stereo_dft_plc_fx.c +++ b/lib_dec/ivas_stereo_dft_plc_fx.c @@ -785,33 +785,20 @@ Word32 stereo_dft_dmx_swb_nrg_fx( { FOR( i = 0; i < frame_length / 2; i++ ) { -#ifdef FIX_2166_ASSERT_OSBA_PLC_STEREO_OUT dmx_nrg = L_add( dmx_nrg, L_shr( L_add( Madd_32_32( Mpy_32_32( dmx_k0[2 * i], dmx_k0[2 * i] ), dmx_k0[2 * i + 1], dmx_k0[2 * i + 1] ), Madd_32_32( Mpy_32_32( dmx_k1[2 * i], dmx_k1[2 * i] ), dmx_k1[2 * i + 1], dmx_k1[2 * i + 1] ) ), 1 ) ); /* Q0 */ -#else - dmx_nrg = L_add( dmx_nrg, - L_add( Madd_32_32( Mpy_32_32( dmx_k0[2 * i], dmx_k0[2 * i] ), dmx_k0[2 * i + 1], dmx_k0[2 * i + 1] ), - Madd_32_32( Mpy_32_32( dmx_k1[2 * i], dmx_k1[2 * i] ), dmx_k1[2 * i + 1], dmx_k1[2 * i + 1] ) ) ); /* Q0 */ -#endif } } ELSE { FOR( i = 0; i < frame_length / 2; i++ ) { -#ifdef FIX_2166_ASSERT_OSBA_PLC_STEREO_OUT dmx_nrg = L_add( dmx_nrg, L_shr( L_add( L_shl( Madd_32_32( Mpy_32_32( dmx_k0[2 * i], dmx_k0[2 * i] ), dmx_k0[2 * i + 1], dmx_k0[2 * i + 1] ), q0 ), L_shl( Madd_32_32( Mpy_32_32( dmx_k1[2 * i], dmx_k1[2 * i] ), dmx_k1[2 * i + 1], dmx_k1[2 * i + 1] ), q1 ) ), 1 ) ); /*3*q0 - 31*/ -#else - dmx_nrg = L_add( dmx_nrg, - L_add( L_shl( Madd_32_32( Mpy_32_32( dmx_k0[2 * i], dmx_k0[2 * i] ), dmx_k0[2 * i + 1], dmx_k0[2 * i + 1] ), q0 ), - L_shl( Madd_32_32( Mpy_32_32( dmx_k1[2 * i], dmx_k1[2 * i] ), dmx_k1[2 * i + 1], dmx_k1[2 * i + 1] ), q1 ) ) ); /*3*q0 - 31*/ - -#endif } } diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c index 725211758..1a639a3d7 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c @@ -634,11 +634,7 @@ void synchonize_channels_mdct_sid_fx( move16(); sts[1]->bwidth = sts[0]->bwidth; move16(); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG sts[0]->hFdCngDec->hFdCngCom->coherence_fx[0] = sts[1]->hFdCngDec->hFdCngCom->coherence_fx[0]; /* coherence is stored in sts[1] - see ivas_decision_matrix_dec() */ -#else - sts[0]->hFdCngDec->hFdCngCom->coherence_fx = sts[1]->hFdCngDec->hFdCngCom->coherence_fx; /* coherence is stored in sts[1] - see ivas_decision_matrix_dec() */ -#endif move16(); sts[0]->hFdCngDec->hFdCngCom->no_side_flag = sts[1]->hFdCngDec->hFdCngCom->no_side_flag; move16(); diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index 76e4d226d..237b5f9d5 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -1951,10 +1951,8 @@ void stereo_switching_dec( Copy( sts[0]->old_exc_fx, sts[1]->old_exc_fx, L_EXC_MEM_DEC ); /* Q_exc */ sts[1]->Q_exc = sts[0]->Q_exc; move16(); -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE sts[1]->Q_syn_factor = sts[0]->Q_syn_factor; move16(); -#endif sts[1]->Q_exc_cng = sts[0]->Q_exc_cng; move16(); sts[1]->prev_Q_exc = sts[0]->prev_Q_exc; diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index e62d20b66..d721d426a 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -230,9 +230,7 @@ void stereo_tcx_core_dec_fx( Word16 *synth_fx; Word16 synth_bufFB_fx[OLD_SYNTH_SIZE_DEC + L_FRAME_PLUS + M]; Word16 *synthFB_fx; -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 synth_q[2]; -#endif Word32 psd_fx[L_FRAME16k]; Word32 psd_part_fx[NPART_SHAPING]; Word16 psd_part_e; @@ -329,13 +327,11 @@ void stereo_tcx_core_dec_fx( st->core = GetPLCModeDecision_ivas_fx( st ); /* Q0 */ move16(); } -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE IF( st->core != ACELP_CORE ) { st->Q_syn_factor = 0; move16(); } -#endif /*--------------------------------------------------------------------------------* * LPC envelope decoding *--------------------------------------------------------------------------------*/ @@ -573,13 +569,9 @@ void stereo_tcx_core_dec_fx( } /* TCX decoder */ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE decoder_tcx_ivas_fx( st, prm, Aq_fx, Aind, &synth_fx[0], &synthFB_fx[0], &synth_q[0], bfi, 0, sba_dirac_stereo_flag ); st->Q_syn_factor = sub( synth_q[0], st->Q_syn ); st->Q_syn = synth_q[0]; -#else - decoder_tcx_ivas_fx( st, prm, Aq_fx, Aind, &synth_fx[0], &synthFB_fx[0], bfi, 0, sba_dirac_stereo_flag ); -#endif } /*--------------------------------------------------------------------------------* @@ -608,7 +600,6 @@ void stereo_tcx_core_dec_fx( } /* TCX decoder */ -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE decoder_tcx_ivas_fx( st, prm, Aq_fx, Aind, &synth_fx[k * st->L_frame / 2], &synthFB_fx[k * ( hTcxDec->L_frameTCX / 2 )], &synth_q[k], bfi, k, sba_dirac_stereo_flag ); } @@ -625,10 +616,6 @@ void stereo_tcx_core_dec_fx( q_shift = sub( q_min, synth_q[1] ); scale_sig( &synth_fx[shr( st->L_frame, 1 )], shr( st->L_frame, 1 ), q_shift ); scale_sig( &synthFB_fx[shr( hTcxDec->L_frameTCX, 1 )], shr( hTcxDec->L_frameTCX, 1 ), q_shift ); -#else - decoder_tcx_ivas_fx( st, prm, Aq_fx, Aind, &synth_fx[k * st->L_frame / 2], &synthFB_fx[k * ( hTcxDec->L_frameTCX / 2 )], bfi, k, sba_dirac_stereo_flag ); - } -#endif } /*--------------------------------------------------------------------------------* @@ -640,17 +627,9 @@ void stereo_tcx_core_dec_fx( { IF( !bfi && st->hTonalMDCTConc != NULL ) { -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE TonalMDCTConceal_SaveTimeSignal_ivas_fx( st->hTonalMDCTConc, synthFB_fx, st->Q_syn, hTcxDec->L_frameTCX ); -#else - TonalMDCTConceal_SaveTimeSignal_ivas_fx( st->hTonalMDCTConc, synthFB_fx, 0, hTcxDec->L_frameTCX ); -#endif } -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE decoder_tcx_post_ivas_fx( st, synth_fx, synthFB_fx, st->Q_syn, Aq_fx, bfi, 0 ); -#else - decoder_tcx_post_ivas_fx( st, synth_fx, synthFB_fx, 0, Aq_fx, bfi, 0 ); -#endif IF( EQ_16( st->core, TCX_20_CORE ) ) { diff --git a/lib_dec/jbm_pcmdsp_apa_fx.c b/lib_dec/jbm_pcmdsp_apa_fx.c index 52f39eea4..f33ca4b66 100644 --- a/lib_dec/jbm_pcmdsp_apa_fx.c +++ b/lib_dec/jbm_pcmdsp_apa_fx.c @@ -127,11 +127,7 @@ struct apa_state_t UWord16 qualityred; /* quality reduction threshold */ UWord16 qualityrise; /* quality rising for adaptive quality thresholds */ -#ifdef FIX_2173_UBSAN_IN_JBM_PCMDSP_APA - Word16 last_pitch; /* last pitch/sync position */ -#else - UWord16 last_pitch; /* last pitch/sync position */ -#endif + Word16 last_pitch; /* last pitch/sync position */ UWord16 bad_frame_count; /* # frames before quality threshold is lowered */ UWord16 good_frame_count; /* # scaled frames */ @@ -919,11 +915,7 @@ UWord8 apa_exec_ivas_fx( Word16 Q_a_out; Word16 Q_a_out_init_old; -#ifdef FIX_APA_EXECS_SCALING Q_a_out = add( getScaleFactor32_copy( a_in, l_in ), Q11 - Q16 - Q1 ); -#else - Q_a_out = add( getScaleFactor32_copy( a_in, L_mult0( ps->num_channels, APA_BUF_PER_CHANNEL ) ), Q11 - Q16 - Q1 ); -#endif Q_a_out_init_old = Q_a_out; /* store the possible scaling of a_in, to be re-used in the next frame */ move16(); statsResetThreshold = 1637; @@ -1000,11 +992,7 @@ UWord8 apa_exec_ivas_fx( Scale_sig( ps->buf_out_fx, ps->buf_out_capacity, sub( Q_a_out, ps->Q_buf_out ) ); // Q_buf_out -> Q_a_out IF( EQ_32( ps->scale, 100 ) ) { -#ifdef FIX_APA_EXECS_SCALING FOR( i = 0; i < ps->l_frm; i++ ) -#else - FOR( i = 0; i < ps->num_channels * APA_BUF_PER_CHANNEL; i++ ) -#endif { a_out[i] = a_in[i]; // Q11 move32(); @@ -1016,11 +1004,7 @@ UWord8 apa_exec_ivas_fx( { Word16 *frm_in_ptr = &( frm_in[ps->l_frm] ); -#ifdef FIX_APA_EXECS_SCALING FOR( i = 0; i < ps->l_frm; i++ ) -#else - FOR( i = 0; i < ps->num_channels * APA_BUF_PER_CHANNEL; i++ ) -#endif { a_tmp[i] = extract_h( L_shl( a_in[i], add( Q_a_out, Q5 ) ) ); // Q_a_out move16(); @@ -1070,11 +1054,7 @@ UWord8 apa_exec_ivas_fx( } } -#ifdef FIX_APA_EXECS_SCALING FOR( i = 0; i < l_frm_out; i++ ) -#else - FOR( i = 0; i < ps->num_channels * APA_BUF_PER_CHANNEL; i++ ) -#endif { a_out[i] = L_shl( a_tmp[i], sub( Q11, Q_a_out ) ); // Q0 -> Q11 move32(); @@ -1388,11 +1368,7 @@ static Word8 logarithmic_search_fx( const apa_state_t *ps, DO { -#ifdef FIX_2173_UBSAN_IN_JBM_PCMDSP_APA coeff_max = INT32_MIN; /* will always be overwritten with result of first correlation */ -#else - coeff_max = 0x80000000; /* will always be overwritten with result of first correlation */ -#endif move32(); FOR( i = s_start; i < s_start + inlen; i += css * ps->num_channels ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 698ca55a6..bd0e43018 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -36,9 +36,7 @@ #include "common_api_types.h" #include #include "typedef.h" -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #include "ivas_rtp_pi_data.h" -#endif /*---------------------------------------------------------------------* @@ -123,9 +121,7 @@ ivas_error IVAS_DEC_Configure( const bool enableExternalOrientation, /* i : enable external orientations */ const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ const bool renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE const IVAS_ROOM_SIZE_T roomSize, /* i : room size selector for reverb */ -#endif const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ @@ -158,9 +154,6 @@ ivas_error IVAS_DEC_ReadFormat( ivas_error IVAS_DEC_GetSamplesDecoder( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - const Word16 isSplitRend, /* i : split rendering enabled flag */ -#endif ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ); @@ -317,7 +310,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples( const UWord32 systemTimestamp_ms /* i : current system timestamp */ ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*! r: error code */ ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -333,7 +325,6 @@ ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream( bool *parametersAvailableForEditing, /* o : indicates whether objects editing is available */ const UWord32 systemTimestamp_ms /* i : current system timestamp */ ); -#endif ivas_error IVAS_DEC_Flush( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ @@ -342,13 +333,11 @@ ivas_error IVAS_DEC_Flush( Word16 *nSamplesFlushed /* o : number of samples flushed */ ); -#ifdef DECODER_FORMAT_SWITCHING ivas_error IVAS_DEC_isRestartNeeded( IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ bool *restartNeeded /* o : flag to signal decoder restart */ ); -#endif /* Setter functions - apply changes to decoder configuration */ @@ -464,7 +453,6 @@ ivas_error IVAS_DEC_HRTF_binary_close( const IVAS_BIN_RENDERER_TYPE binaural_renderer_old /* i : previous binaural renderer type */ ); -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT ivas_error IVAS_DEC_AddAcousticEnvironment( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcousticsConfig /* i: Room acoustic configuration */ @@ -475,7 +463,6 @@ ivas_error IVAS_DEC_GetAcousticEnvironment( UWord16 aeID, /* i : Acoustic environment ID */ IVAS_ROOM_ACOUSTICS_CONFIG_DATA *pAcEnv /* o : Room acoustic environment data pointer */ ); -#endif /*! r: error code*/ ivas_error IVAS_DEC_GetRenderConfig( @@ -527,13 +514,11 @@ ivas_error IVAS_DEC_GetJbmData( ); #endif -#ifdef IVAS_RTPDUMP ivas_error IVAS_DEC_FeedPiDataToDecoder( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ hPiDataTs piData, /* i : PI data received in rtp packet */ UWord32 numPiData /* i : number of PI data received in rtp packet */ ); -#endif /* Utility functions */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index fc6525440..7954afd69 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -41,9 +41,7 @@ #include "jbm_jb4sb.h" #include "jbm_pcmdsp_apa.h" #include "jbm_pcmdsp_fifo.h" -#ifdef IVAS_RTPDUMP #include "ivas_rtp_pi_data.h" -#endif #include #include #ifdef DEBUGGING @@ -116,11 +114,7 @@ static void store_JbmData( IVAS_DEC_VOIP *hVoIP, JB4_DATAUNIT_HANDLE dataUnit, c static ivas_error evs_dec_main_fx( Decoder_Struct *st_ivas ); static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, Word16 *bitstream_format_internal, Word16 *sdp_hf_only, const bool is_voip_enabled ); static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP static ivas_error ivas_dec_setup_all( IVAS_DEC_HANDLE hIvasDec, UWord8 *nTransportChannels, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); -#else -static ivas_error ivas_dec_setup_all( IVAS_DEC_HANDLE hIvasDec, UWord8 *nTransportChannels, const Word16 isSplitRend, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); -#endif static ivas_error apa_setup( IVAS_DEC_HANDLE hIvasDec, const bool isInitialized_voip, const UWord16 nTransportChannels ); static ivas_error isar_set_split_rend_setup( ISAR_DEC_SPLIT_REND_WRAPPER *hSplitBinRend, const ISAR_SPLIT_REND_CONFIG_DATA *hSplitBinConfig, const COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, ISAR_SPLIT_REND_BITS_DATA *splitRendBits ); static ivas_error ivas_dec_reconfig_split_rend( Decoder_Struct *st_ivas ); @@ -128,10 +122,8 @@ static ivas_error ivas_dec_init_split_rend( Decoder_Struct *st_ivas ); static ivas_error ivas_create_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend_out ); static Word16 get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP static Word16 get_render_frame_size_samples( const DECODER_CONFIG_HANDLE hDecoderConfig ); static Word16 ivas_dec_split_rend_cldfb_in( const RENDERER_TYPE renderer_type ); -#endif static void update_voip_rendered20ms( IVAS_DEC_HANDLE hIvasDec, const Word16 nSamplesRendered ); @@ -241,10 +233,8 @@ ivas_error IVAS_DEC_Open( /* initialize pointers to handles to NULL */ ivas_initialize_handles_dec( st_ivas ); -#ifdef DECODER_FORMAT_SWITCHING st_ivas->restartNeeded = 0; move16(); -#endif /* set high-level parameters */ IF( EQ_16( mode, IVAS_DEC_MODE_EVS ) ) @@ -337,12 +327,6 @@ static ivas_error isar_set_split_rend_setup( move16(); move16(); -#ifndef TMP_FIX_SPLIT_REND - IF( ( hSplitBinRend->hMultiBinCldfbData = (ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" ); - } -#endif ISAR_PRE_REND_GetMultiBinPoseData( hSplitBinConfig, &hSplitBinRend->splitrend.multiBinPoseData, ( hCombinedOrientationData != NULL ) ? hCombinedOrientationData->sr_pose_pred_axis : DEFAULT_AXIS ); @@ -372,9 +356,7 @@ static void init_decoder_config( hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; hDecoderConfig->Opt_RendConfigCustom = 0; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE hDecoderConfig->Opt_RoomSize = IVAS_ROOM_SIZE_AUTO; -#endif hDecoderConfig->orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain_fx = 0; // Q15 @@ -527,15 +509,13 @@ ivas_error IVAS_DEC_Configure( const bool enableExternalOrientation, /* i : enable external orientations */ const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ const bool renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE - const IVAS_ROOM_SIZE_T roomSize, /* i : room size selector for reverb */ -#endif - const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ - const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ - const bool dpidEnabled, /* i : enable directivity pattern option */ - const UWord16 acousticEnvironmentId, /* i : Acoustic environment ID */ - const bool objEditEnabled, /* i : enable object editing */ - const bool delayCompensationEnabled /* i : enable delay compensation */ + const IVAS_ROOM_SIZE_T roomSize, /* i : room size selector for reverb */ + const bool non_diegetic_pan_enabled, /* i : enabled diegetic panning */ + const Word16 non_diegetic_pan_gain_fx, /* i : non diegetic panning gain */ + const bool dpidEnabled, /* i : enable directivity pattern option */ + const UWord16 acousticEnvironmentId, /* i : Acoustic environment ID */ + const bool objEditEnabled, /* i : enable object editing */ + const bool delayCompensationEnabled /* i : enable delay compensation */ ) { Decoder_Struct *st_ivas; @@ -556,7 +536,6 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } -#ifdef FIX_1419_MONO_STEREO_UMX test(); test(); test(); @@ -576,14 +555,6 @@ ivas_error IVAS_DEC_Configure( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MASA1 ) || EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MASA2 ) ) ) -#else /* we now support all output formats, so this validation is redundant */ - test(); - test(); - test(); - test(); - IF( EQ_16( hIvasDec->mode, IVAS_DEC_MODE_EVS ) && !( ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_MONO ) && non_diegetic_pan_enabled == false ) || - ( EQ_16( outputConfig, IVAS_AUDIO_CONFIG_STEREO ) && non_diegetic_pan_enabled ) ) ) -#endif { return IVAS_ERR_WRONG_MODE; } @@ -620,19 +591,13 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->orientation_tracking = orientation_tracking; hDecoderConfig->Opt_HRTF_binary = (Word16) hrtfReaderEnabled; hDecoderConfig->Opt_RendConfigCustom = (Word16) renderConfigEnabled; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE hDecoderConfig->Opt_RoomSize = roomSize; -#endif hDecoderConfig->Opt_non_diegetic_pan = (Word16) non_diegetic_pan_enabled; hDecoderConfig->non_diegetic_pan_gain_fx = non_diegetic_pan_gain_fx; // Q15 hDecoderConfig->Opt_delay_comp = (Word16) delayCompensationEnabled; hDecoderConfig->Opt_ExternalOrientation = enableExternalOrientation; hDecoderConfig->Opt_dpid_on = (Word16) dpidEnabled; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT IF( NE_32( (UWord16) acousticEnvironmentId, IVAS_DEFAULT_AEID ) ) -#else - IF( NE_32( (Word32) acousticEnvironmentId, 65535 ) ) -#endif { hDecoderConfig->Opt_aeid_on = TRUE; } @@ -814,7 +779,6 @@ ivas_error IVAS_DEC_GetRenderFramesize( } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------* * get_render_frame_size_samples( ) * @@ -847,7 +811,6 @@ static Word16 get_render_frame_size_samples( return tmp; } -#endif /*---------------------------------------------------------------------* @@ -861,9 +824,6 @@ ivas_error IVAS_DEC_GetRenderFramesizeSamples( Word16 *render_framesize /* o : render framesize in samples Q0 */ ) { -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - Word16 tmp; -#endif test(); test(); @@ -872,28 +832,7 @@ ivas_error IVAS_DEC_GetRenderFramesizeSamples( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP *render_framesize = get_render_frame_size_samples( hIvasDec->st_ivas->hDecoderConfig ); -#else - tmp = (Word16) Mpy_32_16_1( hIvasDec->st_ivas->hDecoderConfig->output_Fs, INV_FR_P_S_MX_PRM_SPL_SBFR_Q15 ); - - IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) - { - *render_framesize = tmp; - } - ELSE IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_10MS ) ) - { - *render_framesize = shl( tmp, 1 ); - } - ELSE IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) ) - { - *render_framesize = shl( tmp, 2 ); - } - ELSE - { - *render_framesize = 0; - } -#endif move16(); return IVAS_ERR_OK; @@ -1197,7 +1136,6 @@ ivas_error IVAS_DEC_FeedFrame_Serial( } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------* * isar_get_frame_size( ) * @@ -1244,10 +1182,6 @@ static ivas_error isar_render_poses( bool *needNewFrame /* o : indication that the decoder needs a new frame */ ) { -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - // Note for reviewers: Code in this function was moved and adapted from IVAS_DEC_GetSplitBinauralBitstream, - // see #else branch of FIX_1119_SPLIT_RENDERING_VOIP there for reference -#endif Word16 pcmBuf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k]; Decoder_Struct *st_ivas; ivas_error error; @@ -1310,10 +1244,6 @@ static ivas_error isar_generate_metadata_and_bitstream( Word16 Q_out[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS] /* o : Q-format of each channel of p_head_pose_buf */ ) { -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - // Note for reviewers: Code in this function was moved and adapted from IVAS_DEC_GetSplitBinauralBitstream, - // see #else branch of FIX_1119_SPLIT_RENDERING_VOIP there for reference -#endif ivas_error error; ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; Word16 max_band; @@ -1473,7 +1403,6 @@ static ivas_error isar_generate_metadata_and_bitstream( return IVAS_ERR_OK; } -#endif /* FIX_1119_SPLIT_RENDERING_VOIP */ /*---------------------------------------------------------------------* @@ -1575,11 +1504,7 @@ ivas_error IVAS_DEC_GetSamplesRenderer( hIvasDec->hasBeenFedFrame = false; /* check for possible flushed samples from a rate switch */ -#ifdef FIX_2174_JBM_BASOP_ALIGNMENT IF( GT_16( hIvasDec->nSamplesFlushed, 0 ) ) -#else - IF( GE_16( hIvasDec->nSamplesFlushed, 0 ) ) -#endif { /* note: offset (rendered samples) is always 0 */ Copy( hIvasDec->flushbuffer, pcmBuf, imult1616( hIvasDec->nSamplesFlushed, nOutChannels ) ); @@ -1633,7 +1558,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( bool *needNewFrame /* o : indication that the decoder needs a new frame */ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Decoder_Struct *st_ivas; ivas_error error; Word32 head_pose_buf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k]; @@ -1706,261 +1630,6 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( ivas_syn_output_fx( p_head_pose_buf, Q11, numSamplesPerChannelToOutput, st_ivas->hDecoderConfig->nchan_out, pcmBuf_out ); } -#else - Decoder_Struct *st_ivas; - AUDIO_CONFIG output_config; - Word32 output_Fs; - Word32 *pOutput[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES]; - Word32 Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - Word32 Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; - Word16 numSamplesPerChannelToDecode; - Word16 i, j, k; - ivas_error error; - ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; - Word16 max_band; - Word16 pcm_out_flag; - Word16 td_input; - Word16 numPoses; - Word16 slots_rendered, slots_rendered_new; - Word16 ro_md_flag; - IVAS_QUATERNION Quaternion; - - test(); - IF( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) - { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; - } - - st_ivas = hIvasDec->st_ivas; - output_config = st_ivas->hDecoderConfig->output_config; - output_Fs = st_ivas->hDecoderConfig->output_Fs; - numSamplesPerChannelToDecode = (Word16) ( output_Fs / FRAMES_PER_SEC ); // TODO remove division - - *needNewFrame = false; - hSplitBinRend = st_ivas->hSplitBinRend; - - FOR( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; i++ ) - { - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) - { - FOR( k = 0; k < CLDFB_NO_CHANNELS_MAX; k++ ) - { - Cldfb_RealBuffer_Binaural[i][j][k] = 0; - Cldfb_ImagBuffer_Binaural[i][j][k] = 0; - move32(); - move32(); - } - } - } - - FOR( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; i++ ) - { - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) - { - set32_fx( hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); - set32_fx( hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[i][j], 0, CLDFB_NO_CHANNELS_MAX ); - } - } - - numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; - move16(); - - /* init flush buffer for rate switch if not already initizalized */ - IF( hIvasDec->flushbuffer == NULL ) - { - hIvasDec->flushbuffer = (void *) malloc( numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float ) ); - set16_fx( (Word16 *) hIvasDec->flushbuffer, 0, numPoses * BINAURAL_CHANNELS * hIvasDec->nSamplesFrame / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ); - } - - IF( NE_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_20MS ) && - ( EQ_32( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) || - EQ_16( st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) ) - { - numSamplesPerChannelToDecode = (Word16) ( output_Fs / FRAMES_PER_SEC ); // TODO remove division - numSamplesPerChannelToDecode = (Word16) ( numSamplesPerChannelToDecode / MAX_PARAM_SPATIAL_SUBFRAMES ); // TODO remove division - numSamplesPerChannelToDecode *= (Word16) st_ivas->hDecoderConfig->render_framesize; - move16(); - move16(); - } - - IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 ) - { - return IVAS_ERR_WRONG_PARAMS; - } - - test(); - IF( st_ivas->hTcBuffer == NULL || hIvasDec->hasBeenFedFrame ) - { - slots_rendered = 0; - } - ELSE - { - /* this is needed for OMASA-DISC, because the td-rend granularity is 240 samples at 48kHz, leading to wrong slot count. */ - test(); - IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - slots_rendered = st_ivas->hTcBuffer->n_samples_rendered / NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); // TODO remove division - } - ELSE - { - slots_rendered = st_ivas->hTcBuffer->n_samples_rendered / st_ivas->hTcBuffer->n_samples_granularity; - } - } - - /* Decode and render */ - IF( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, numSamplesPerChannelToDecode, pcmBuf_out, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK ) - { - return error; - } - - IF( !hIvasDec->hasBeenFedFirstGoodFrame ) - { - return IVAS_ERR_OK; - } - - FOR( i = 0; i < BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES; ++i ) - { - pOutput[i] = hSplitBinRend->hMultiBinCldfbData->output_fx[i]; - move32(); - } - - IF( st_ivas->hTcBuffer == NULL ) - { - slots_rendered_new = 0; - move16(); - } - ELSE - { - /* this is needed for OMASA-DISC, because the td-rend granularity is 240 samples at 48kHz, leading to wrong slot count. */ - IF( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - slots_rendered_new = st_ivas->hTcBuffer->n_samples_rendered / NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); // TODO remove division - } - ELSE - { - slots_rendered_new = st_ivas->hTcBuffer->n_samples_rendered / st_ivas->hTcBuffer->n_samples_granularity; // TODO remove division - } - } - - FOR( i = 0; i < i_mult( BINAURAL_CHANNELS, numPoses ); ++i ) - { - FOR( j = slots_rendered; j < slots_rendered_new; ++j ) - { - Copy32( hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[i][j], Cldfb_RealBuffer_Binaural[i][j - slots_rendered], CLDFB_NO_CHANNELS_MAX ); - Copy32( hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[i][j], Cldfb_ImagBuffer_Binaural[i][j - slots_rendered], CLDFB_NO_CHANNELS_MAX ); - } - } - - max_band = (Word16) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); // TODO remove division - move16(); - pcm_out_flag = ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; - td_input = st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC; - - IF( st_ivas->hBinRendererTd != NULL ) - { - ro_md_flag = 1; - move16(); - } - ELSE - { - ro_md_flag = 0; - move16(); - } - - IF( st_ivas->hHeadTrackData != NULL ) - { - Quaternion = st_ivas->hHeadTrackData->Quaternions[0]; - } - ELSE - { - Quaternion.w_fx = -12582912; - Quaternion.x_fx = 0; - Quaternion.y_fx = 0; - Quaternion.z_fx = 0; - } - Word16 q1 = 31, q2 = 31, Q_buff; - Word16 Q_out[CLDFB_NO_COL_MAX]; - Q_out[0] = 31; - Word16 num_poses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; - - FOR( i = 0; i < i_mult( BINAURAL_CHANNELS, numPoses ); i++ ) - { - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) - { - q1 = s_min( q1, L_norm_arr( Cldfb_RealBuffer_Binaural[i][j], CLDFB_NO_CHANNELS_MAX ) ); - q2 = s_min( q2, L_norm_arr( Cldfb_ImagBuffer_Binaural[i][j], CLDFB_NO_CHANNELS_MAX ) ); - } - } - Q_buff = s_min( q1, q2 ); - FOR( i = 0; i < i_mult( BINAURAL_CHANNELS, numPoses ); i++ ) - { - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) - { - scale_sig32( Cldfb_RealBuffer_Binaural[i][j], CLDFB_NO_CHANNELS_MAX, Q_buff ); - scale_sig32( Cldfb_ImagBuffer_Binaural[i][j], CLDFB_NO_CHANNELS_MAX, Q_buff ); - } - } - Q_buff = add( Q_buff, Q6 ); - - IF( NE_16( td_input, 0 ) ) - { - /*TD input*/ - /*if CLDFB handles have been allocated then assume valid multi binaural input in out[][] buffer and perform CLDFB analysis*/ - /* local float2fix, to be removed */ - num_poses = hSplitBinRend->splitrend.multiBinPoseData.num_poses; - - FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i ) - { - Q_out[0] = s_min( Q_out[0], L_norm_arr( pOutput[i], L_FRAME48k ) ); - } - - FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i ) - { - scale_sig32( pOutput[i], L_FRAME48k, Q_out[0] ); - } - Q_out[0] = add( Q_out[0], Q11 ); - Q_out[1] = Q_out[0]; - } - - IF( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hSplitBinRend->splitrend, - Quaternion, - st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, - st_ivas->hRenderConfig->split_rend_config.codec, - st_ivas->hRenderConfig->split_rend_config.isar_frame_size_ms, - st_ivas->hRenderConfig->split_rend_config.codec_frame_size_ms, - splitRendBits, - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural, - max_band, pOutput, 1, !td_input, pcm_out_flag, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) - { - return error; - } - - /* convert to int16 with limiting for BINAURAL_SPLIT_PCM */ - IF( pcm_out_flag ) - { - FOR( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - scale_sig32( pOutput[j], numSamplesPerChannelToDecode, sub( Q11, Q_out[j] ) ); // Q11 - } - IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) - { -#ifndef DISABLE_LIMITER - ivas_limiter_dec_fx( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToDecode, st_ivas->BER_detect, Q11 ); -#endif - } - else - { - ivas_limiter_dec_fx( st_ivas->hLimiter, pOutput, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToDecode, st_ivas->BER_detect, Q11 ); - } - - ivas_syn_output_fx( pOutput, Q11, numSamplesPerChannelToDecode, st_ivas->hDecoderConfig->nchan_out, (Word16 *) pcmBuf_out ); - } - -#ifndef TMP_FIX_SPLIT_REND - free( st_ivas->hSplitBinRend->hMultiBinCldfbData ); -#endif -#endif return IVAS_ERR_OK; } @@ -1973,11 +1642,8 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( *---------------------------------------------------------------------*/ static ivas_error ivas_dec_setup_all( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - UWord8 *nTransportChannels, /* o : number of decoded transport PCM channels */ -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - const Word16 isSplitRend, /* i : split rendering enabled flag */ -#endif + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + UWord8 *nTransportChannels, /* o : number of decoded transport PCM channels */ ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ) { @@ -2002,11 +1668,7 @@ static ivas_error ivas_dec_setup_all( st_ivas = hIvasDec->st_ivas; /* Setup IVAS split rendering */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( splitRendBits != NULL ) -#else - IF( isSplitRend ) -#endif { IF( ( error = isar_set_split_rend_setup( st_ivas->hSplitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hCombinedOrientationData, splitRendBits ) ) != IVAS_ERR_OK ) { @@ -2041,11 +1703,7 @@ static ivas_error ivas_dec_setup_all( *-----------------------------------------------------------------*/ test(); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( EQ_16( st_ivas->ini_frame, 0 ) && splitRendBits != NULL ) -#else - IF( st_ivas->ini_frame == 0 && isSplitRend ) -#endif { IF( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK ) { @@ -2146,7 +1804,6 @@ ivas_error IVAS_DEC_GetFormat( } move32(); -#ifdef DECODER_FORMAT_SWITCHING test(); IF( EQ_32( *format, IVAS_DEC_BS_MASA ) && hIvasDec->st_ivas->hMasa != NULL ) { @@ -2156,14 +1813,6 @@ ivas_error IVAS_DEC_GetFormat( move32(); } } -#else - test(); - if ( EQ_32( *format, IVAS_DEC_BS_MASA ) && EQ_32( hIvasDec->st_ivas->hMasa->config.input_ivas_format, MASA_ISM_FORMAT ) ) - { - *format = IVAS_DEC_BS_MASA_ISM; - move32(); - } -#endif return IVAS_ERR_OK; } @@ -2970,7 +2619,6 @@ ivas_error IVAS_DEC_HRTF_binary_close( } -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /*---------------------------------------------------------------------* * IVAS_DEC_AddAcousticEnvironment( ) * @@ -3210,7 +2858,6 @@ ivas_error IVAS_DEC_GetAcousticEnvironment( } } -#endif /*---------------------------------------------------------------------* * copyRendererConfigStruct( ) @@ -3228,10 +2875,8 @@ static ivas_error copyRendererConfigStruct( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT hRCout->roomAcoustics.aeID = hRCin->roomAcoustics.aeID; move16(); -#endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay_fx = hRCin->roomAcoustics.acousticPreDelay_fx; hRCout->roomAcoustics.inputPreDelay_fx = hRCin->roomAcoustics.inputPreDelay_fx; @@ -3329,10 +2974,8 @@ ivas_error IVAS_DEC_FeedRenderConfig( hRenderConfig = hIvasDec->st_ivas->hRenderConfig; st_ivas = hIvasDec->st_ivas; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT hRenderConfig->roomAcoustics.aeID = renderConfig.roomAcoustics.aeID; move16(); -#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; hRenderConfig->roomAcoustics.acousticPreDelay_fx = renderConfig.roomAcoustics.acousticPreDelay_fx; hRenderConfig->roomAcoustics.inputPreDelay_fx = renderConfig.roomAcoustics.inputPreDelay_fx; @@ -3428,7 +3071,6 @@ ivas_error IVAS_DEC_FeedRenderConfig( return IVAS_ERR_OK; } -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /*---------------------------------------------------------------------* * feedAcousticEnvPI( ) @@ -3574,7 +3216,6 @@ static ivas_error feedAcousticEnvPI( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* * IVAS_DEC_GetDelay( ) @@ -4037,9 +3678,6 @@ ivas_error IVAS_DEC_ReadFormat( { ivas_error error; Decoder_Struct *st_ivas; -#ifndef DECODER_FORMAT_SWITCHING - IVAS_FORMAT ivas_format_old; -#endif ISM_MODE ism_mode_old; MC_MODE mc_mode_old; Word16 nchan_transport_old; @@ -4053,9 +3691,6 @@ ivas_error IVAS_DEC_ReadFormat( } st_ivas = hIvasDec->st_ivas; -#ifndef DECODER_FORMAT_SWITCHING - ivas_format_old = st_ivas->ivas_format; -#endif ism_mode_old = st_ivas->ism_mode; mc_mode_old = st_ivas->mc_mode; nchan_transport_old = st_ivas->nchan_transport; @@ -4064,9 +3699,6 @@ ivas_error IVAS_DEC_ReadFormat( renderer_type_old = st_ivas->renderer_type; renderer_type_sec_old = ivas_renderer_secondary_select_fx( st_ivas ); move32(); -#ifndef DECODER_FORMAT_SWITCHING - move32(); -#endif move32(); move16(); move32(); @@ -4089,21 +3721,10 @@ ivas_error IVAS_DEC_ReadFormat( return error; } -#ifdef DECODER_FORMAT_SWITCHING IF( EQ_16( st_ivas->restartNeeded, 1 ) ) { return IVAS_ERR_OK; } -#else - - test(); - test(); - test(); - IF( NE_32( ivas_format_old, st_ivas->ivas_format ) && GT_16( st_ivas->ini_frame, 0 ) && ( NE_32( st_ivas->ivas_format, MASA_FORMAT ) && NE_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) ) ) - { - return ( IVAS_ERROR( IVAS_ERR_INVALID_INPUT_FORMAT, "IVAS format switching is not allowed." ) ); - } -#endif /* Select binaural renderer */ ivas_renderer_select( st_ivas ); @@ -4272,10 +3893,7 @@ static ivas_error apa_exec_evs_wrapper( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetSamplesDecoder( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifndef FIX_1119_SPLIT_RENDERING_VOIP - const Word16 isSplitRend, /* i : split rendering enabled flag */ -#endif + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o : output split rendering bits */ ) { @@ -4309,11 +3927,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( * Setup all decoder parts (IVAS decoder, ISAR) *-----------------------------------------------------------------*/ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( NE_32( ( error = ivas_dec_setup_all( hIvasDec, &nTransportChannels, splitRendBits ) ), IVAS_ERR_OK ) ) -#else - IF( ( error = ivas_dec_setup_all( hIvasDec, &nTransportChannels, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -4402,11 +4016,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder( IF( st_ivas->hDecoderConfig->Opt_tsm ) { /* feed residual samples to TSM for the next call */ -#ifdef FIX_2174_JBM_BASOP_ALIGNMENT IF( apa_set_renderer_residual_samples( hIvasDec->hTimeScaler, (UWord16) nResidualSamples ) != 0 ) -#else - IF( apa_set_renderer_residual_samples( hIvasDec->hTimeScaler, (uint16_t) nResidualSamples ) != 0 ) -#endif { return IVAS_ERR_UNKNOWN; } @@ -4447,10 +4057,8 @@ ivas_error IVAS_DEC_GetSamplesDecoder( move32(); hIsmMetaData[obj]->edited_radius_fx = hIsmMetaData[obj]->radius_fx; move32(); -#ifdef FIX_2148_OBJ_EDIT_ISSUE_WITH_OSBA hIsmMetaData[obj]->edited_gain_fx = ONE_IN_Q29; move32(); -#endif } if ( EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) ) @@ -4738,7 +4346,6 @@ ivas_error IVAS_DEC_SetEditableParameters( move32(); st_ivas->hIsmMetaData[obj]->edited_pitch_fx = hIvasEditableParameters.ism_metadata[obj].pitch_fx; move32(); -#ifdef FIX_GAIN_EDIT_LIMITS IF( GT_32( hIvasEditableParameters.ism_metadata[obj].gain_fx, EDIT_GAIN_MAX_Q29 ) ) { st_ivas->hIsmMetaData[obj]->edited_gain_fx = EDIT_GAIN_MAX_Q29; @@ -4749,17 +4356,12 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hIsmMetaData[obj]->edited_gain_fx = hIvasEditableParameters.ism_metadata[obj].gain_fx; move32(); } -#else - st_ivas->hIsmMetaData[obj]->edited_gain_fx = hIvasEditableParameters.ism_metadata[obj].gain_fx; - move32(); -#endif st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; move16(); } IF( EQ_32( ism_mode, ISM_SBA_MODE_DISC ) ) { -#ifdef FIX_GAIN_EDIT_LIMITS IF( GT_32( hIvasEditableParameters.gain_bed_fx, EDIT_GAIN_MAX_Q29 ) ) { st_ivas->hSbaIsmData->gain_bed_fx = EDIT_GAIN_MAX_Q29; @@ -4770,10 +4372,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hSbaIsmData->gain_bed_fx = hIvasEditableParameters.gain_bed_fx; move32(); } -#else - st_ivas->hSbaIsmData->gain_bed_fx = hIvasEditableParameters.gain_bed_fx; - move32(); -#endif } } ELSE IF( EQ_32( ism_mode, ISM_MODE_PARAM ) ) @@ -4790,7 +4388,6 @@ ivas_error IVAS_DEC_SetEditableParameters( IF( st_ivas->hMasaIsmData != NULL ) { -#ifdef FIX_GAIN_EDIT_LIMITS /* Limit gain edit to a range of +12dB to -24dB with parametric ISM mode */ IF( GT_32( hIvasEditableParameters.gain_bed_fx, EDIT_GAIN_MAX_Q29 ) ) { @@ -4807,10 +4404,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hMasaIsmData->gain_ism_edited_fx[obj] = shr( extract_h( hIvasEditableParameters.ism_metadata[obj].gain_fx ), Q1 ); // Q29 -> Q12 move16(); } -#else - st_ivas->hMasaIsmData->gain_ism_edited_fx[obj] = shr( extract_h( hIvasEditableParameters.ism_metadata[obj].gain_fx ), Q1 ); // Q29 -> Q12 - move32(); -#endif /* Detect direction editing in Param-ISM mode */ IF( GT_32( L_abs( L_sub( st_ivas->hParamIsmDec->azimuth_values_fx[obj], hIvasEditableParameters.ism_metadata[obj].azimuth_fx ) ), OMASA_AZI_EDIT_THR_Q22 ) || // | azi_orig[obj] - azi_edit[obj] | > azi_threshold @@ -4951,7 +4544,6 @@ ivas_error IVAS_DEC_SetEditableParameters( IF( GT_16( abs_s( sub( shr( extract_h( st_ivas->hIsmMetaData[obj]->edited_gain_fx ), Q1 ), shr( extract_h( hIvasEditableParameters.ism_metadata[obj].gain_fx ), Q1 ) ) ), OMASA_GAIN_EDIT_THR_Q12 ) ) // | gain_edit[obj] - gain_orig[obj] | > gain_threshold { st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1; -#ifdef FIX_GAIN_EDIT_LIMITS /* Limit gain edit to a range of +12dB to -24dB with parametric OMASA mode */ test(); IF( GT_32( hIvasEditableParameters.ism_metadata[obj].gain_fx, EDIT_GAIN_MAX_Q29 ) ) @@ -4969,10 +4561,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hMasaIsmData->gain_ism_edited_fx[obj] = shr( extract_h( hIvasEditableParameters.ism_metadata[obj].gain_fx ), Q1 ); // Q29 --> Q12 move16(); } -#else - st_ivas->hMasaIsmData->gain_ism_edited_fx[obj] = shr( extract_h( hIvasEditableParameters.ism_metadata[obj].gain_fx ), Q1 ); // Q29 --> Q12 - move16(); -#endif } ELSE { @@ -4988,7 +4576,6 @@ ivas_error IVAS_DEC_SetEditableParameters( move32(); st_ivas->hIsmMetaData[obj]->edited_elevation_fx = hIvasEditableParameters.ism_metadata[obj].elevation_fx; move32(); -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA IF( EQ_16( ism_mode, ISM_MASA_MODE_DISC ) ) { st_ivas->hIsmMetaData[obj]->edited_yaw_fx = hIvasEditableParameters.ism_metadata[obj].yaw_fx; @@ -4998,15 +4585,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hIsmMetaData[obj]->edited_radius_fx = hIvasEditableParameters.ism_metadata[obj].radius_fx; move16(); } -#else - st_ivas->hIsmMetaData[obj]->edited_yaw_fx = hIvasEditableParameters.ism_metadata[obj].yaw_fx; - move32(); - st_ivas->hIsmMetaData[obj]->edited_pitch_fx = hIvasEditableParameters.ism_metadata[obj].pitch_fx; - move32(); - st_ivas->hIsmMetaData[obj]->edited_radius_fx = hIvasEditableParameters.ism_metadata[obj].radius_fx; - move32(); -#endif -#ifdef FIX_GAIN_EDIT_LIMITS test(); IF( GT_32( hIvasEditableParameters.ism_metadata[obj].gain_fx, EDIT_GAIN_MAX_Q29 ) ) { @@ -5020,10 +4598,6 @@ ivas_error IVAS_DEC_SetEditableParameters( { st_ivas->hIsmMetaData[obj]->edited_gain_fx = hIvasEditableParameters.ism_metadata[obj].gain_fx; } -#else - st_ivas->hIsmMetaData[obj]->edited_gain_fx = hIvasEditableParameters.ism_metadata[obj].gain_fx; - move32(); -#endif st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; move16(); } @@ -5031,7 +4605,6 @@ ivas_error IVAS_DEC_SetEditableParameters( IF( GT_16( abs_s( sub( shr( extract_h( hIvasEditableParameters.gain_bed_fx ), Q1 ), ONE_IN_Q12 ) ), OMASA_GAIN_EDIT_THR_Q12 ) ) // | gain_bed - 1.0f | > gain_threshold { -#ifdef FIX_GAIN_EDIT_LIMITS /* Limit gain edit to a range of +12dB to -24dB with parametric OMASA mode */ test(); IF( GT_32( hIvasEditableParameters.gain_bed_fx, EDIT_GAIN_MAX_Q29 ) ) @@ -5049,10 +4622,6 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hMasaIsmData->gain_masa_edited_fx = shr( extract_h( hIvasEditableParameters.gain_bed_fx ), Q1 ); move16(); } -#else - st_ivas->hMasaIsmData->gain_masa_edited_fx = shr( extract_h( hIvasEditableParameters.gain_bed_fx ), Q1 ); - move32(); -#endif st_ivas->hMasaIsmData->masa_gain_is_edited = 1; } ELSE @@ -5095,8 +4664,6 @@ ivas_error IVAS_DEC_PrepareRenderer( } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP - /*---------------------------------------------------------------------* * ivas_dec_voip_get_samples_common( ) * @@ -5106,23 +4673,13 @@ ivas_error IVAS_DEC_PrepareRenderer( static ivas_error ivas_dec_voip_get_samples_common -#else -/*---------------------------------------------------------------------* - * IVAS_DEC_VoIP_GetSamples( ) - * - * Main function to decode one frame in VoIP - *---------------------------------------------------------------------*/ -ivas_error IVAS_DEC_VoIP_GetSamples -#endif ( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - UWord16 nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ - /* const IVAS_DEC_PCM_TYPE pcmType, */ /* i : type for the decoded PCM resolution */ - Word16 *pcmBuf, /* o : output synthesis signal */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + UWord16 nSamplesPerChannel, /* i : number of samples per channel requested to be written to output buffer */ + /* const IVAS_DEC_PCM_TYPE pcmType, */ /* i : type for the decoded PCM resolution */ + Word16 *pcmBuf, /* o : output synthesis signal */ ISAR_SPLIT_REND_BITS_DATA *splitRendBits, /* o : output split rendering bits */ Word32 **p_head_pose_buf, /* i : PCM buffer with head-pose data */ -#endif #ifdef SUPPORT_JBM_TRACEFILE JbmTraceFileWriterFn jbmWriterFn, void *jbmWriter, @@ -5164,7 +4721,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples return IVAS_ERR_WRONG_PARAMS; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP test(); test(); IF( ( EQ_32( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || @@ -5173,7 +4729,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#endif /* make sure that the FIFO after decoder/scaler contains at least one sound card frame (i.e. 20ms) */ WHILE( LT_16( *nSamplesRendered, nSamplesPerChannel ) ) @@ -5343,11 +4898,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples test(); IF( hIvasDec->nSamplesAvailableNext == 0 || EQ_16( hIvasDec->nSamplesAvailableNext, hIvasDec->nSamplesFrame ) ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( NE_32( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ), IVAS_ERR_OK ) ) -#else - IF( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, 0, 0 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -5372,7 +4923,6 @@ ivas_error IVAS_DEC_VoIP_GetSamples } } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( splitRendBits != NULL ) { /* Render head poses from time-scaled transport channels */ @@ -5381,63 +4931,55 @@ ivas_error IVAS_DEC_VoIP_GetSamples return error; } } - ELSE - { -#endif + ELSE{ /* render IVAS frames directly to the output buffer */ - IF( NE_32( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmBuf + imult1616( *nSamplesRendered, nOutChannels ), &nSamplesRendered_loop, &tmp ) ), IVAS_ERR_OK ) ) - { + IF( NE_32( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, pcmBuf + imult1616( *nSamplesRendered, nOutChannels ), &nSamplesRendered_loop, &tmp ) ), IVAS_ERR_OK ) ){ return error; - } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP - } -#endif - - *nSamplesRendered = add( *nSamplesRendered, nSamplesRendered_loop ); - update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); } } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP - IF( hIvasDec->hasDecodedFirstGoodFrame && splitRendBits != NULL ) + *nSamplesRendered = add( *nSamplesRendered, nSamplesRendered_loop ); + update_voip_rendered20ms( hIvasDec, nSamplesRendered_loop ); +} +} + +IF( hIvasDec->hasDecodedFirstGoodFrame &&splitRendBits != NULL ) +{ + Word16 Q_out[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; + Word16 i; + + /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */ + IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ), IVAS_ERR_OK ) ) { - Word16 Q_out[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; - Word16 i; + return error; + } - /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */ - IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ), IVAS_ERR_OK ) ) + /* Synthesise PCM output if split PCM */ + IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + { + FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) { - return error; + scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11 } - /* Synthesise PCM output if split PCM */ - IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) { - FOR( i = 0; i < BINAURAL_CHANNELS; i++ ) - { - scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11 - } - - IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) ) - { #ifndef DISABLE_LIMITER - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); #endif - } - ELSE - { - ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); - } - - ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); } + ELSE + { + ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 ); + } + + ivas_syn_output_fx( p_head_pose_buf, Q11, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, pcmBuf ); } -#endif +} - return IVAS_ERR_OK; +return IVAS_ERR_OK; } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_GetSamples( ) @@ -5534,7 +5076,6 @@ ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream( parametersAvailableForEditing, systemTimestamp_ms ); } -#endif /*---------------------------------------------------------------------* @@ -5628,7 +5169,6 @@ ivas_error IVAS_DEC_Flush( } -#ifdef DECODER_FORMAT_SWITCHING /*---------------------------------------------------------------------* * IVAS_DEC_isRestartNeeded( ) * @@ -5658,7 +5198,6 @@ ivas_error IVAS_DEC_isRestartNeeded( } -#endif /*---------------------------------------------------------------------* * IVAS_DEC_VoIP_IsEmpty( ) * @@ -5900,7 +5439,6 @@ static ivas_error printConfigInfo_dec( } ELSE { -#ifdef FIX_1419_MONO_STEREO_UMX output_config = st_ivas->hDecoderConfig->output_config; IF( NE_16( (Word16) output_config, IVAS_AUDIO_CONFIG_MONO ) ) { @@ -5909,11 +5447,8 @@ static ivas_error printConfigInfo_dec( } ELSE { -#endif fprintf( stdout, "Output configuration: mono EVS bit-exact decoding\n" ); -#ifdef FIX_1419_MONO_STEREO_UMX } -#endif } } ELSE @@ -6097,11 +5632,7 @@ static ivas_error evs_dec_main_fx( { DEC_CORE_HANDLE *hCoreCoder; Word16 mixer_left_fx, mixer_right_fx; -#ifdef FIX_1419_MONO_STEREO_UMX Word32 *p_output_fx[MAX_TRANSPORT_CHANNELS]; -#else - Word32 *p_output_fx[MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN]; -#endif Word16 ch, i, nOutSamples; Word16 output_16[L_FRAME48k]; ivas_error error; @@ -6116,19 +5647,13 @@ static ivas_error evs_dec_main_fx( mdct_switching_dec_fx( hCoreCoder[0] ); -#ifdef FIX_1419_MONO_STEREO_UMX FOR( ch = 0; ch < MAX_TRANSPORT_CHANNELS; ch++ ) -#else - FOR( ch = 0; ch < MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN; ch++ ) -#endif { p_output_fx[ch] = st_ivas->p_output_fx[ch]; // Q0 -#ifdef FIX_1419_MONO_STEREO_UMX IF( p_output_fx[ch] != NULL ) { set_zero_fx( p_output_fx[ch], L_FRAME48k ); } -#endif } /* run the main EVS decoding routine */ @@ -6190,12 +5715,8 @@ static ivas_error evs_dec_main_fx( v_multc_fx_16( p_output_fx[0], mixer_left_fx, p_output_fx[0], nOutSamples ); /* Q11 */ } -#ifdef FIX_1419_MONO_STEREO_UMX test(); IF( st_ivas->hDecoderConfig->Opt_tsm && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) ) -#else - IF( st_ivas->hDecoderConfig->Opt_tsm ) -#endif { /* BE workaround: in order to keep EVS bit-exact wrt. TS 26.443, convert 'float' output data to 'short' before the TSM */ /* not applicable in BASOP */ @@ -6447,9 +5968,7 @@ static ivas_error ivas_create_handle_isar( ) { ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word16 i; -#endif IF( ( hSplitBinRend = (ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_WRAPPER ) ) ) == NULL ) { @@ -6458,15 +5977,11 @@ static ivas_error ivas_create_handle_isar( isar_init_split_rend_handles( &hSplitBinRend->splitrend ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP hSplitBinRend->hMultiBinTdData = NULL; FOR( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) { hSplitBinRend->hMultiBinCldfbData[i] = NULL; } -#else - hSplitBinRend->hMultiBinCldfbData = NULL; -#endif hSplitBinRend->hCldfbDataOut = NULL; hSplitBinRend->numTdSamplesPerChannelCached = 0; move16(); @@ -6487,13 +6002,10 @@ static void ivas_destroy_handle_isar( ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE *hSplitBinRend /* i/o: ISAR split binaural rendering handle */ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word16 i; -#endif IF( *hSplitBinRend != NULL ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( ( *hSplitBinRend )->hMultiBinTdData != NULL ) { ivas_TD_RINGBUF_Close( &( *hSplitBinRend )->hMultiBinTdData ); @@ -6506,12 +6018,6 @@ static void ivas_destroy_handle_isar( ivas_CLDFB_RINGBUF_Close( &( *hSplitBinRend )->hMultiBinCldfbData[i] ); } } -#else -#ifdef TMP_FIX_SPLIT_REND - free( ( *hSplitBinRend )->hMultiBinCldfbData ); - ( *hSplitBinRend )->hMultiBinCldfbData = NULL; -#endif -#endif ISAR_PRE_REND_close( &( *hSplitBinRend )->splitrend, NULL ); @@ -6719,7 +6225,6 @@ static ivas_error ivas_dec_reconfig_split_rend( } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*-------------------------------------------------------------------* * ivas_dec_split_rend_cldfb_in() * @@ -6745,7 +6250,6 @@ static Word16 ivas_dec_split_rend_cldfb_in( return 0; } } -#endif /*-------------------------------------------------------------------* @@ -6761,10 +6265,8 @@ static ivas_error ivas_dec_init_split_rend( ivas_error error; Word16 cldfb_in_flag, pcm_out_flag; Word16 mixed_td_cldfb_flag; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word16 i, num_poses; ISAR_SPLIT_REND_ROT_AXIS head_rot_axis; -#endif pcm_out_flag = 0; move16(); @@ -6776,29 +6278,8 @@ static ivas_error ivas_dec_init_split_rend( cldfb_in_flag = 0; move16(); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP cldfb_in_flag = ivas_dec_split_rend_cldfb_in( st_ivas->renderer_type ); -#else - -#ifdef TMP_FIX_SPLIT_REND - /* note: this is intra-frame heap memory */ - IF( ( st_ivas->hSplitBinRend->hMultiBinCldfbData = (ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE) malloc( sizeof( ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" ); - } -#endif - IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || - EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || - EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || - EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) - { - cldfb_in_flag = 1; - move16(); - } -#endif - -#ifdef FIX_1119_SPLIT_RENDERING_VOIP head_rot_axis = DEFAULT_AXIS; move32(); if ( st_ivas->hHeadTrackData != NULL ) @@ -6831,10 +6312,6 @@ static ivas_error ivas_dec_init_split_rend( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" ); } } -#else - - ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS ); -#endif IF( EQ_16( cldfb_in_flag, 1 ) && ( EQ_16( st_ivas->hSplitBinRend->splitrend.multiBinPoseData.poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ) ) { @@ -6901,7 +6378,6 @@ ivas_error IVAS_DEC_is_split_rendering_coded_out( return IVAS_ERR_OK; } -#ifdef IVAS_RTPDUMP /*---------------------------------------------------------------------* * feedSinglePIorientation( ) @@ -6964,9 +6440,6 @@ static ivas_error feedSinglePIorientation( return IVAS_ERR_OK; } -#endif - -#ifdef RTP_S4_251135_CR26253_0016_REV1 /*---------------------------------------------------------------------* * setDiegeticInput( ) @@ -6996,9 +6469,7 @@ static void setDiegeticInputPI( return; } -#endif -#ifdef IVAS_RTPDUMP /*---------------------------------------------------------------------* * IVAS_DEC_FeedPiDataToDecoder( ) * @@ -7059,7 +6530,6 @@ ivas_error IVAS_DEC_FeedPiDataToDecoder( } BREAK; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT case IVAS_PI_ACOUSTIC_ENVIRONMENT: { UWord16 aeid; @@ -7076,9 +6546,7 @@ ivas_error IVAS_DEC_FeedPiDataToDecoder( } } BREAK; -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 case IVAS_PI_DIEGETIC_TYPE: { #ifdef DEBUGGING @@ -7087,7 +6555,6 @@ ivas_error IVAS_DEC_FeedPiDataToDecoder( setDiegeticInputPI( hIvasDec, piData->data.digeticIndicator.isDiegetic ); } BREAK; -#endif default: { @@ -7106,4 +6573,3 @@ ivas_error IVAS_DEC_FeedPiDataToDecoder( return IVAS_ERR_OK; } -#endif diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 32ef7364d..57072b9a4 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -1309,11 +1309,7 @@ typedef struct Decoder_State Word16 Q_syn; Word16 Q_syn2; Word16 Q_syn_cng; -#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE Word16 Q_syn_factor; // This q_factor is used to avoid using fix Q0 for synth[] at the output of con_tcx_ivas_fx() and ivas_core_dec_fx(). For con_tcx_ivas_fx, it is used for two consecutive TCX concealment processes and It cannot be greater than 0. -#else - Word16 Q_syn_factor; // This q_factor is used to avoid using fixed Q0 for synth[] at the output of con_tcx_ivas_fx(). It is then used for two consecutive TCX concealment processes. It cannot be greater than 0. -#endif Word16 prev_Q_syn; Word16 prev_Q_bwe_exc; diff --git a/lib_dec/tonalMDCTconcealment_fx.c b/lib_dec/tonalMDCTconcealment_fx.c index 1f37ae4bd..767e5c8e7 100644 --- a/lib_dec/tonalMDCTconcealment_fx.c +++ b/lib_dec/tonalMDCTconcealment_fx.c @@ -3098,7 +3098,6 @@ void TonalMdctConceal_create_concealment_noise_ivas_fx( move32(); IF( concealment_noise[i] != 0 ) { -#ifdef NONBE_FIX_2237_ZERO_CURR_NOISE_PROBLEM Word32 cnp; Word16 cnp_e; @@ -3108,9 +3107,6 @@ void TonalMdctConceal_create_concealment_noise_ivas_fx( cnp_e = shl( sub( *concealment_noise_exp, cnp_e ), 1 ); hTonalMDCTConc->curr_noise_nrg = BASOP_Util_Add_Mant32Exp( hTonalMDCTConc->curr_noise_nrg, hTonalMDCTConc->curr_noise_nrg_exp, cnp, cnp_e, &temp_e ); // Q31-temp_e -#else - hTonalMDCTConc->curr_noise_nrg = BASOP_Util_Add_Mant32Exp( hTonalMDCTConc->curr_noise_nrg, hTonalMDCTConc->curr_noise_nrg_exp, Mpy_32_32( concealment_noise[i], concealment_noise[i] ), shl( *concealment_noise_exp, 1 ), &temp_e ); // Q31-temp_e -#endif } hTonalMDCTConc->curr_noise_nrg_exp = temp_e; move16(); @@ -3130,7 +3126,6 @@ void TonalMdctConceal_create_concealment_noise_ivas_fx( move32(); IF( concealment_noise[i] != 0 ) { -#ifdef NONBE_FIX_2237_ZERO_CURR_NOISE_PROBLEM Word32 cnp; Word16 cnp_e; @@ -3140,9 +3135,6 @@ void TonalMdctConceal_create_concealment_noise_ivas_fx( cnp_e = shl( sub( *concealment_noise_exp, cnp_e ), 1 ); hTonalMDCTConc->curr_noise_nrg = BASOP_Util_Add_Mant32Exp( hTonalMDCTConc->curr_noise_nrg, hTonalMDCTConc->curr_noise_nrg_exp, cnp, cnp_e, &temp_e ); // Q31-temp_e -#else - hTonalMDCTConc->curr_noise_nrg = BASOP_Util_Add_Mant32Exp( hTonalMDCTConc->curr_noise_nrg, hTonalMDCTConc->curr_noise_nrg_exp, Mpy_32_32( concealment_noise[i], concealment_noise[i] ), shl( *concealment_noise_exp, 1 ), &temp_e ); // Q31-temp_e -#endif } hTonalMDCTConc->curr_noise_nrg_exp = temp_e; move16(); diff --git a/lib_enc/bw_detect_fx.c b/lib_enc/bw_detect_fx.c index 66fb8680b..acf0d322a 100644 --- a/lib_enc/bw_detect_fx.c +++ b/lib_enc/bw_detect_fx.c @@ -55,11 +55,7 @@ void bw_detect_fx( Word16 spect[L_FRAME48k], spect_bin[BWD_N_BINS_MAX]; Word32 spect32[L_FRAME48k], in_win32[BWD_TOTAL_WIDTH]; Word16 e_tmp, f_tmp; -#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA Word32 L_tmp, sum32, L_tmp_q_shift; -#else - Word32 L_tmp, sum32; -#endif Word32 L_tmp1, L_tmp2, L_tmp3; Word16 scale; @@ -121,32 +117,19 @@ void bw_detect_fx( move32(); /* Q31 */ cldfb_bin_Exp[0] = add( cldfb_bin_Exp[0], CLDFBscalingFactor_EXP ); move16(); -#ifdef FIX_2141_ASSERT_IN_OMASA_BITRATE_SWITSCHING if ( cldfb_bin[0] == 0 ) { cldfb_bin[0] = L_deposit_l( 1 ); move32(); } -#else - if ( cldfb_bin[i] == 0 ) - { - cldfb_bin[i] = L_deposit_l( 1 ); - move32(); - } -#endif - L_tmp = BASOP_Util_Log2( cldfb_bin[0] ); /*(log2(660423549*2^(-31))/64)*2^31*/ -#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA + L_tmp = BASOP_Util_Log2( cldfb_bin[0] ); /*(log2(660423549*2^(-31))/64)*2^31*/ L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ). L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25 L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 ); // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ). cldfb_bin[0] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */ -#else - L_tmp = L_add_sat( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[0] ), 31 - LD_DATA_SCALE ) ); /* Q25 */ - cldfb_bin[0] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ ); -#endif - move32(); /* 1/log2(10) */ /* Q25 */ + move32(); /* 1/log2(10) */ /* Q25 */ /* WB: 4.4 - 7.2 kHz, 8 cldfb-bands, mid band(14) counted twice */ IF( GE_32( st->input_Fs, 16000 ) ) @@ -173,19 +156,14 @@ void bw_detect_fx( cldfb_bin[i] = L_deposit_l( 1 ); move32(); } - L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/ -#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA + L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/ L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ). L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25 L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 ); // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ). cldfb_bin[i] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */ -#else - L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */ - cldfb_bin[i] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ ); -#endif - move32(); /* 1/log2(10) */ /* Q25 */ + move32(); /* 1/log2(10) */ /* Q25 */ } } @@ -221,19 +199,14 @@ void bw_detect_fx( cldfb_bin[i] = L_deposit_l( 1 ); move32(); } - L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/ -#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA + L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/ L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ). L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25 L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 ); // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ). cldfb_bin[i] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */ -#else - L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */ - cldfb_bin[i] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ ); -#endif - move32(); /* 1/log2(10) */ /* Q25 */ + move32(); /* 1/log2(10) */ /* Q25 */ } } @@ -263,19 +236,14 @@ void bw_detect_fx( cldfb_bin[i] = L_deposit_l( 1 ); move32(); } - L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/ -#ifdef FIX_2210_ASSERT_IN_BW_DETEC_FX_FOR_OMASA + L_tmp = BASOP_Util_Log2( cldfb_bin[i] ); /*(log2(660423549*2^(-31))/64)*2^31*/ L_tmp = Mpy_32_16_1( L_tmp, INV_LOG2_10 ); // instead of adding it to L_tmp_q_shift and then multiplying by INV_LOG2_10 ( to avoid saturation ). L_tmp_q_shift = L_shl_sat( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ); // This term should be added to L_temp to align it to Q25 L_tmp_q_shift = Mpy_32_16_1( L_tmp_q_shift, INV_LOG2_10 ); // instead of adding it to L_tmp and then multiplying by INV_LOG2_10 ( to avoid saturation ). cldfb_bin[i] = L_add( L_tmp, L_tmp_q_shift ); /* Q25 */ -#else - L_tmp = L_add( L_tmp, L_shl( L_deposit_l( cldfb_bin_Exp[i] ), 31 - LD_DATA_SCALE ) ); /* Q25 */ - cldfb_bin[i] = Mpy_32_16_1( L_tmp, 9864 /*1.0f/3.3219280948873623478703194294894f Q15*/ ); -#endif - move32(); /* 1/log2(10) */ /* Q25 */ + move32(); /* 1/log2(10) */ /* Q25 */ } } /* cldfb_bin_Exp[] are applied now in cldfb_bin[i] -> don't use again */ diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index 3dbf072ec..15a412049 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -10,9 +10,7 @@ #include "ivas_cnst.h" #include "stl.h" #include "rom_com.h" -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG #include "ivas_rom_com.h" -#endif #include "rom_enc.h" #include "prot_fx.h" #include "prot_fx_enc.h" @@ -156,16 +154,11 @@ void initFdCngEnc_fx( hsEnc->msPeriodogBufPtr = 0; move16(); set32_fx( hsEnc->msPsdSecondMoment_fx, 0, NPART ); -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG FOR( Word16 i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) { set32_fx( hsEnc->mem_coherence_fx[i], EPSILON_FX, 4 ); set16_fx( hsEnc->mem_coherence_exp[i], 0, 4 ); } -#else - set32_fx( hsEnc->mem_coherence_fx, EPSILON_FX, 4 ); - set16_fx( hsEnc->mem_coherence_exp, 0, 4 ); -#endif return; } @@ -2686,16 +2679,11 @@ void stereoFdCngCoherence_fx( IF( NE_16( last_element_mode, IVAS_CPE_MDCT ) ) { -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG FOR( i = 0; i < MDCT_ST_DTX_NUM_COHERENCE_BANDS; i++ ) { set32_fx( sts[0]->hFdCngEnc->mem_coherence_fx[i], EPSILON_FX, 4 ); set16_fx( sts[0]->hFdCngEnc->mem_coherence_exp[i], 0, 4 ); } -#else - set32_fx( sts[0]->hFdCngEnc->mem_coherence_fx, EPSILON_FX, 4 ); - set16_fx( sts[0]->hFdCngEnc->mem_coherence_exp, 0, 4 ); -#endif } test(); test(); @@ -2760,10 +2748,6 @@ void stereoFdCngCoherence_fx( pt_fftL = fft_buf_fx[0]; pt_fftR = fft_buf_fx[1]; -#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG - mem = sts[0]->hFdCngEnc->mem_coherence_fx; /* exp(sts[0]->hFdCngEnc->mem_coherence_exp) */ - mem_exp = sts[0]->hFdCngEnc->mem_coherence_exp; -#endif /* only estimate coherence in inactive frames (or in the first 50 frames to build an initial value) */ test(); @@ -2774,7 +2758,6 @@ void stereoFdCngCoherence_fx( return; } -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG FOR( i_subfr = 0; i_subfr < 2; i_subfr++ ) { Word16 band_len_cum; @@ -2849,59 +2832,7 @@ void stereoFdCngCoherence_fx( pt_fftR += L_FFT; } -#else - FOR( i_subfr = 0; i_subfr < 2; i_subfr++ ) - { - cr = ci = eL = eR = EPSILON_FX; - move32(); - move32(); - move32(); - move32(); - cr_exp = ci_exp = eL_exp = eR_exp = 0; - move16(); - move16(); - move16(); - move16(); - - cr = BASOP_Util_Add_Mant32Exp( cr, cr_exp, L_add( L_mult( pt_fftL[0], pt_fftR[0] ), L_mult( pt_fftL[L_FFT / 2], pt_fftR[L_FFT / 2] ) ), shl( fft_exp, 1 ), &cr_exp ); /* exp(cr_exp) */ - eL = BASOP_Util_Add_Mant32Exp( eL, eL_exp, L_add( L_mult( pt_fftL[0], pt_fftL[0] ), L_mult( pt_fftL[L_FFT / 2], pt_fftL[L_FFT / 2] ) ), shl( fft_exp, 1 ), &eL_exp ); /* exp(eL_exp) */ - eR = BASOP_Util_Add_Mant32Exp( eR, eR_exp, L_add( L_mult( pt_fftR[0], pt_fftR[0] ), L_mult( pt_fftR[L_FFT / 2], pt_fftR[L_FFT / 2] ) ), shl( fft_exp, 1 ), &eR_exp ); /* exp(eR_exp) */ - - FOR( i = 1; i < L_FFT / 2; i++ ) - { - cr = BASOP_Util_Add_Mant32Exp( cr, cr_exp, L_add( L_mult( pt_fftL[i], pt_fftR[i] ), L_mult( pt_fftL[L_FFT - i], pt_fftR[L_FFT - i] ) ), shl( fft_exp, 1 ), &cr_exp ); /* exp(cr_exp) */ - ci = BASOP_Util_Add_Mant32Exp( ci, ci_exp, L_add( L_mult( -pt_fftL[i], pt_fftR[L_FFT - i] ), L_mult( pt_fftL[L_FFT - i], pt_fftR[i] ) ), shl( fft_exp, 1 ), &ci_exp ); /* exp(ci_exp) */ - eL = BASOP_Util_Add_Mant32Exp( eL, eL_exp, L_add( L_mult( pt_fftL[i], pt_fftL[i] ), L_mult( pt_fftL[L_FFT - i], pt_fftL[L_FFT - i] ) ), shl( fft_exp, 1 ), &eL_exp ); /* exp(eL_exp) */ - eR = BASOP_Util_Add_Mant32Exp( eR, eR_exp, L_add( L_mult( pt_fftR[i], pt_fftR[i] ), L_mult( pt_fftR[L_FFT - i], pt_fftR[L_FFT - i] ) ), shl( fft_exp, 1 ), &eR_exp ); /* exp(eR_exp) */ - } - test(); - test(); - IF( LE_32( sts[0]->ini_frame, 50 ) || ( sts[0]->vad_flag == 0 && sts[1]->vad_flag == 0 ) ) - { - mem[0] = BASOP_Util_Add_Mant32Exp( Mpy_32_16_1( mem[0], 31129 /*0.95f*/ ), mem_exp[0], Mpy_32_16_1( cr, 1638 /*0.05f*/ ), cr_exp, &mem_exp[0] ); /* exp(mem_exp[0]) */ - move32(); - mem[1] = BASOP_Util_Add_Mant32Exp( Mpy_32_16_1( mem[1], 31129 /*0.95f*/ ), mem_exp[1], Mpy_32_16_1( ci, 1638 /*0.05f*/ ), ci_exp, &mem_exp[1] ); /* exp(mem_exp[1]) */ - move32(); - mem[2] = BASOP_Util_Add_Mant32Exp( Mpy_32_16_1( mem[2], 31129 /*0.95f*/ ), mem_exp[2], Mpy_32_16_1( eL, 1638 /*0.05f*/ ), eL_exp, &mem_exp[2] ); /* exp(mem_exp[2]) */ - move32(); - mem[3] = BASOP_Util_Add_Mant32Exp( Mpy_32_16_1( mem[3], 31129 /*0.95f*/ ), mem_exp[3], Mpy_32_16_1( eR, 1638 /*0.05f*/ ), eR_exp, &mem_exp[3] ); /* exp(mem_exp[3]) */ - move32(); - } - - pt_fftL += L_FFT; - pt_fftR += L_FFT; - } -#endif -#ifndef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG - Word16 sqr_inp, temp, sqr_out, sqr_inp_exp; - Word32 sqr_inp32 = BASOP_Util_Add_Mant32Exp( Mpy_32_32( mem[0], mem[0] ), shl( mem_exp[0], 1 ), Mpy_32_32( mem[1], mem[1] ), shl( mem_exp[1], 1 ), &sqr_inp_exp ); /* exp(sqr_inp_exp) */ - sqr_inp = BASOP_Util_Divide3232_Scale( sqr_inp32, Mpy_32_32( mem[2], mem[3] ), &temp ); - sqr_inp_exp = add( temp, sub( sqr_inp_exp, add( mem_exp[2], mem_exp[3] ) ) ); - sqr_out = Sqrt16( sqr_inp, &sqr_inp_exp ); - sts[0]->hFdCngEnc->hFdCngCom->coherence_fx = shl_sat( sqr_out, sqr_inp_exp ); // Q15 expected. - move16(); -#endif return; } @@ -3175,11 +3106,7 @@ void FdCngEncodeMDCTStereoSID_fx( } /* quantize channel coherence */ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG coh_idx = mult_r( sts[0]->hFdCngEnc->hFdCngCom->coherence_fx[0], 15 ); -#else - coh_idx = mult_r( sts[0]->hFdCngEnc->hFdCngCom->coherence_fx, 15 ); -#endif coh_idx = s_max( 0, s_min( coh_idx, 15 ) ); /* ---- Write SID bitstream ---- */ @@ -3213,7 +3140,6 @@ void FdCngEncodeMDCTStereoSID_fx( push_indice( sts[ch]->hBstr, IND_ENERGY, gain_idx[ch], 7 ); } -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG /* write the four additional coherence values */ FOR( Word16 b = 1; b < MDCT_ST_DTX_NUM_COHERENCE_BANDS; b++ ) { @@ -3221,10 +3147,6 @@ void FdCngEncodeMDCTStereoSID_fx( coh_idx = s_max( 0, s_min( coh_idx, 15 ) ); push_indice( sts[1]->hBstr, IND_ENERGY, coh_idx, 4 ); } -#else - /* pad with zeros to reach common SID frame size */ - push_indice( sts[1]->hBstr, IND_ENERGY, 0, ( IVAS_SID_5k2 - 4400 ) / FRAMES_PER_SEC ); -#endif return; } @@ -3428,17 +3350,10 @@ void FdCngEncodeDiracMDCTStereoSID_fx( lpc_from_spectrum( hFdCngCom, hFdCngEnc->startBandDec, hFdCngEnc->stopFFTbinDec, sts[ch]->preemph_fac ); sts[ch]->hDtxEnc->last_CNG_L_frame = sts[ch]->L_frame; } -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG sts[0]->hFdCngEnc->hFdCngCom->coherence_fx[0] = 0; move16(); sts[1]->hFdCngEnc->hFdCngCom->coherence_fx[0] = 0; move16(); -#else - sts[0]->hFdCngEnc->hFdCngCom->coherence_fx = 0; - move16(); - sts[1]->hFdCngEnc->hFdCngCom->coherence_fx = 0; - move16(); -#endif /* ---- Write SID bitstream ---- */ diff --git a/lib_enc/ivas_core_pre_proc_front_fx.c b/lib_enc/ivas_core_pre_proc_front_fx.c index efa5e9a0a..d62fa49c1 100644 --- a/lib_enc/ivas_core_pre_proc_front_fx.c +++ b/lib_enc/ivas_core_pre_proc_front_fx.c @@ -714,11 +714,7 @@ ivas_error pre_proc_front_ivas_fx( *Q_new = add( *Q_new, Q_inp_const ); move16(); -#ifndef FIX_2015_PREMPH_SAT_ALT - Copy_Scale_sig32_16( sig_out, preemp_start_idx, preemp_len, sub( *Q_new, st->q_inp ) ); /* Q_new */ -#else - Copy_Scale_sig32_16( sig_out, preemp_start_idx, preemp_len, sub( add( *Q_new, 1 ), st->q_inp ) ); /* Q_new */ -#endif + Copy_Scale_sig32_16( sig_out, preemp_start_idx, preemp_len, sub( add( *Q_new, 1 ), st->q_inp ) ); /* Q_new */ Scale_sig( old_inp_12k8_fx, (Word16) ( preemp_start_idx - old_inp_12k8_fx ), sub( *Q_new, st->q_inp ) ); /* Q_new */ cldfbScale.hb_scale = cldfbScale.lb_scale; diff --git a/lib_enc/ivas_core_pre_proc_fx.c b/lib_enc/ivas_core_pre_proc_fx.c index 840165824..cb5c15715 100644 --- a/lib_enc/ivas_core_pre_proc_fx.c +++ b/lib_enc/ivas_core_pre_proc_fx.c @@ -1071,11 +1071,7 @@ ivas_error ivas_compute_core_buffers_fx( } st->Q_max_16k[i] = shift; move16(); -#ifndef FIX_2015_PREMPH_SAT_ALT - Copy_Scale_sig32_16( sig_out, preemp_start_idx, preemp_len, *Q_new ); -#else Copy_Scale_sig32_16( sig_out, preemp_start_idx, preemp_len, add( *Q_new, 1 ) ); -#endif Scale_sig( old_inp_16k_fx, (Word16) ( preemp_start_idx - old_inp_16k_fx ), *Q_new ); } ELSE IF( GT_32( input_Fs, 8000 ) ) /* keep memory up-to-date in case of bitrate switching */ diff --git a/lib_enc/ivas_cpe_enc_fx.c b/lib_enc/ivas_cpe_enc_fx.c index 8bd84e031..c5eb5c67d 100644 --- a/lib_enc/ivas_cpe_enc_fx.c +++ b/lib_enc/ivas_cpe_enc_fx.c @@ -826,13 +826,8 @@ ivas_error ivas_cpe_enc_fx( move16(); stereo_dft_enc_synthesize_fx( hCPE->hStereoDft, sts[0]->input32_fx, &out_start_ind, &out_end_ind, 0, input_Fs, input_Fs, 0, NULL ); -#ifdef NONBE_FIX_2205_SATURATE_ALTERNATIVE Scale_sig32( sts[0]->input32_fx - input_frame, add( out_start_ind, input_frame ), sub( Q15, sts[0]->q_old_inp32 ) ); // scaling initial part of the input buffer Scale_sig32( sts[0]->input32_fx + out_end_ind, sub( input_frame, out_end_ind ), sub( Q15, sts[0]->q_inp32 ) ); // scaling initial part of the input buffer -#else - scale_sig32( sts[0]->input32_fx - input_frame, add( out_start_ind, input_frame ), sub( Q15, sts[0]->q_old_inp32 ) ); // scaling initial part of the input buffer - scale_sig32( sts[0]->input32_fx + out_end_ind, sub( input_frame, out_end_ind ), sub( Q15, sts[0]->q_inp32 ) ); // scaling initial part of the input buffer -#endif sts[0]->q_inp32 = Q15; sts[0]->q_old_inp32 = Q15; move16(); @@ -992,12 +987,10 @@ ivas_error ivas_cpe_enc_fx( * Core codec configuration *----------------------------------------------------------------*/ -#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING test(); test(); IF( NE_32( sts[0]->core_brate, SID_2k40 ) && NE_32( sts[0]->core_brate, FRAME_NO_DATA ) ) /* Reconfigurations not needed with DTX*/ { -#endif test(); IF( EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) && st_ivas->hMCT == NULL ) { @@ -1038,13 +1031,9 @@ ivas_error ivas_cpe_enc_fx( test(); test(); test(); -#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING test(); test(); IF( ( NE_32( hCPE->last_element_brate, hCPE->element_brate ) || NE_16( hCPE->element_mode, hCPE->last_element_mode ) || ( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) && NE_16( sts[0]->bits_frame_nominal, last_bits_frame_nominal ) ) || NE_16( sts[n]->last_bwidth, sts[n]->bwidth ) || EQ_32( sts[n]->last_core_brate, SID_2k40 ) || EQ_32( sts[n]->last_core_brate, FRAME_NO_DATA ) ) && ( EQ_16( n, 0 ) || EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) ) -#else - IF( ( NE_32( hCPE->last_element_brate, hCPE->element_brate ) || NE_16( hCPE->element_mode, hCPE->last_element_mode ) || ( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) && NE_16( sts[0]->bits_frame_nominal, last_bits_frame_nominal ) ) || NE_16( sts[n]->last_bwidth, sts[n]->bwidth ) ) && ( n == 0 || EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) ) -#endif { Word16 igf; Word16 bw; @@ -1059,20 +1048,14 @@ ivas_error ivas_cpe_enc_fx( } igf = getIgfPresent_fx( sts[n]->element_mode, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), bw, sts[n]->rf_mode ); /* Q0 */ move16(); -#ifdef FIX_1413_IGF_INIT_PRINTOUT IF( ( error = IGF_Reconfig_fx( &sts[n]->hIGFEnc, igf, 0, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), bw, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK ) -#else - IF( ( error = IGF_Reconfig_fx( &sts[n]->hIGFEnc, igf, 0, L_mult0( sts[n]->bits_frame_nominal, FRAMES_PER_SEC ), max_bwidth, sts[n]->element_mode, sts[n]->rf_mode ) ) != IVAS_ERR_OK ) -#endif { return error; } } } -#ifdef FIX_1411_IGF_CRASH_BW_SWITCHING } -#endif /* set ACELP@12k8 / ACELP@16k flag for flexible ACELP core */ FOR( n = 0; n < n_CoreChannels; n++ ) diff --git a/lib_enc/ivas_enc_fx.c b/lib_enc/ivas_enc_fx.c index ffd32570f..34c6c320f 100644 --- a/lib_enc/ivas_enc_fx.c +++ b/lib_enc/ivas_enc_fx.c @@ -158,19 +158,11 @@ ivas_error ivas_enc_fx( test(); IF( ( EQ_32( ivas_format, SBA_FORMAT ) ) && !( GT_16( st_ivas->sba_analysis_order, 1 ) ) ) { -#ifdef FIX_2086_ENABLE_HP20_OPT_FOR_ENC hp20_fx_32_opt( data_fx[HOA_keep_ind[st_ivas->hSpar->hMdEnc->HOA_md_ind[i]]], input_frame, st_ivas->mem_hp20_in_fx[i], input_Fs ); -#else - hp20_fx_32( data_fx[HOA_keep_ind[st_ivas->hSpar->hMdEnc->HOA_md_ind[i]]], input_frame, st_ivas->mem_hp20_in_fx[i], input_Fs ); -#endif } ELSE IF( !( EQ_32( ivas_format, MC_FORMAT ) && EQ_16( i, LFE_CHANNEL ) ) ) { -#ifdef FIX_2086_ENABLE_HP20_OPT_FOR_ENC hp20_fx_32_opt( data_fx[i], input_frame, st_ivas->mem_hp20_in_fx[i], input_Fs ); -#else - hp20_fx_32( data_fx[i], input_frame, st_ivas->mem_hp20_in_fx[i], input_Fs ); -#endif } } diff --git a/lib_enc/ivas_spar_encoder_fx.c b/lib_enc/ivas_spar_encoder_fx.c index 2abe06776..cb02abe16 100644 --- a/lib_enc/ivas_spar_encoder_fx.c +++ b/lib_enc/ivas_spar_encoder_fx.c @@ -929,11 +929,7 @@ static ivas_error ivas_spar_enc_process_fx( IF( hSpar->hFbMixer->fb_cfg->active_w_mixing == 0 ) { /*cross fade between new active W channels and old passive W channel*/ -#ifdef BE_FIX_1391_COVERAGE_SPAR_DYN__CHANNEL IF( EQ_16( dyn_active_w_flag, 1 ) || EQ_16( hSpar->hMdEnc->spar_md.prior_dyn_active_w_flag, 1 ) ) -#else - IF( EQ_16( dyn_active_w_flag, 1 ) ) -#endif { IF( NE_16( hSpar->hMdEnc->spar_md.prior_dyn_active_w_flag, dyn_active_w_flag ) ) { diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 6cad0ac68..7096198a9 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1186,12 +1186,10 @@ typedef struct stereo_dmx_evs_correlation_filter_structure Word32 isd_rate_s_fx; // Q31 Word32 iccr_s_fx; // Q31 -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING - Word32 phitd_fx; // Q15 - Word32 iccres_s_fx; // Q31 + Word32 phitd_fx; // Q15 + Word32 iccres_s_fx; // Q31 Word32 lvlin_fx[CPE_CHANNELS]; Word16 lvlin_fx_e[CPE_CHANNELS]; -#endif Word32 ipd_ff_fx[STEREO_DMX_EVS_NB_SUBBAND_MAX]; // Q31 Word32 Pr_fx[STEREO_DMX_EVS_NB_SUBBAND_MAX]; // Q31 Word32 Pi_fx[STEREO_DMX_EVS_NB_SUBBAND_MAX]; // Q31 diff --git a/lib_enc/ivas_stereo_dmx_evs_fx.c b/lib_enc/ivas_stereo_dmx_evs_fx.c index 73f7e246c..d68976482 100644 --- a/lib_enc/ivas_stereo_dmx_evs_fx.c +++ b/lib_enc/ivas_stereo_dmx_evs_fx.c @@ -77,7 +77,6 @@ #define STEREO_DMX_EVS_ICCR_HYST_L_Q31 1610612736 #define STEREO_DMX_EVS_ICCR_HYST_H_Q31 1825361101 -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING #define STEREO_DMX_EVS_ICCRES_FORGETTING_Q31 1975684956 #define STEREO_DMX_EVS_LVLU_FORGETTING_Q31 1073741824 #define STEREO_DMX_EVS_LVLD_FORGETTING_Q31 1975684956 @@ -85,7 +84,6 @@ #define STEREO_DMX_EVS_ICLD_THRESH_FX_E 2 #define STEREO_DMX_EVS_ICCRES_THRESH_Q31 858993459 #define STEREO_DMX_EVS_DICLD_THRESH_Q30 1606570807 -#endif #define STEREO_DMX_EVS_SWTCH_HYS_THRES 1 #define STEREO_DMX_EVS_LR_EGY_Q27 2013265920 @@ -204,7 +202,6 @@ static void weighted_ave_fx( const Word16 input_frame, /* i : input frame length per channel */ const Word32 wnd_fx[] /* i : window coef Q31 */ ); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING static void calc_energy_fx( const Word32 src1_fx[], /* i : Lch input signal */ const Word32 src2_fx[], /* i : Rch input signal */ @@ -228,28 +225,6 @@ static void create_M_signal_fx( Word16 *src_energy_fx_e, /* i/o: input signal energy */ STEREO_DMX_EVS_PHA_HANDLE hPHA /* i/o: correlation filter structure */ ); -#else -static void calc_energy_fx( - const Word32 src1_fx[], /* i : Lch input signal */ - const Word32 src2_fx[], /* i : Rch input signal */ - Word32 energy_fx[], /* o : calculated energy */ - Word16 *energy_fx_e, /* o : calculated energy */ - const Word16 input_frame, /* i : input frame length per channel */ - const Word32 ratio_float_fx ); -static void create_M_signal_fx( - const Word32 srcL_fx[], /* i : Lch input signal Q16 */ - const Word32 srcR_fx[], /* i : Rch input signal Q16 */ - Word32 dmx_fx[], /* o : output signal Q31 */ - const Word32 w_curr_fx, /* i : adapting weight Q31 */ - const Word16 input_frame, /* i : input frame length per channel */ - const Word32 wnd_fx[], /* i : window coef Q31 */ - Word32 *w_prev_fx, /* i/o: adapting prev weight Q31 */ - Word32 *dmx_energy_fx, /* i/o: downmix signal energy dmx_energy_fx_e */ - Word16 *dmx_energy_fx_e, /* i/o: downmix signal energy */ - Word32 *src_energy_fx, /* i/o: input signal energy src_energy_fx_e */ - Word16 *src_energy_fx_e /* i/o: input signal energy */ -); -#endif static Word32 find_poc_peak_fx( STEREO_DMX_EVS_POC_HANDLE hPOC, /* i/o: phase only correlation structure */ Word16 itd_fx[], /* o : estimated itd */ @@ -763,13 +738,11 @@ static void calc_poc_fx( move32(); eneR_e = 0; move16(); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING step = sub( n0 >> 3, 1 ); tmp1 = 0; tmp2 = 0; n1 = 0; n2 = 0; -#endif FOR( ( n = 1, i = 1 ); n < nsbd; n++ ) { @@ -867,7 +840,6 @@ static void calc_poc_fx( } eneR = BASOP_Util_Add_Mant32Exp( eneR, eneR_e, W_round64_L( W_tmp ), sub( 1, L_tmp_e ), &eneR_e ); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING IF( EQ_16( i, step ) ) { tmp1 = eneL; @@ -875,7 +847,6 @@ static void calc_poc_fx( tmp2 = eneR; n2 = eneR_e; } -#endif } // Pn = (float) inv_sqrt( ( tPr * tPr + tPi * tPi ) + EPSILON ); @@ -906,12 +877,7 @@ static void calc_poc_fx( } /* Computes Spectral flatness on one channel */ -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING IF( LT_32( spectral_flatness_fx( &tEl[1], &tEl_e[1], sub( nsbd, 1 ) ), STEREO_DMX_EVS_IPD_SF_THRES_Q31 ) ) -#else - tmp1 = spectral_flatness_fx( &tEl[1], &tEl_e[1], nsbd - 1 ); - IF( LT_32( tmp1, STEREO_DMX_EVS_IPD_SF_THRES_Q31 ) ) -#endif { hPHA->pha_ipd_chanswitch_allowed = 0; move16(); @@ -935,7 +901,6 @@ static void calc_poc_fx( hPHA->iccr_s_fx = L_add( Mpy_32_32_r( STEREO_DMX_EVS_ICCR_FORGETTING_Q31, hPHA->iccr_s_fx ), Mpy_32_32_r( MAX_32 - STEREO_DMX_EVS_ICCR_FORGETTING_Q31, ICCr ) ); // Q31 move32(); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING step = add( step, 1 ); eneL = BASOP_Util_Add_Mant32Exp( eneL, eneL_e, -tmp1, n1, &eneL_e ); @@ -1010,7 +975,6 @@ static void calc_poc_fx( L_tmp = L_shl_sat( L_tmp, L_tmp_e ); // Q31 hPHA->iccres_s_fx = L_add( Mpy_32_32_r( STEREO_DMX_EVS_ICCRES_FORGETTING_Q31, hPHA->iccres_s_fx ), Mpy_32_32_r( L_sub( MAX_32, STEREO_DMX_EVS_ICCRES_FORGETTING_Q31 ), L_add_sat( ICCr >> 1, L_tmp >> 1 ) ) ); // Q31 -#endif IF( EQ_32( hPHA->curr_pha, STEREO_DMX_EVS_PHA_IPD ) ) { @@ -1569,11 +1533,7 @@ static Word32 find_poc_peak_fx( move16(); move16(); move16(); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING IF( Q_fx[n] == 0 ) -#else - if ( Q_fx[n] == 0 ) -#endif { Q_e[n] = 0; move16(); @@ -1959,7 +1919,6 @@ static void renorm_poc_fx( * * calculate energy *-------------------------------------------------------------------*/ -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING void calc_energy_fx( const Word32 src1_fx[], /* i : Lch input signal */ const Word32 src2_fx[], /* i : Rch input signal */ @@ -1969,23 +1928,9 @@ void calc_energy_fx( Word16 *lvl_fx_e, /* i/o: signal level */ const Word16 input_frame, /* i : input frame length per channel */ const Word32 ratio_float_fx ) -#else -void calc_energy_fx( - const Word32 src1_fx[], /* i : Lch input signal */ - const Word32 src2_fx[], /* i : Rch input signal */ - Word32 energy_fx[], /* o : calculated energy */ - Word16 *energy_fx_e, /* o : calculated energy */ - const Word16 input_frame, /* i : input frame length per channel */ - const Word32 ratio_float_fx ) -#endif { -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING Word32 E_32_fx, wnd_fx, wnd_diff_fx, lvli_fx, lvlff_fx; Word16 i, adaptlen, lvli_fx_e; -#else - Word32 E_32_fx, wnd_fx, wnd_diff_fx; - Word16 i, adaptlen; -#endif Word64 E_fx; /* Initialization */ @@ -2050,7 +1995,6 @@ void calc_energy_fx( *energy_fx = BASOP_Util_Add_Mant32Exp( Mpy_32_32( *energy_fx, ratio_float_fx ), *energy_fx_e, Mpy_32_32( temp32, L_sub( MAX_32, ratio_float_fx ) ), sub( 31, q_temp32 ), energy_fx_e ); move32(); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING IF( ( lvl_fx != NULL ) && ( lvl_fx_e != NULL ) ) { E_32_fx = BASOP_Util_Add_Mant32Exp( E_32_fx, sub( 31, q_E ), EPSILON_FX_M, EPSILON_FX_E, &temp_e ); @@ -2066,7 +2010,6 @@ void calc_energy_fx( } *lvl_fx = BASOP_Util_Add_Mant32Exp( Mpy_32_32( *lvl_fx, lvlff_fx ), *lvl_fx_e, Mpy_32_32( lvli_fx, L_sub( MAX_32, lvlff_fx ) ), lvli_fx_e, lvl_fx_e ); // Q(31 - *lvli_fx_e) } -#endif return; } @@ -2157,7 +2100,6 @@ static void adapt_gain_fx( * * create downmix signal *-------------------------------------------------------------------*/ -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING void create_M_signal_fx( const Word32 srcL_fx[], /* i : Lch input signal Q16 */ const Word32 srcR_fx[], /* i : Rch input signal Q16 */ @@ -2172,21 +2114,6 @@ void create_M_signal_fx( Word16 *src_energy_fx_e, /* i/o: input signal energy */ STEREO_DMX_EVS_PHA_HANDLE hPHA /* i/o: correlation filter structure */ ) -#else -void create_M_signal_fx( - const Word32 srcL_fx[], /* i : Lch input signal Q16 */ - const Word32 srcR_fx[], /* i : Rch input signal Q16 */ - Word32 dmx_fx[], /* o : output signal Q31 */ - const Word32 w_curr_fx, /* i : adapting weight Q31 */ - const Word16 input_frame, /* i : input frame length per channel */ - const Word32 wnd_fx[], /* i : window coef Q31 */ - Word32 *w_prev_fx, /* i/o: adapting prev weight Q31 */ - Word32 *dmx_energy_fx, /* i/o: downmix signal energy dmx_energy_fx_e */ - Word16 *dmx_energy_fx_e, /* i/o: downmix signal energy */ - Word32 *src_energy_fx, /* i/o: input signal energy src_energy_fx_e */ - Word16 *src_energy_fx_e /* i/o: input signal energy */ -) -#endif { Word32 amp_mod_fx[CPE_CHANNELS]; Word32 weighted_fx[L_FRAME48k], Lbias_fx; @@ -2209,15 +2136,9 @@ void create_M_signal_fx( move32(); } weighted_ave_fx( srcL_fx, srcR_fx, dmx_fx, w_curr_fx, w_prev_fx[0], input_frame, wnd_fx ); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING calc_energy_fx( srcL_fx, srcL_fx, src_energy_fx, src_energy_fx_e, hPHA->lvlin_fx, hPHA->lvlin_fx_e, input_frame, STEREO_DMX_EVS_DMX_EGY_FORGETTING_FX ); calc_energy_fx( srcR_fx, srcR_fx, src_energy_fx + 1, src_energy_fx_e + 1, hPHA->lvlin_fx + 1, hPHA->lvlin_fx_e + 1, input_frame, STEREO_DMX_EVS_DMX_EGY_FORGETTING_FX ); calc_energy_fx( dmx_fx, dmx_fx, dmx_energy_fx, dmx_energy_fx_e, NULL, NULL, input_frame, STEREO_DMX_EVS_DMX_EGY_FORGETTING_FX ); -#else - calc_energy_fx( srcL_fx, srcL_fx, src_energy_fx, src_energy_fx_e, input_frame, STEREO_DMX_EVS_DMX_EGY_FORGETTING_FX ); - calc_energy_fx( srcR_fx, srcR_fx, src_energy_fx + 1, src_energy_fx_e + 1, input_frame, STEREO_DMX_EVS_DMX_EGY_FORGETTING_FX ); - calc_energy_fx( dmx_fx, dmx_fx, dmx_energy_fx, dmx_energy_fx_e, input_frame, STEREO_DMX_EVS_DMX_EGY_FORGETTING_FX ); -#endif temp32_1 = Mpy_32_32( src_energy_fx[0], Lbias_fx ); // 31 - src_energy_fx_e + Q28-31 temp_e_1 = add( src_energy_fx_e[0], 3 ); @@ -2340,15 +2261,9 @@ void stereo_dmx_evs_enc_fx( Word32 dmx_poc_data[L_FRAME48k] /*Q11*/, dmx_pha_data[L_FRAME48k] /*Q11*/, *p_dmx_data, fx_tmp, *p_dmx_data_fo; Word16 n_fad_r, n_fad_g, m_fad_g, n_fad_cnt; -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING STEREO_DMX_EVS_PRC prev_prc, req_prc; Word32 L_tmp1, L_tmp2, L_dmx_weight, icld_fx; Word16 L_tmp1_e, L_tmp2_e, icld_fx_e; -#else - STEREO_DMX_EVS_PRC prev_prc; - Word32 L_tmp1, L_tmp2; - Word16 L_tmp1_e, L_tmp2_e; -#endif STEREO_DMX_EVS_PHA_HANDLE hPHA; @@ -2430,9 +2345,6 @@ void stereo_dmx_evs_enc_fx( move16(); FOR( k = 0; k < CPE_CHANNELS; k++ ) { -#ifndef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING - fx_tmp = 0; -#endif move32(); FOR( m = 0; m < STEREO_DMX_EVS_NB_SBFRM; m++ ) { @@ -2474,11 +2386,7 @@ void stereo_dmx_evs_enc_fx( L_tmp2 = BASOP_Util_Divide3232_Scale_newton( subframe_energy[m], L_tmp1, &L_tmp2_e ); L_tmp2_e = add( L_tmp2_e, sub( subframe_energy_e[m], L_tmp1_e ) ); // if ( subframe_energy[m] / ( subframe_energy[m - 1] + EPSILON ) > STEREO_DMX_EVS_TRNS_DTC_INST ) -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING IF( BASOP_Util_Cmp_Mant32Exp( L_tmp2, L_tmp2_e, STEREO_DMX_EVS_TRNS_DTC_INST_Q0, 31 ) > 0 ) -#else - if ( BASOP_Util_Cmp_Mant32Exp( L_tmp2, L_tmp2_e, STEREO_DMX_EVS_TRNS_DTC_INST_Q0, 31 ) > 0 ) -#endif { is_transient = 1; move16(); @@ -2508,16 +2416,11 @@ void stereo_dmx_evs_enc_fx( move16(); } -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING L_dmx_weight = L_deposit_h( dmx_weight ); L_tmp1 = L_deposit_l( BASOP_Util_Divide1616_Scale( hStereoDmxEVS->itd_fx, input_frame, &L_tmp1_e ) ); hPHA->phitd_fx = L_shl( L_tmp1, L_tmp1_e ); // Q15 create_M_signal_fx( data_fx[0], data_fx[1], dmx_poc_data, L_dmx_weight, input_frame, hStereoDmxEVS->s_wnd_fx, hStereoDmxEVS->dmx_weight_fx, hStereoDmxEVS->pre_dmx_energy_fx, hStereoDmxEVS->pre_dmx_energy_fx_e, hStereoDmxEVS->aux_dmx_energy_fx, hStereoDmxEVS->aux_dmx_energy_fx_e, hPHA ); -#else - create_M_signal_fx( data_fx[0], data_fx[1], dmx_poc_data, L_deposit_h( dmx_weight ), input_frame, hStereoDmxEVS->s_wnd_fx, - hStereoDmxEVS->dmx_weight_fx, hStereoDmxEVS->pre_dmx_energy_fx, hStereoDmxEVS->pre_dmx_energy_fx_e, hStereoDmxEVS->aux_dmx_energy_fx, hStereoDmxEVS->aux_dmx_energy_fx_e ); -#endif // Downscaling signals to avoid accumulation overflows scale_sig32( data_fx[0], input_frame, -5 ); // Q31->Q26 @@ -2609,7 +2512,6 @@ void stereo_dmx_evs_enc_fx( move32(); // if ( abs( (int16_t) hStereoDmxEVS->itd ) > hPHA->prc_thres ) IF( GT_16( abs_s( hStereoDmxEVS->itd_fx ), hPHA->prc_thres ) ) -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING { req_prc = STEREO_DMX_EVS_PRC_POC; move32(); @@ -2652,55 +2554,6 @@ void stereo_dmx_evs_enc_fx( } hPHA->prev_prc = req_prc; move32(); -#else - { - IF( NE_32( hPHA->curr_prc, STEREO_DMX_EVS_PRC_POC ) ) - { - IF( EQ_32( hPHA->prev_prc, STEREO_DMX_EVS_PRC_POC ) ) - { - hPHA->prc_hys_cnt = add( hPHA->prc_hys_cnt, 1 ); - move16(); - } - ELSE - { - hPHA->prc_hys_cnt = 0; - move16(); - } - - IF( GE_16( hPHA->prc_hys_cnt, STEREO_DMX_EVS_SWTCH_PRC_HYS_THRES ) ) - { - hPHA->curr_prc = STEREO_DMX_EVS_PRC_POC; - move32(); - } - } - hPHA->prev_prc = STEREO_DMX_EVS_PRC_POC; - move32(); - } - ELSE - { - IF( NE_32( hPHA->curr_prc, STEREO_DMX_EVS_PRC_PHA ) ) - { - IF( EQ_32( hPHA->prev_prc, STEREO_DMX_EVS_PRC_PHA ) ) - { - hPHA->prc_hys_cnt = add( hPHA->prc_hys_cnt, 1 ); - move16(); - } - ELSE - { - hPHA->prc_hys_cnt = 0; - move16(); - } - - IF( GE_16( hPHA->prc_hys_cnt, STEREO_DMX_EVS_SWTCH_PRC_HYS_THRES ) ) - { - hPHA->curr_prc = STEREO_DMX_EVS_PRC_PHA; - move32(); - } - } - hPHA->prev_prc = STEREO_DMX_EVS_PRC_PHA; - move32(); - } -#endif // if ( ( is_transient == 1 ) || ( hStereoDmxEVS->aux_dmx_energy[0] > STEREO_DMX_EVS_ILDS_EGY * hStereoDmxEVS->aux_dmx_energy[1] ) || ( hStereoDmxEVS->aux_dmx_energy[1] > STEREO_DMX_EVS_ILDS_EGY * hStereoDmxEVS->aux_dmx_energy[0] ) || ( ( hPHA->p_curr_taps[0] == NULL ) && ( hPHA->p_curr_taps[1] == NULL ) ) ) test(); @@ -3151,7 +3004,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( hStereoDmxEVS->hPHA->iccr_s_fx = 0; move32(); -#ifdef FIX_2184_EVS_STEREO_DMX_CHANNEL_DISAPPEARING hStereoDmxEVS->hPHA->phitd_fx = 0; hStereoDmxEVS->hPHA->iccres_s_fx = 0; move32(); @@ -3162,7 +3014,6 @@ ivas_error stereo_dmx_evs_init_encoder_fx( hStereoDmxEVS->hPHA->lvlin_fx_e[n] = 0; move16(); } -#endif pha_len = hStereoDmxEVS->hPHA->pha_len; move16(); diff --git a/lib_enc/ivas_stereo_switching_enc_fx.c b/lib_enc/ivas_stereo_switching_enc_fx.c index 0b27de0f6..c6fc59283 100644 --- a/lib_enc/ivas_stereo_switching_enc_fx.c +++ b/lib_enc/ivas_stereo_switching_enc_fx.c @@ -682,11 +682,7 @@ void stereo_switching_enc_fx( /* window DFT synthesis overlap memory @input_Fs, primary channel */ FOR( i = 0; i < dft_ovl; i++ ) { -#ifdef NONBE_FIX_2206_SATURATE_ALTERNATIVE hCPE->hStereoDft->output_mem_dmx_fx[i] = L_shl_sat( Mpy_32_32_r( hCPE->hStereoDft->win_fx[dft_ovl - 1 - i], old_input_signal_pri[input_frame - dft_ovl + i] ), sub( 15, q_inp ) ); // Q15 -#else - hCPE->hStereoDft->output_mem_dmx_fx[i] = L_shl( Mpy_32_32_r( hCPE->hStereoDft->win_fx[dft_ovl - 1 - i], old_input_signal_pri[input_frame - dft_ovl + i] ), sub( 15, q_inp ) ); // Q15 -#endif move32(); } /* reset 48kHz BWE overlap memory */ diff --git a/lib_enc/lib_enc_fx.c b/lib_enc/lib_enc_fx.c index 245e5679a..eaf16ab5c 100644 --- a/lib_enc/lib_enc_fx.c +++ b/lib_enc/lib_enc_fx.c @@ -540,16 +540,7 @@ ivas_error IVAS_ENC_FeedObjectMetadata( { return IVAS_ERR_INVALID_INDEX; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS error = ivas_set_ism_metadata_fx( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], metadata.azimuth_fx, metadata.elevation_fx, metadata.radius_fx, metadata.yaw_fx, metadata.pitch_fx, metadata.non_diegetic_flag ); -#else - Word32 azimuth_fx = float_to_fix( metadata.azimuth, Q22 ); /* Q22 */ - Word32 elevation_fx = float_to_fix( metadata.elevation, Q22 ); /* Q22 */ - Word16 radius_fx = float_to_fix16( metadata.radius, Q9 ); /* Q9 */ - Word32 yaw_fx = float_to_fix( metadata.yaw, Q22 ); /* Q22 */ - Word32 pitch_fx = float_to_fix( metadata.pitch, Q22 ); /* Q22 */ - error = ivas_set_ism_metadata_fx( hIvasEnc->st_ivas->hIsmMetaData[ismIndex], azimuth_fx, elevation_fx, radius_fx, yaw_fx, pitch_fx, metadata.non_diegetic_flag ); -#endif IF( error != IVAS_ERR_OK ) { @@ -1523,7 +1514,6 @@ move16(); return error; } -#ifdef IVAS_RTPDUMP /*---------------------------------------------------------------------* @@ -1552,7 +1542,6 @@ ivas_error IVAS_ENC_EncodeFrameToCompact( return IVAS_ERR_OK; } -#endif /*---------------------------------------------------------------------* diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index 7757fb3fe..bcd7ed72c 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -397,13 +397,8 @@ typedef struct fd_cng_enc_structure Word16 msLogPeriodog_fx[NPART]; Word16 msLogNoiseEst_fx[NPART]; Word32 msLogNoiseEst_32fx[NPART]; /*IVAS: Q25*/ -#ifdef NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG Word32 mem_coherence_fx[MDCT_ST_DTX_NUM_COHERENCE_BANDS][4]; Word16 mem_coherence_exp[MDCT_ST_DTX_NUM_COHERENCE_BANDS][4]; -#else - Word32 mem_coherence_fx[4]; - Word16 mem_coherence_exp[4]; -#endif } FD_CNG_ENC, *HANDLE_FD_CNG_ENC; diff --git a/lib_enc/swb_pre_proc_fx.c b/lib_enc/swb_pre_proc_fx.c index d6095f0e3..a966f70cc 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -579,11 +579,7 @@ void swb_pre_proc_fx( IF( NE_16( st_fx->last_extl, SWB_BWE ) && NE_16( st_fx->last_extl, FB_BWE ) ) { /* resample 48 kHz to 32kHz */ -#ifdef NONBE_1244_FIX_SWB_BWE_MEMORY IF( ( st_fx->last_bwidth == FB && st_fx->element_mode == EVS_MONO ) || ( EQ_16( st_fx->bwidth, FB ) && st_fx->element_mode > EVS_MONO ) ) // note: once EVS i CR fixed, the condition will simplify to "if ( st->bwidth == FB )" only -#else - IF( EQ_16( st_fx->last_bwidth, FB ) ) -#endif { inner_frame = L_FRAME48k; inner_Fs = 48000; @@ -986,11 +982,7 @@ void swb_pre_proc_ivas_fx( IF( NE_16( st->last_extl, SWB_BWE ) && NE_16( st->last_extl, FB_BWE ) ) { /* resample 48 kHz to 32kHz */ -#ifdef NONBE_1244_FIX_SWB_BWE_MEMORY IF( ( st->last_bwidth == FB && st->element_mode == EVS_MONO ) || ( EQ_16( st->bwidth, FB ) && st->element_mode > EVS_MONO ) ) // note: once EVS i CR fixed, the condition will simplify to "if ( st->bwidth == FB )" only -#else - IF( EQ_16( st->last_bwidth, FB ) ) -#endif { inner_frame = L_FRAME48k; move16(); diff --git a/lib_isar/isar_prot.h b/lib_isar/isar_prot.h index e1b173e02..10aaa6db5 100644 --- a/lib_isar/isar_prot.h +++ b/lib_isar/isar_prot.h @@ -67,13 +67,8 @@ void isar_splitBinPreRendClose( void lc3plusTimeAlignCldfbPoseCorr( SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ Word32 *Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, imag. part */ -#else - Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word32 Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], -#endif Word16 *Q_in ); @@ -193,13 +188,8 @@ void isar_splitBinLCLDEncClose( void isar_splitBinLCLDEncProcess( ISAR_BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, /* i/o: ISAR LCLD encoder handle */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_In_Real_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ Word32 *Cldfb_In_Imag_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, imag. part */ -#else - Word32 Cldfb_In_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word32 Cldfb_In_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], -#endif const Word32 available_bits, /* i : available bit-budget */ ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ Word16 *q_final @@ -295,17 +285,9 @@ void isar_rend_CldfbSplitPreRendProcess( const ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i : binaural pre-renderer handle */ const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32* Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i : Binaural signals, real part */ -#else - Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], -#endif Word16 exp_cldfb_re, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32* Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i : Binaural signals, imag. part */ -#else - Word32 Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], -#endif Word16 exp_cldfb_im, ISAR_SPLIT_REND_BITS_HANDLE pBits, const Word32 target_md_bits, diff --git a/lib_isar/isar_splitRend_lcld_dec.c b/lib_isar/isar_splitRend_lcld_dec.c index 56446b755..6f4512d9e 100644 --- a/lib_isar/isar_splitRend_lcld_dec.c +++ b/lib_isar/isar_splitRend_lcld_dec.c @@ -225,36 +225,14 @@ void isar_splitBinLCLDDecProcess( #endif IF( AnyDecodingFailed( hSplitBinLCLDDec->psLCLDDecoder ) ) { -#ifndef FIX_2200_ISAR_PLC_CRASH - IF( NE_16( *Q_cldfb_final, 11 ) ) - { - FOR( n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) - { - FOR( k = 0; k < hSplitBinLCLDDec->iNumBlocks; k++ ) - { - FOR( Word16 j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) - { - hSplitBinLCLDDec->pppfDecLCLDReal_fx[n][k][j] = L_shl_r( hSplitBinLCLDDec->pppfDecLCLDReal_fx[n][k][j], sub( 11, *Q_cldfb_final ) ); // Q11 - hSplitBinLCLDDec->pppfDecLCLDImag_fx[n][k][j] = L_shl_r( hSplitBinLCLDDec->pppfDecLCLDImag_fx[n][k][j], sub( 11, *Q_cldfb_final ) ); // Q11 - } - } - } - *Q_cldfb_final = 11; - } -#else *Q_cldfb_final = hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx; -#endif /* continue concealing */ isar_splitBinRendPLC( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real_fx, Cldfb_Out_Imag_fx, (Word16) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations, GetDecodingFailedStatus( hSplitBinLCLDDec->psLCLDDecoder ), *Q_cldfb_final ); } IF( AnyDecodingFailedPrev( hSplitBinLCLDDec->psLCLDDecoder ) ) { -#ifndef FIX_2200_ISAR_PLC_CRASH - IF( NE_16( *Q_cldfb_final, 11 ) ) -#else IF( GT_16( *Q_cldfb_final, hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx ) ) -#endif { FOR( n = 0; n < hSplitBinLCLDDec->iChannels; n++ ) { @@ -262,21 +240,12 @@ void isar_splitBinLCLDDecProcess( { FOR( Word16 j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) { -#ifndef FIX_2200_ISAR_PLC_CRASH - hSplitBinLCLDDec->pppfDecLCLDReal_fx[n][k][j] = L_shl_r( hSplitBinLCLDDec->pppfDecLCLDReal_fx[n][k][j], sub( 11, *Q_cldfb_final ) ); // Q11 - hSplitBinLCLDDec->pppfDecLCLDImag_fx[n][k][j] = L_shl_r( hSplitBinLCLDDec->pppfDecLCLDImag_fx[n][k][j], sub( 11, *Q_cldfb_final ) ); // Q11 -#else hSplitBinLCLDDec->pppfDecLCLDReal_fx[n][k][j] = L_shl_r( hSplitBinLCLDDec->pppfDecLCLDReal_fx[n][k][j], sub( hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx, *Q_cldfb_final ) ); // hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx hSplitBinLCLDDec->pppfDecLCLDImag_fx[n][k][j] = L_shl_r( hSplitBinLCLDDec->pppfDecLCLDImag_fx[n][k][j], sub( hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx, *Q_cldfb_final ) ); // hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx -#endif } } } -#ifndef FIX_2200_ISAR_PLC_CRASH - *Q_cldfb_final = 11; -#else *Q_cldfb_final = hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx; -#endif } /* cross-fade recovered frame into good frame */ isar_splitBinRendPLC_xf_fx( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real_fx, Cldfb_Out_Imag_fx, (Word16) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations, GetDecodingFailedStatus( hSplitBinLCLDDec->psLCLDDecoder ), GetDecodingFailedPrevStatus( hSplitBinLCLDDec->psLCLDDecoder ), *Q_cldfb_final ); @@ -288,9 +257,7 @@ void isar_splitBinLCLDDecProcess( /* set states in decoder */ SetDecodingUnresolved( hSplitBinLCLDDec->psLCLDDecoder ); -#ifdef FIX_2200_ISAR_PLC_CRASH *Q_cldfb_final = hSplitBinLCLDDec->hSplitRendPLC->CldfbPLC_state.Q_Prev_Bin_fx; -#endif /* do PLC for lost split renderer frame */ isar_splitBinRendPLC( hSplitBinLCLDDec->hSplitRendPLC, Cldfb_Out_Real_fx, Cldfb_Out_Imag_fx, (Word16) hSplitBinLCLDDec->iChannels, hSplitBinLCLDDec->iNumBlocks, hSplitBinLCLDDec->iNumIterations, GetDecodingFailedStatus( hSplitBinLCLDDec->psLCLDDecoder ), *Q_cldfb_final ); diff --git a/lib_isar/isar_splitRend_lcld_enc.c b/lib_isar/isar_splitRend_lcld_enc.c index b1249653f..93e70c24f 100644 --- a/lib_isar/isar_splitRend_lcld_enc.c +++ b/lib_isar/isar_splitRend_lcld_enc.c @@ -152,15 +152,10 @@ void isar_splitBinLCLDEncClose( *------------------------------------------------------------------------*/ void isar_splitBinLCLDEncProcess( ISAR_BIN_HR_SPLIT_LCLD_ENC_HANDLE hSplitBinLCLDEnc, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_In_Real_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ Word32 *Cldfb_In_Imag_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, imag part */ -#else - Word32 Cldfb_In_Real_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word32 Cldfb_In_Imag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], -#endif - const Word32 available_bits, /* i : available bit-budget */ - ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ + const Word32 available_bits, /* i : available bit-budget */ + ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ Word16 *q_final ) { Word32 iBitsWritten, itr, available_bits_itr, rem_itr, available_bits_local; diff --git a/lib_isar/isar_splitRendererPost.c b/lib_isar/isar_splitRendererPost.c index 272dc45c8..ce04691f1 100644 --- a/lib_isar/isar_splitRendererPost.c +++ b/lib_isar/isar_splitRendererPost.c @@ -1818,23 +1818,14 @@ static void isar_rend_CldfbSplitPostRendProcessTdIn( { RealBuffer_fx[slot_idx] = Cldfb_RealBuffer_Binaural_fx[ch_idx][slot_idx]; ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[ch_idx][slot_idx]; -#ifdef NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES scaleFactor = s_min( scaleFactor, s_min( L_norm_arr( RealBuffer_fx[slot_idx], num_cldfb_bands ), L_norm_arr( ImagBuffer_fx[slot_idx], num_cldfb_bands ) ) ); scaleFactor = s_min( scaleFactor, L_norm_arr( hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_fx, hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_length ) ); -#else - scaleFactor = s_min( scaleFactor, s_min( getScaleFactor32( RealBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX ), getScaleFactor32( ImagBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX ) ) ); -#endif } scaleFactor = s_min( sub( scaleFactor, 6 ), Q24 ); // guarded bits FOR( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) { -#ifdef NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES Scale_sig32( RealBuffer_fx[slot_idx], num_cldfb_bands, scaleFactor ); Scale_sig32( ImagBuffer_fx[slot_idx], num_cldfb_bands, scaleFactor ); -#else - Scale_sig32( RealBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX, scaleFactor ); - Scale_sig32( ImagBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX, scaleFactor ); -#endif } Q_cldfb = add( scaleFactor, Q_in ); Scale_sig32( hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_fx, hBinHrSplitPostRend->cldfbSyn[ch_idx]->p_filter_length, sub( sub( Q_cldfb, 1 ), Q11 ) ); @@ -1890,24 +1881,15 @@ void isar_rend_CldfbSplitPostRendProcess( { RealBuffer_fx[slot_idx] = Cldfb_RealBuffer_Binaural_fx[ch_idx][slot_idx]; ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[ch_idx][slot_idx]; -#ifdef NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES scaleFactor = s_min( scaleFactor, s_min( L_norm_arr( RealBuffer_fx[slot_idx], num_cldfb_bands ), L_norm_arr( ImagBuffer_fx[slot_idx], num_cldfb_bands ) ) ); scaleFactor = s_min( scaleFactor, L_norm_arr( hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_fx, hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_length ) ); -#else - scaleFactor = s_min( scaleFactor, s_min( getScaleFactor32( RealBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX ), getScaleFactor32( ImagBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX ) ) ); -#endif } scaleFactor = s_min( sub( scaleFactor, 6 ), Q24 ); // guarded bits FOR( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ ) { -#ifdef NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES Scale_sig32( RealBuffer_fx[slot_idx], num_cldfb_bands, scaleFactor ); Scale_sig32( ImagBuffer_fx[slot_idx], num_cldfb_bands, scaleFactor ); -#else - Scale_sig32( RealBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX, scaleFactor ); - Scale_sig32( ImagBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX, scaleFactor ); -#endif } Q_cldfb = scaleFactor + Q_cldfb_in; Scale_sig32( hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_fx, hBinHrSplitPostRend->cldfbSyn[ch_idx]->p_filter_length, sub( sub( Q_cldfb, 1 ), Q11 ) ); diff --git a/lib_isar/isar_splitRendererPre.c b/lib_isar/isar_splitRendererPre.c index 37ebdf278..2e5c0236c 100644 --- a/lib_isar/isar_splitRendererPre.c +++ b/lib_isar/isar_splitRendererPre.c @@ -59,17 +59,10 @@ static void isar_SplitRenderer_GetRotMd_fx( ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_RealBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_re, Word32 *Cldfb_ImagBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_im, -#else - Word32 Cldfb_RealBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_re, - Word32 Cldfb_ImagBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_im, -#endif const Word16 low_res, const Word16 ro_md_flag ); @@ -527,29 +520,15 @@ static void ComputePostPredCov_fx( static void ComputeBandedCrossCov_fx( -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_RealBuffer1_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_re_1, Word32 *Cldfb_ImagBuffer1_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_im_1, -#else - Word32 Cldfb_RealBuffer1_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_re_1, - Word32 Cldfb_ImagBuffer1_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_im_1, -#endif const Word16 ch_start_idx1, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_RealBuffer2_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_re_2, Word32 *Cldfb_ImagBuffer2_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_im_2, -#else - Word32 Cldfb_RealBuffer2_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_re_2, - Word32 Cldfb_ImagBuffer2_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_im_2, -#endif const Word16 ch_start_idx2, Word32 out_cov_re_fx[BINAURAL_CHANNELS][BINAURAL_CHANNELS], Word16 *exp_out_cov_re, @@ -682,17 +661,10 @@ static void ComputeBandedCrossCov_fx( static void ComputeBandedCov_fx( -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_RealBuffer_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_re, Word32 *Cldfb_ImagBuffer_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_im, -#else - Word32 Cldfb_RealBuffer_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_re, - Word32 Cldfb_ImagBuffer_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_im, -#endif const Word16 ch_start_idx, Word32 out_cov_re_fx[][BINAURAL_CHANNELS], Word16 *exp_cov_re, @@ -2186,19 +2158,12 @@ static void isar_SplitRenderer_quant_code( * *------------------------------------------------------------------------*/ static void isar_SplitRenderer_GetRotMd_fx( - ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ - MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP + ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i/o: binaural renderer handle */ + MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ Word32 *Cldfb_RealBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX], /* o : Reference Binaural signals */ Word16 exp_cldfb_re, Word32 *Cldfb_ImagBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX], /* o : Reference Binaural signals */ Word16 exp_cldfb_im, -#else - Word32 Cldfb_RealBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ - Word16 exp_cldfb_re, - Word32 Cldfb_ImagBuffer_Ref_Binaural_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* o : Reference Binaural signals */ - Word16 exp_cldfb_im, -#endif const Word16 low_res, const Word16 ro_md_flag ) { @@ -2297,17 +2262,10 @@ void isar_rend_CldfbSplitPreRendProcess( const ISAR_BIN_HR_SPLIT_PRE_REND_HANDLE hBinHrSplitPreRend, /* i : binaural pre-renderer handle */ const IVAS_QUATERNION headPosition, /* i : head rotation QUATERNION */ MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, /* i/o: pose correction data handle */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP - Word32 *Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i : Binaural signals, real part */ + Word32 *Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i : Binaural signals, real part */ Word16 exp_cldfb_re, Word32 *Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], Word16 exp_cldfb_im, -#else - Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_re, - Word32 Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word16 exp_cldfb_im, -#endif ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: ISAR bits handle */ const Word32 target_md_bits, /* i : ISAR MD bitrate */ const Word16 low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ @@ -2879,9 +2837,7 @@ ivas_error splitRendLc3plusEncodeAndWrite( pBits->pose_correction = hSplitBin->multiBinPoseData.poseCorrectionMode; pBits->codec_frame_size_ms = (Word16) ( hSplitBin->hLc3plusEnc->config.lc3plus_frame_duration_us / 1000 ); pBits->isar_frame_size_ms = (Word16) ( hSplitBin->hLc3plusEnc->config.isar_frame_duration_us / 1000 ); -#ifdef FIX_1437_LC3PLUS_EXTREND_HIRES pBits->lc3plus_highres = hSplitBin->hLc3plusEnc->config.high_res_mode_enabled; -#endif return IVAS_ERR_OK; } @@ -2920,11 +2876,9 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( UWord8 useLc3plus; Word32 *in_delayed_fx[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS]; Word16 i; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word16 j; Word32 *p_Cldfb_In_BinReal[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; Word32 *p_Cldfb_In_BinImag[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; -#endif Word32 num_slots; push_wmops( "isar_renderMultiTDBinToSplitBinaural" ); @@ -2934,7 +2888,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( useLc3plus = hSplitBin->hLc3plusEnc != NULL; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; ++i ) { FOR( j = 0; j < CLDFB_NO_COL_MAX; ++j ) @@ -2943,7 +2896,6 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( p_Cldfb_In_BinImag[i][j] = Cldfb_In_BinImag_fx[i][j]; } } -#endif IF( useLc3plus ) { @@ -3040,11 +2992,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( // target_md_bits = isar_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out_flag ) * L_FRAME48k / 48000; target_md_bits = W_extract_l( W_mult0_32_32( isar_get_split_rend_md_target_brate( SplitRendBitRate, pcm_out_flag ), L_FRAME48k ) ); tmp_e = 0; -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( target_md_bits, 48000, &tmp_e ); -#else tmp_32 = BASOP_Util_Divide3232_Scale_newton( target_md_bits, 48000, &tmp_e ); -#endif target_md_bits = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 /*scaling to max Q*/ @@ -3052,11 +3000,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( move32(); FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; i++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#else - FOR( Word16 j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#endif { scale_factor = s_min( scale_factor, s_min( getScaleFactor32( Cldfb_In_BinReal_fx[i][j], CLDFB_NO_CHANNELS_MAX ), getScaleFactor32( Cldfb_In_BinImag_fx[i][j], CLDFB_NO_CHANNELS_MAX ) ) ); } @@ -3064,11 +3008,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( scale_factor = sub( scale_factor, 2 ); FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; i++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#else - FOR( Word16 j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#endif { Scale_sig32( Cldfb_In_BinReal_fx[i][j], CLDFB_NO_CHANNELS_MAX, scale_factor ); Scale_sig32( Cldfb_In_BinImag_fx[i][j], CLDFB_NO_CHANNELS_MAX, scale_factor ); @@ -3081,17 +3021,10 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( hSplitBin->hBinHrSplitPreRend, headPosition, &hSplitBin->multiBinPoseData, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP p_Cldfb_In_BinReal, exp_cldfb_re, p_Cldfb_In_BinImag, exp_cldfb_im, -#else - Cldfb_In_BinReal_fx, - exp_cldfb_re, - Cldfb_In_BinImag_fx, - exp_cldfb_im, -#endif pBits, target_md_bits, low_res_pre_rend_rot, @@ -3108,11 +3041,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( // available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); available_bits = W_extract_l( W_mult0_32_32( SplitRendBitRate, L_mult0( hSplitBin->hSplitBinLCLDEnc->iNumBlocks, hSplitBin->hSplitBinLCLDEnc->iNumIterations ) ) ); tmp_e = 0; -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( available_bits, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#else tmp_32 = BASOP_Util_Divide3232_Scale_newton( available_bits, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#endif available_bits = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 available_bits = L_sub( available_bits, pBits->bits_written ); pBits->codec_frame_size_ms = codec_frame_size_ms; @@ -3121,13 +3050,8 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( move16(); isar_splitBinLCLDEncProcess( hSplitBin->hSplitBinLCLDEnc, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP p_Cldfb_In_BinReal, p_Cldfb_In_BinImag, -#else - Cldfb_In_BinReal_fx, - Cldfb_In_BinImag_fx, -#endif available_bits, pBits, &q_final ); @@ -3171,11 +3095,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( bit_len = W_extract_l( W_mult0_32_32( SplitRendBitRate, L_mult0( hSplitBin->hSplitBinLCLDEnc->iNumBlocks, hSplitBin->hSplitBinLCLDEnc->iNumIterations ) ) ); tmp_e = 0; -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( bit_len, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#else tmp_32 = BASOP_Util_Divide3232_Scale_newton( bit_len, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#endif bit_len = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 } ELSE @@ -3186,11 +3106,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( // bit_len = hSplitBin->hLc3plusEnc->config.ivas_frame_duration_us / 1000; // bit_len = SplitRendBitRate * bit_len / 1000; tmp_e = 0; -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( W_extract_l( W_mult0_32_32( SplitRendBitRate, bit_len ) ), 1000, &tmp_e ); -#else tmp_32 = BASOP_Util_Divide3232_Scale_newton( W_extract_l( W_mult0_32_32( SplitRendBitRate, bit_len ) ), 1000, &tmp_e ); -#endif bit_len = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 } } @@ -3214,14 +3130,9 @@ ivas_error isar_renderMultiTDBinToSplitBinaural( *------------------------------------------------------------------------*/ void lc3plusTimeAlignCldfbPoseCorr( - SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP + SPLIT_REND_WRAPPER *hSplitBin, /* i/o: Split renderer pre-renderer handle */ Word32 *Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, real part */ Word32 *Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: Binaural signals, imag. part */ -#else - Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: Binaural signals, real part */ - Word32 Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: Binaural signals, imag. part */ -#endif Word16 *Q_in ) { Word32 Cldfb_In_BinReal_tmp_fx[MAX_HEAD_ROT_POSES][BINAURAL_CHANNELS][2][CLDFB_NO_CHANNELS_MAX]; @@ -3241,11 +3152,7 @@ void lc3plusTimeAlignCldfbPoseCorr( } ELSE { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( Word16 i = 0; i < i_mult( hSplitBin->multiBinPoseData.num_poses, BINAURAL_CHANNELS ); i++ ) -#else - FOR( Word16 i = 0; i < CLDFB_NO_COL_MAX; i++ ) -#endif { for ( Word16 j = 0; j < CLDFB_NO_COL_MAX; j++ ) diff --git a/lib_isar/isar_stat.h b/lib_isar/isar_stat.h index 4576e7c1d..4b0b5ccda 100644 --- a/lib_isar/isar_stat.h +++ b/lib_isar/isar_stat.h @@ -256,7 +256,6 @@ typedef struct Word32 lc3plusDelaySamples; } SPLIT_REND_WRAPPER; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP typedef struct { Word32 *real; @@ -267,6 +266,5 @@ typedef struct Word16 is_full; } ISAR_CLDFB_RINGBUF, *ISAR_CLDFB_RINGBUF_HANDLE; -#endif #endif /* ISAR_STAT_H */ diff --git a/lib_isar/lib_isar_pre_rend.c b/lib_isar/lib_isar_pre_rend.c index 11bb0f808..f926b65a4 100644 --- a/lib_isar/lib_isar_pre_rend.c +++ b/lib_isar/lib_isar_pre_rend.c @@ -284,19 +284,14 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const Word16 isar_frame_size_ms, /* i : ISAR framesize */ Word16 codec_frame_size_ms, /* i/o: ISAR transport codec framesize */ ISAR_SPLIT_REND_BITS_HANDLE pBits, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ Word32 *Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ -#else - Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - Word32 Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], -#endif - const Word16 max_bands, /* i : CLDFB bands */ - Word32 *pOutput_fx[], /* i/o: PCM in/out buffer */ - const Word16 low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ - const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time domain input */ - const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ - const Word16 ro_md_flag, /* i : Flag to indicate real only metadata for yaw */ + const Word16 max_bands, /* i : CLDFB bands */ + Word32 *pOutput_fx[], /* i/o: PCM in/out buffer */ + const Word16 low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ + const Word16 cldfb_in_flag, /* i : Flag to indicate CLDFB or time domain input */ + const Word16 pcm_out_flag, /* i : Flag to indicate PCM output */ + const Word16 ro_md_flag, /* i : Flag to indicate real only metadata for yaw */ Word16 Q_buff, Word16 *Q_out ) { @@ -380,22 +375,14 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( // available_bits = ( SplitRendBitRate * hSplitBin->hSplitBinLCLDEnc->iNumBlocks * hSplitBin->hSplitBinLCLDEnc->iNumIterations ) / ( 16 * FRAMES_PER_SEC ); available_bits = W_extract_l( W_mult0_32_32( SplitRendBitRate, L_mult0( hSplitBin->hSplitBinLCLDEnc->iNumBlocks, hSplitBin->hSplitBinLCLDEnc->iNumIterations ) ) ); tmp_e = 0; -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( available_bits, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#else tmp_32 = BASOP_Util_Divide3232_Scale_newton( available_bits, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#endif available_bits = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 available_bits = L_sub( available_bits, pBits->bits_written ); pBits->codec_frame_size_ms = codec_frame_size_ms; q_final = sub( s_min( Q_buff_re, Q_buff_im ), 2 ); FOR( i = 0; i < hSplitBin->hSplitBinLCLDEnc->iChannels; i++ ) { -#ifdef FIX_2226_ISAR_PRE_CRASH_CLDFB_NO_CHANNELS FOR( j = 0; j < hSplitBin->hSplitBinLCLDEnc->iNumBlocks; j++ ) -#else - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#endif { Scale_sig32( Cldfb_In_BinReal_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( q_final, Q_buff_re ) ); Scale_sig32( Cldfb_In_BinImag_fx[i][j], CLDFB_NO_CHANNELS_MAX, sub( q_final, Q_buff_im ) ); @@ -427,11 +414,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( move16(); FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( j = 0; j < num_slots; j++ ) -#else - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#endif { q1 = s_min( getScaleFactor32( Cldfb_In_BinReal_fx[ch][j], CLDFB_NO_CHANNELS_MAX ), q1 ); q2 = s_min( getScaleFactor32( Cldfb_In_BinImag_fx[ch][j], CLDFB_NO_CHANNELS_MAX ), q2 ); @@ -445,11 +428,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( j = 0; j < num_slots; j++ ) -#else - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#endif { Scale_sig32( Cldfb_In_BinReal_fx[ch][j], CLDFB_NO_CHANNELS_MAX, sub( q_final, Q_buff_re ) ); Scale_sig32( Cldfb_In_BinImag_fx[ch][j], CLDFB_NO_CHANNELS_MAX, sub( q_final, Q_buff_im ) ); @@ -512,11 +491,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( move16(); q2 = 31; move16(); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( j = 0; j < num_slots; j++ ) -#else - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#endif { q1 = s_min( getScaleFactor32( Cldfb_In_BinReal_fx[ch][j], CLDFB_NO_CHANNELS_MAX ), q1 ); q2 = s_min( getScaleFactor32( Cldfb_In_BinImag_fx[ch][j], CLDFB_NO_CHANNELS_MAX ), q2 ); @@ -525,11 +500,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( q_final = s_min( add( Q_buff_re, q_final ), add( Q_buff_im, q_final ) ); q_final = sub( q_final, 6 ); // guard bits q_final = s_min( q_final, Q25 ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( j = 0; j < num_slots; j++ ) -#else - FOR( j = 0; j < CLDFB_NO_COL_MAX; j++ ) -#endif { Scale_sig32( Cldfb_In_BinReal_fx[ch][j], CLDFB_NO_CHANNELS_MAX, sub( q_final, Q_buff_re ) ); Scale_sig32( Cldfb_In_BinImag_fx[ch][j], CLDFB_NO_CHANNELS_MAX, sub( q_final, Q_buff_im ) ); @@ -573,11 +544,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( bit_len = W_extract_l( W_mult0_32_32( SplitRendBitRate, L_mult0( hSplitBin->hSplitBinLCLDEnc->iNumBlocks, hSplitBin->hSplitBinLCLDEnc->iNumIterations ) ) ); tmp_e = 0; -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( bit_len, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#else tmp_32 = BASOP_Util_Divide3232_Scale_newton( bit_len, L_mult0( 16, FRAMES_PER_SEC ), &tmp_e ); -#endif bit_len = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 } ELSE @@ -588,11 +555,7 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( // bit_len = hSplitBin->hLc3plusEnc->config.ivas_frame_duration_us / 1000; // bit_len = SplitRendBitRate * bit_len / 1000; tmp_e = 0; -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( W_extract_l( W_mult0_32_32( SplitRendBitRate, bit_len ) ), 1000, &tmp_e ); -#else tmp_32 = BASOP_Util_Divide3232_Scale_newton( W_extract_l( W_mult0_32_32( SplitRendBitRate, bit_len ) ), 1000, &tmp_e ); -#endif bit_len = L_shr( tmp_32, sub( 31, tmp_e ) ); // Q0 } } diff --git a/lib_isar/lib_isar_pre_rend.h b/lib_isar/lib_isar_pre_rend.h index 9ee1aae86..0e1ca5672 100644 --- a/lib_isar/lib_isar_pre_rend.h +++ b/lib_isar/lib_isar_pre_rend.h @@ -70,13 +70,8 @@ ivas_error ISAR_PRE_REND_MultiBinToSplitBinaural( const Word16 isar_frame_size_ms, /* i : ISAR framesize */ Word16 codec_frame_size_ms, /* i/o: Split renderer codec framesize */ ISAR_SPLIT_REND_BITS_HANDLE pBits, /* i/o: Split renderer bitstream handle */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32* Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB real buffer */ Word32* Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX], /* i/o: CLDFB imag buffer */ -#else - Word32 Cldfb_In_BinReal_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: CLDFB real buffer */ - Word32 Cldfb_In_BinImag_fx[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i/o: CLDFB imag buffer */ -#endif const Word16 max_bands, /* i : CLDFB bands */ Word32 *pOutput_fx[], /* i : low time resolution pre-renderer flag */ const Word16 low_res_pre_rend_rot, /* i : low time resolution pre-renderer flag */ diff --git a/lib_rend/ivas_cldfb_ring_buffer.c b/lib_rend/ivas_cldfb_ring_buffer.c index 49d88e8f3..6a3ee58dd 100644 --- a/lib_rend/ivas_cldfb_ring_buffer.c +++ b/lib_rend/ivas_cldfb_ring_buffer.c @@ -41,7 +41,6 @@ #endif #include "wmc_auto.h" -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------* * CLDFB ring-buffer functions needed in split-rendering outputs *---------------------------------------------------------------------*/ @@ -318,4 +317,3 @@ void ivas_CLDFB_RINGBUF_GetByIdx( return; } -#endif diff --git a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c index 9683cd743..b57f312be 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions_fx.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions_fx.c @@ -1065,12 +1065,7 @@ static void ivas_dirac_dec_binaural_internal_fx( { FOR( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe]; i++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[ch], tmp_Cldfb_out_re[ch][i], tmp_Cldfb_out_im[ch][i], CLDFB_NO_CHANNELS_MAX ); -#else - Copy32( tmp_Cldfb_out_re[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); - Copy32( tmp_Cldfb_out_im[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); -#endif } } } @@ -1130,19 +1125,11 @@ static void ivas_dirac_dec_binaural_internal_fx( Copy( st_ivas->hDiracDecBin[0]->ChCrossIm_e, hDiracDecBin->ChCrossIm_e, hSpatParamRendCom->num_freq_bands ); ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_local, subframe, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, -#else - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, -#endif subFrameTotalEne_fx, subFrameTotalEne_e, IIReneLimiter_fx, st_ivas->hMasaIsmData ); ivas_dirac_dec_binaural_determine_processing_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_local, subframe, -#ifdef FIX_1119_SPLIT_RENDERING_VOIP hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, -#else - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, -#endif nchanSeparateChannels, st_ivas->hMasaIsmData ); q_mat = hDiracDecBin->q_processMtx; @@ -1190,12 +1177,7 @@ static void ivas_dirac_dec_binaural_internal_fx( { FOR( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe]; i++ ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], tmp_Cldfb_out_re[ch][i], tmp_Cldfb_out_im[ch][i], CLDFB_NO_CHANNELS_MAX ); -#else - Copy32( tmp_Cldfb_out_re[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural_fx[pos_idx * BINAURAL_CHANNELS + ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); - Copy32( tmp_Cldfb_out_im[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural_fx[pos_idx * BINAURAL_CHANNELS + ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX ); -#endif } } @@ -1490,11 +1472,7 @@ static void ivas_dirac_dec_binaural_formulate_input_covariance_matrices_fx( move16(); den = BASOP_Util_Add_Mant32Exp( hDiracDecBin->ChEnePrev_fx[0][bin], hDiracDecBin->ChEnePrev_e[0][bin], hDiracDecBin->ChEnePrev_fx[1][bin], hDiracDecBin->ChEnePrev_e[1][bin], &den_e ); den = L_max( 1, den ); -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - IIReneLimiter_fx[bin] = BASOP_Util_Divide3232_Scale_cadence( num, den, &exp ); -#else IIReneLimiter_fx[bin] = BASOP_Util_Divide3232_Scale_newton( num, den, &exp ); -#endif exp = add( sub( num_e, den_e ), add( 5, exp ) ); IF( L_shr_sat( IIReneLimiter_fx[bin], sub( 31, exp ) ) > 0 ) { @@ -1996,11 +1974,7 @@ static void ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( move32(); /* Formulate average diffuseness over frame */ -#ifndef REMOVE_BASOP_Util_Divide3232_Scale_cadence - frameMeanDiffuseness = BASOP_Util_Divide3232_Scale_cadence( frameMeanDiffuseness, L_max( EPSILLON_FX, frameMeanDiffusenessEneWeight_fx[bin] ), &exp ); // exp = exp + 31 - q_meanEnePerCh - exp1 -#else frameMeanDiffuseness = BASOP_Util_Divide3232_Scale_newton( frameMeanDiffuseness, L_max( EPSILLON_FX, frameMeanDiffusenessEneWeight_fx[bin] ), &exp ); // exp = exp + 31 - q_meanEnePerCh - exp1 -#endif exp = sub( exp, sub( sub( 31, q_meanEnePerCh ), exp1 ) ); hDiracDecBin->frameMeanDiffuseness_fx[bin] = L_shl( frameMeanDiffuseness, sub( exp, 2 ) ); // Q29 move32(); @@ -5833,7 +5807,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( move16(); move16(); -#ifdef FIX_2140_OBJECT_EDITING_SANITIZER_ISSUES totalTargetEneCh[0] = subframeEneCh[0]; // subQch[0] move32(); totalTargetEneCh[1] = subframeEneCh[1]; // subQch[1] @@ -5842,20 +5815,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( move32(); masaEneThisCh[1] = subframeEneCh[1]; // subQch[1] move32(); -#else - /* Zero check */ - IF( GT_32( subframeEne, 0 ) ) - { - totalTargetEneCh[0] = subframeEneCh[0]; // subQch[0] - move32(); - totalTargetEneCh[1] = subframeEneCh[1]; // subQch[1] - move32(); - masaEneThisCh[0] = subframeEneCh[0]; // subQch[0] - move32(); - masaEneThisCh[1] = subframeEneCh[1]; // subQch[1] - move32(); - } -#endif /* Gain editing */ /* For each object, estimate new target energy per channel based on the applied gain */ @@ -5991,13 +5950,11 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( } -#ifdef NONBE_1399_1400_FIX_OBJ_EDIT_ISSUES /* Limit target energies to non-negative values */ FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { totalTargetEneCh[ch] = L_max( 0, totalTargetEneCh[ch] ); } -#endif /* due to rounding, the sum may exceed 1.0f ever so slightly, so clip it */ ratioAccOrig = L_min( ratioAccOrig, ONE_IN_Q30 ); @@ -6359,12 +6316,8 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx( { temp = BASOP_Util_Divide3232_Scale_newton( hMasaIsmData->preprocEneTarget_fx[band_idx], L_max( 1, hMasaIsmData->preprocEneRealized_fx[band_idx] ), &temp_q ); temp_q = sub( Q31, sub( sub( Q31, temp_q ), sub( hMasaIsmData->preprocEneTarget_e[band_idx], hMasaIsmData->preprocEneRealized_e[band_idx] ) ) ); - temp = Sqrt32( temp, &temp_q ); // Q: 31-temp_q -#ifdef FIX_2164_ASSERT_IN_OMASA_PREPROC_FOR_EDIT + temp = Sqrt32( temp, &temp_q ); // Q: 31-temp_q temp = L_shl_sat( temp, sub( temp_q, 3 ) ); // Q28 -#else - temp = L_shl( temp, sub( temp_q, 3 ) ); // Q28 -#endif temp_q = Q28; move16(); } @@ -6718,7 +6671,6 @@ static void ivas_masa_ext_rend_parambin_internal_fx( Copy( hMasaExtRend->hDiracDecBin[0]->ChCrossRe_e, hDiracDecBin->ChCrossRe_e, hSpatParamRendCom->num_freq_bands ); Copy( hMasaExtRend->hDiracDecBin[0]->ChCrossIm_e, hDiracDecBin->ChCrossIm_e, hSpatParamRendCom->num_freq_bands ); -#ifdef NONBE_FIX_1442_MASA_EXT_REND_ORIENT_IDX ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_local, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, subFrameTotalEne_fx, subFrameTotalEne_e, IIReneLimiter_fx, NULL ); @@ -6726,15 +6678,6 @@ static void ivas_masa_ext_rend_parambin_internal_fx( ivas_dirac_dec_binaural_determine_processing_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_local, subframe, hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[hCombinedOrientationData->subframe_idx] > 0, 0, NULL ); -#else - ivas_dirac_dec_binaural_formulate_target_covariance_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, Rmat_local, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, - subFrameTotalEne_fx, subFrameTotalEne_e, IIReneLimiter_fx, NULL ); - - ivas_dirac_dec_binaural_determine_processing_matrices_fx( hDiracDecBin, hSpatParamRendCom, &config_data, max_band_decorr, Rmat_local, subframe, - hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0, - 0, NULL ); -#endif q_mat = hDiracDecBin->q_processMtx; move16(); diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index fed740577..563e2be05 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -1345,13 +1345,11 @@ ivas_error ivas_render_config_init_from_rom_fx( RENDER_CONFIG_HANDLE *hRenderConfig /* i/o: Renderer config handle */ ); -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE ivas_error ivas_render_config_change_defaults( RENDER_CONFIG_HANDLE hRenderConfig, /* i/o: Renderer config handle */ IVAS_DefaultReverbSize reverbDefault /* i: Reverb default size */ ); -#endif /*----------------------------------------------------------------------------------* * Quaternion operations @@ -1622,7 +1620,6 @@ void ivas_TD_RINGBUF_Close( TD_RINGBUF_HANDLE *ph /* i/o: Ring buffer handle */ ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP void ivas_TD_RINGBUF_PushInterleaved( TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ const Word32 *data, /* i : Input audio in interleaved channels layout */ @@ -1646,24 +1643,6 @@ void ivas_TD_RINGBUF_PopChannels( Word32 *p_channels[], /* i : Array of pointers to each output channel */ const Word16 num_samples_per_channel /* i : Number of samples per channel to pop */ ); -#else -void ivas_TD_RINGBUF_Push( - TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ - const Word32 *data, /* i : Input data */ - const Word16 num_samples_per_channel /* i : Number of samples per channel to store */ -); - -void ivas_TD_RINGBUF_PushZeros( - TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ - const Word16 num_samples_per_channel /* i : Number of zeros per channel to store */ -); - -void ivas_TD_RINGBUF_Pop( - TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ - Word32 *data, /* i : Output data */ - const Word16 num_samples_per_channel /* i : Number of samples per channel to retrieve*/ -); -#endif Word16 ivas_TD_RINGBUF_Size( const TD_RINGBUF_HANDLE h /* i : Ring buffer handle */ diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index e4c6f62f7..9a6f79fea 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -42,7 +42,6 @@ * Local constants *-----------------------------------------------------------------------*/ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE #define IVAS_REVERB_DEFAULT_L_PRE_DELAY_FX 2147484 // 0.016 #define IVAS_REVERB_DEFAULT_L_INPUT_DELAY_FX 13421773 // 0.1 @@ -51,10 +50,6 @@ #define IVAS_REVERB_DEFAULT_M_PRE_DELAY_FX 1677722 // 0.0125f #define IVAS_REVERB_DEFAULT_M_INPUT_DELAY_FX 0 // 0.0f -#else -#define IVAS_REVERB_DEFAULT_PRE_DELAY_FX 2147484 // 0.016 -#define IVAS_REVERB_DEFAULT_INPUT_DELAY_FX 13421773 // 0.1 -#endif #define IVAS_REVERB_DEFAULT_USE_ER 0 @@ -118,40 +113,23 @@ ivas_error ivas_render_config_init_from_rom_fx( { return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Unexpected null pointer while attempting to fill renderer configuration from ROM" ); } -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT ( *hRenderConfig )->roomAcoustics.aeID = IVAS_DEFAULT_AEID; move16(); -#endif -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_L_N_BANDS; move16(); ( *hRenderConfig )->roomAcoustics.acousticPreDelay_fx = IVAS_REVERB_DEFAULT_L_PRE_DELAY_FX; move32(); ( *hRenderConfig )->roomAcoustics.inputPreDelay_fx = IVAS_REVERB_DEFAULT_L_INPUT_DELAY_FX; move32(); -#else - ( *hRenderConfig )->roomAcoustics.nBands = IVAS_REVERB_DEFAULT_N_BANDS; - move16(); - ( *hRenderConfig )->roomAcoustics.acousticPreDelay_fx = IVAS_REVERB_DEFAULT_PRE_DELAY_FX; - move32(); - ( *hRenderConfig )->roomAcoustics.inputPreDelay_fx = IVAS_REVERB_DEFAULT_INPUT_DELAY_FX; - move32(); -#endif ( *hRenderConfig )->roomAcoustics.use_er = IVAS_REVERB_DEFAULT_USE_ER; move16(); set32_fx( &( *hRenderConfig )->roomAcoustics.pFc_input_fx[0], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( &( *hRenderConfig )->roomAcoustics.pAcoustic_rt60_fx[0], 0, CLDFB_NO_CHANNELS_MAX ); set32_fx( &( *hRenderConfig )->roomAcoustics.pAcoustic_dsr_fx[0], 0, CLDFB_NO_CHANNELS_MAX ); -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE Copy32( ivas_reverb_default_large_fc_fx, ( *hRenderConfig )->roomAcoustics.pFc_input_fx, IVAS_REVERB_DEFAULT_L_N_BANDS ); Copy32( ivas_reverb_default_large_RT60_fx, ( *hRenderConfig )->roomAcoustics.pAcoustic_rt60_fx, IVAS_REVERB_DEFAULT_L_N_BANDS ); Copy32( ivas_reverb_default_large_DSR_fx, ( *hRenderConfig )->roomAcoustics.pAcoustic_dsr_fx, IVAS_REVERB_DEFAULT_L_N_BANDS ); -#else - Copy32( ivas_reverb_default_fc_fx, ( *hRenderConfig )->roomAcoustics.pFc_input_fx, IVAS_REVERB_DEFAULT_N_BANDS ); - Copy32( ivas_reverb_default_RT60_fx, ( *hRenderConfig )->roomAcoustics.pAcoustic_rt60_fx, IVAS_REVERB_DEFAULT_N_BANDS ); - Copy32( ivas_reverb_default_DSR_fx, ( *hRenderConfig )->roomAcoustics.pAcoustic_dsr_fx, IVAS_REVERB_DEFAULT_N_BANDS ); -#endif FOR( i = 0; i < MAX_NUM_OBJECTS; i++ ) { @@ -192,7 +170,6 @@ ivas_error ivas_render_config_init_from_rom_fx( return IVAS_ERR_OK; } -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE /*-------------------------------------------------------------------* * ivas_render_config_change_defaults() @@ -264,4 +241,3 @@ ivas_error ivas_render_config_change_defaults( return IVAS_ERR_OK; } -#endif diff --git a/lib_rend/ivas_rom_rend.h b/lib_rend/ivas_rom_rend.h index 121f019df..d52ade0db 100644 --- a/lib_rend/ivas_rom_rend.h +++ b/lib_rend/ivas_rom_rend.h @@ -107,7 +107,6 @@ extern const Word32 t_design_11_elevation_int[70]; /*Q-22*/ * Reverberator ROM tables *-----------------------------------------------------------------------*/ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE extern const Word32 ivas_reverb_default_small_fc_fx[]; /*Q-16*/ extern const Word32 ivas_reverb_default_small_RT60_fx[]; /*Q-26*/ extern const Word32 ivas_reverb_default_small_DSR_fx[]; /*Q-30*/ @@ -119,11 +118,6 @@ extern const Word32 ivas_reverb_default_medium_DSR_fx[]; /*Q-30*/ extern const Word32 ivas_reverb_default_large_fc_fx[]; /*Q-16*/ extern const Word32 ivas_reverb_default_large_RT60_fx[]; /*Q-26*/ extern const Word32 ivas_reverb_default_large_DSR_fx[]; /*Q-30*/ -#else -extern const Word32 ivas_reverb_default_fc_fx[]; /*Q-16*/ -extern const Word32 ivas_reverb_default_RT60_fx[]; /*Q-26*/ -extern const Word32 ivas_reverb_default_DSR_fx[]; /*Q-30*/ -#endif /*----------------------------------------------------------------------------------* * EFAP ROM tables diff --git a/lib_rend/ivas_rom_rend_fx.c b/lib_rend/ivas_rom_rend_fx.c index fd56885f9..dca4600ee 100644 --- a/lib_rend/ivas_rom_rend_fx.c +++ b/lib_rend/ivas_rom_rend_fx.c @@ -246,7 +246,6 @@ const Word32 t_design_11_elevation_int[70] = //Q22 * Reverberator ROM tables *-----------------------------------------------------------------------*/ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE const Word32 ivas_reverb_default_small_fc_fx[IVAS_REVERB_DEFAULT_S_N_BANDS] = { 13107200, 39321600, 65536000, 91750400, 117964800, 144179200, 170393600, 196608000, 222822400, 249036800, @@ -312,13 +311,8 @@ const Word32 ivas_reverb_default_medium_DSR_fx[IVAS_REVERB_DEFAULT_M_N_BANDS] = 13653, 7464, 6609, 12688, 7607, 3835, 2373 }; -#endif -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE const Word32 ivas_reverb_default_large_fc_fx[IVAS_REVERB_DEFAULT_L_N_BANDS] /*Q16*/ = -#else -const Word32 ivas_reverb_default_fc_fx[IVAS_REVERB_DEFAULT_N_BANDS] /*Q16*/ = -#endif { 1310720, 1638400, 2064384, 2621440, 3276800, 4128768, 5242880, 6553600, 8192000, @@ -330,11 +324,7 @@ const Word32 ivas_reverb_default_fc_fx[IVAS_REVERB_DEFAULT_N_BANDS] /*Q16*/ = 1048576000, 1310720000 }; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE const Word32 ivas_reverb_default_large_RT60_fx[IVAS_REVERB_DEFAULT_L_N_BANDS] /*Q26*/ = -#else -const Word32 ivas_reverb_default_RT60_fx[IVAS_REVERB_DEFAULT_N_BANDS] /*Q26*/ = -#endif { 91415696, 97213904, 88368952, 105944760, 99092952, 93643712, 86496616, 90341952, @@ -346,11 +336,7 @@ const Word32 ivas_reverb_default_RT60_fx[IVAS_REVERB_DEFAULT_N_BANDS] /*Q26*/ = 48281472, 41394088, 40286124 }; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE const Word32 ivas_reverb_default_large_DSR_fx[IVAS_REVERB_DEFAULT_L_N_BANDS] /*Q30*/ = -#else -const Word32 ivas_reverb_default_DSR_fx[IVAS_REVERB_DEFAULT_N_BANDS] /*Q30*/ = -#endif { 20, 23, 15, 16, 13, 20, 25, 42, @@ -591,7 +577,6 @@ const LS_CONVERSION_MATRIX_FX ls_conversion_cicp19_cicp16_fx[] = // Q30 }; /* Upmix matrices */ -#ifdef FIX_1419_MONO_STEREO_UMX const LS_CONVERSION_MATRIX_FX ls_conversion_mono_cicpX_fx[] = // Q30 { /* First row indicates the number of non-zero elements and the number of matrix columns */ @@ -600,7 +585,6 @@ const LS_CONVERSION_MATRIX_FX ls_conversion_mono_cicpX_fx[] = // Q30 {2, 1073741824}, }; -#endif const LS_CONVERSION_MATRIX_FX ls_conversion_cicp12_cicp14_fx[] = // Q30 { /* First row indicates the number of non-zero elements and the number of matrix columns */ @@ -686,9 +670,7 @@ const LS_CONVERSION_MATRIX_FX ls_conversion_cicp16_cicp19_fx[] = // Q30 const LS_CONVERSION_MAPPING_FX ls_conversion_mapping_fx[LS_SETUP_CONVERSION_NUM_MAPPINGS] = { /* Dowmix mappings - NULL is a special case for MONO / STEREO downmix */ -#ifdef FIX_1419_MONO_STEREO_UMX {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_MONO, NULL}, -#endif {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_MONO, NULL}, {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_MONO, NULL}, {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_MONO, NULL}, @@ -716,13 +698,11 @@ const LS_CONVERSION_MAPPING_FX ls_conversion_mapping_fx[LS_SETUP_CONVERSION_NUM_ {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_cicp19_cicp16_fx}, /* Upmix mappings - NULL implies a 1:1 upmix */ -#ifdef FIX_1419_MONO_STEREO_UMX {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1, ls_conversion_mono_cicpX_fx}, {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_7_1, ls_conversion_mono_cicpX_fx}, {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1_2, ls_conversion_mono_cicpX_fx}, {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_mono_cicpX_fx}, {IVAS_AUDIO_CONFIG_MONO, IVAS_AUDIO_CONFIG_7_1_4, ls_conversion_mono_cicpX_fx}, -#endif {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_5_1, NULL}, {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_7_1, NULL}, {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_5_1_2, NULL}, diff --git a/lib_rend/ivas_rotation_fx.c b/lib_rend/ivas_rotation_fx.c index a7cedde65..4536b7b91 100644 --- a/lib_rend/ivas_rotation_fx.c +++ b/lib_rend/ivas_rotation_fx.c @@ -1494,7 +1494,6 @@ ivas_error ivas_combined_orientation_open_fx( move16(); ( *hCombinedOrientationData )->cur_subframe_samples_rendered = 0; move16(); -#ifdef RTP_S4_251135_CR26253_0016_REV1 FOR( i = 0; i < ( 1 + IVAS_MAX_NUM_OBJECTS ); i++ ) { @@ -1503,7 +1502,6 @@ ivas_error ivas_combined_orientation_open_fx( } ( *hCombinedOrientationData )->isDiegeticInputPISet = FALSE; move16(); -#endif return IVAS_ERR_OK; } @@ -1707,7 +1705,6 @@ ivas_error combine_external_and_head_orientations( } ELSE IF( hExtOrientationData == NULL && headRotQuaternions != NULL ) { -#ifdef RTP_S4_251135_CR26253_0016_REV1 /* Disable head rotation if diegetic PI data indicating non-diegetic audio is received */ test(); test(); @@ -1739,13 +1736,6 @@ ivas_error combine_external_and_head_orientations( move16(); } } -#else - /* Head rotation only */ - FOR( i = 0; i < hCombinedOrientationData->num_subframes; i++ ) - { - hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i]; - } -#endif } IF( hExtOrientationData != NULL ) @@ -1899,7 +1889,6 @@ ivas_error combine_external_and_head_orientations( move16(); } -#ifdef RTP_S4_251135_CR26253_0016_REV1 /* Disable head rotation if diegetic PI data indicating non-diegetic audio is received */ test(); test(); @@ -1947,32 +1936,6 @@ ivas_error combine_external_and_head_orientations( } } } -#else - /* Use the most recent head rotation */ - IF( EQ_16( hExtOrientationData->enableHeadRotation[i], 1 ) ) - { - IF( hExtOrientationData->enableExternalOrientation[i] > 0 ) - { - QuaternionProduct_fx( hCombinedOrientationData->Quaternions[i], headRotQuaternions[i], &hCombinedOrientationData->Quaternions[i] ); - } - ELSE - { - hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i]; - } - } - /* Use the freezed head rotation */ - ELSE IF( EQ_16( hExtOrientationData->enableHeadRotation[i], 2 ) ) - { - IF( hExtOrientationData->enableExternalOrientation[i] > 0 ) - { - QuaternionProduct_fx( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Quaternion_frozen_head, &hCombinedOrientationData->Quaternions[i] ); - } - ELSE - { - hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternion_frozen_head; - } - } -#endif /* Reset the combined orientations to identity */ test(); IF( hExtOrientationData->enableHeadRotation[i] == 0 && hExtOrientationData->enableExternalOrientation[i] == 0 ) @@ -2125,7 +2088,6 @@ ivas_error combine_external_and_head_orientations( hCombinedOrientationData->sr_pose_pred_axis = sr_pose_pred_axis; move32(); -#ifdef IVAS_RTPDUMP /* Reset external orientations */ IF( hExtOrientationData != NULL ) @@ -2140,7 +2102,6 @@ ivas_error combine_external_and_head_orientations( move16(); } } -#endif return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 07cf0c6fa..d84a00a1b 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -852,10 +852,8 @@ typedef struct ivas_combined_orientation_struct Word16 cur_subframe_samples_rendered; Word16 subframe_idx_start; Word16 cur_subframe_samples_rendered_start; -#ifdef RTP_S4_251135_CR26253_0016_REV1 bool isDiegeticInputPI[1 + IVAS_MAX_NUM_OBJECTS]; bool isDiegeticInputPISet; -#endif } COMBINED_ORIENTATION_DATA, *COMBINED_ORIENTATION_HANDLE; diff --git a/lib_rend/ivas_td_ring_buffer_fx.c b/lib_rend/ivas_td_ring_buffer_fx.c index 5866c31ad..78fde65d8 100644 --- a/lib_rend/ivas_td_ring_buffer_fx.c +++ b/lib_rend/ivas_td_ring_buffer_fx.c @@ -78,7 +78,6 @@ static Word16 ivas_td_ringbuf_has_space_for_num_samples( } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP static void ivas_td_ringbuf_push_interleaved( TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ const Word32 *data, /* i : Input audio in interleaved channels layout */ @@ -118,7 +117,6 @@ static void ivas_td_ringbuf_push_interleaved( return; } -#endif /*-----------------------------------------------------------------------* @@ -211,7 +209,6 @@ void ivas_TD_RINGBUF_Close( } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------* * ivas_TD_RINGBUF_PushInterleaved() * @@ -241,45 +238,24 @@ void ivas_TD_RINGBUF_PushChannels( const Word32 *p_channels[], /* i : Array of pointers to each input channel */ const Word16 num_samples_per_channel /* i : Number of samples per channel to push */ ) -#else -/*---------------------------------------------------------------------* - * ivas_TD_RINGBUF_Push() - * - * Push samples onto the back of the TD ring buffer. - * Returns total number of buffered samples (includes number of channels) - *---------------------------------------------------------------------*/ - -void ivas_TD_RINGBUF_Push( - TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ - const Word32 *data, /* i : Input data */ - const Word16 num_samples_per_channel /* i : Number of samples per channel to store */ -) -#endif { Word32 s; Word16 c; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP assert( h != NULL ); assert( p_channels != NULL ); for ( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ { assert( p_channels[c] != NULL ); } -#endif assert( ivas_td_ringbuf_has_space_for_num_samples( h, num_samples_per_channel * h->num_channels ) ); FOR( s = 0; s < num_samples_per_channel; ++s ) { FOR( c = 0; c < h->num_channels; ++c ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP h->data[h->write_pos] = p_channels[c][s]; move32(); -#else - h->data[h->write_pos] = data[L_mac0( s, c, num_samples_per_channel )]; - move32(); -#endif h->write_pos = L_add( h->write_pos, 1 ); if ( EQ_32( h->write_pos, h->capacity ) ) @@ -300,7 +276,6 @@ void ivas_TD_RINGBUF_Push( } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------* * ivas_TD_RINGBUF_PushConstant() * @@ -317,55 +292,8 @@ void ivas_TD_RINGBUF_PushConstant( return; } -#else -/*---------------------------------------------------------------------* - * ivas_TD_RINGBUF_PushZeros() - * - * Push zero samples onto the back of the TD ring buffer. - *---------------------------------------------------------------------*/ - -void ivas_TD_RINGBUF_PushZeros( - TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ - const Word16 num_samples_per_channel /* i : Number of zeros per channel to store */ -) -{ - Word32 s; - Word16 c; - assert( ivas_td_ringbuf_has_space_for_num_samples( h, num_samples_per_channel * h->num_channels ) ); - IF( !num_samples_per_channel ) - { - return; - } - - FOR( s = 0; s < num_samples_per_channel; ++s ) - { - FOR( c = 0; c < h->num_channels; ++c ) - { - h->data[h->write_pos] = 0; - move32(); - h->write_pos = L_add( h->write_pos, 1 ); - IF( EQ_32( h->write_pos, h->capacity ) ) - { - h->write_pos = 0; - move32(); - } - } - } - - if ( EQ_32( h->read_pos, h->write_pos ) ) - { - h->is_full = 1; - move16(); - } - - return; -} -#endif - - -#ifdef FIX_1119_SPLIT_RENDERING_VOIP /*---------------------------------------------------------------------* * ivas_TD_RINGBUF_PopChannels() * @@ -377,44 +305,24 @@ void ivas_TD_RINGBUF_PopChannels( Word32 *p_channels[], /* i : Array of pointers to each output channel */ const Word16 num_samples_per_channel /* i : Number of samples per channel to pop */ ) -#else -/*---------------------------------------------------------------------* - * ivas_TD_RINGBUF_Pop() - * - * Pop samples from the front of the TD ring buffer. - *---------------------------------------------------------------------*/ - -void ivas_TD_RINGBUF_Pop( - TD_RINGBUF_HANDLE h, /* i/o: Ring buffer handle */ - Word32 *data, /* i : Output data */ - const Word16 num_samples_per_channel /* i : Number of samples per channel to retrieve */ -) -#endif { Word32 s; Word16 c; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP assert( h != NULL ); assert( p_channels != NULL ); for ( c = 0; c < h->num_channels; ++c ) /* Not using BASOP FOR because this loops only does assertions */ { assert( p_channels[c] != NULL ); } -#endif assert( ivas_td_ringbuf_total_size( h ) >= num_samples_per_channel * h->num_channels ); FOR( s = 0; s < num_samples_per_channel; ++s ) { FOR( c = 0; c < h->num_channels; ++c ) { -#ifdef FIX_1119_SPLIT_RENDERING_VOIP p_channels[c][s] = h->data[h->read_pos]; move32(); -#else - data[L_mac0( s, c, num_samples_per_channel )] = h->data[h->read_pos]; - move32(); -#endif ++h->read_pos; IF( EQ_32( h->read_pos, h->capacity ) ) @@ -425,19 +333,11 @@ void ivas_TD_RINGBUF_Pop( } } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( NE_16( num_samples_per_channel, 0 ) ) { h->is_full = 0; move16(); } -#else - IF( h->is_full ) - { - h->is_full = 0; - move16(); - } -#endif return; } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 1dd238afd..84dc763f2 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -268,7 +268,6 @@ ivas_error IVAS_REND_FeedRenderConfig( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ); -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE ivas_error IVAS_REND_GetReverbRoomSize( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ @@ -279,7 +278,6 @@ ivas_error IVAS_REND_SetReverbRoomSize( IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ const IVAS_ROOM_SIZE_T reverbRoomSize /* i : Reverb room size */ ); -#endif ivas_error IVAS_REND_FeedSplitBinauralBitstream( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ @@ -304,12 +302,8 @@ ivas_error IVAS_REND_GetSplitRendBitstreamHeader( ISAR_SPLIT_REND_CODEC *pCodec, /* o : pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o : pointer to pose correction mode */ Word16 *pCodec_frame_size_ms, /* o : pointer to codec frame size setting */ -#ifdef FIX_1437_LC3PLUS_EXTREND_HIRES Word16 *pIsar_frame_size_ms, /* o : pointer to ISAR frame size setting */ Word16 *pLc3plusHighRes /* o : pointer to LC3plus High-Res setting */ -#else - Word16 *pIsar_frame_size_ms /* o : pointer to ISAR frame size setting */ -#endif ); ivas_error IVAS_REND_SetHeadRotation( diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 1fdd31ff5..d45c79be0 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -102,9 +102,7 @@ typedef struct const Word16 *pSplitRendBFI; const SPLIT_REND_WRAPPER *pSplitRendWrapper; const COMBINED_ORIENTATION_HANDLE *pCombinedOrientationData; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE const IVAS_DefaultReverbSize *pSelectedRoomReverbSize; -#endif } rendering_context; /* Common base for input structs */ @@ -233,9 +231,7 @@ struct IVAS_REND Word8 rendererConfigEnabled; RENDER_CONFIG_DATA *hRendererConfig; /* Renderer config pointer */ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE IVAS_DefaultReverbSize selectedRoomReverbSize; -#endif #ifdef DEBUGGING Word32 numClipping; /* Counter of clipped output samples */ @@ -1378,9 +1374,7 @@ static rendering_context getRendCtx( ctx.pSplitRendBFI = &hIvasRend->splitRendBFI; ctx.pSplitRendWrapper = hIvasRend->splitRendWrapper; ctx.pCombinedOrientationData = &hIvasRend->hCombinedOrientationData; -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE ctx.pSelectedRoomReverbSize = &hIvasRend->selectedRoomReverbSize; -#endif return ctx; } @@ -1655,11 +1649,9 @@ static ivas_error alignInputDelay( input_ism *inputIsm; Word16 maxGlobalDelaySamples, numSamplesToPush, numSamplesToPop; UWord16 ringBufferSize, preDelay; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word16 i; const Word32 *p_read_channels[MAX_INPUT_CHANNELS]; Word32 *p_write_channels[MAX_INPUT_CHANNELS]; -#endif maxGlobalDelaySamples = latencyNsToSamples( sampleRateOut, maxGlobalDelayNs ); maxGlobalDelaySamples = shl( maxGlobalDelaySamples, cldfb2tdSampleShift ); @@ -1684,11 +1676,7 @@ static ivas_error alignInputDelay( /* for the first frame we need to push zeros to align the input delay to the global delay * and then push a frame of actual data */ -#ifdef FIX_1119_SPLIT_RENDERING_VOIP ivas_TD_RINGBUF_PushConstant( inputBase->delayBuffer, 0, preDelay ); -#else - ivas_TD_RINGBUF_PushZeros( inputBase->delayBuffer, preDelay ); -#endif /* for ISM inputs, ensure the metadata sync delay is updated */ IF( getAudioConfigType( inputBase->inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) @@ -1722,7 +1710,6 @@ static ivas_error alignInputDelay( move16(); } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP FOR( i = 0; i < inputAudio.config.numChannels; ++i ) { Word32 tmp; @@ -1740,10 +1727,6 @@ static ivas_error alignInputDelay( p_write_channels[i] = inputBase->inputBuffer.data_fx + tmp; } ivas_TD_RINGBUF_PopChannels( inputBase->delayBuffer, p_write_channels, numSamplesToPop ); -#else - ivas_TD_RINGBUF_Push( inputBase->delayBuffer, inputAudio.data_fx, numSamplesToPush ); - ivas_TD_RINGBUF_Pop( inputBase->delayBuffer, inputBase->inputBuffer.data_fx, numSamplesToPop ); -#endif } ELSE { @@ -3636,10 +3619,8 @@ ivas_error IVAS_REND_Open( move32(); hIvasRend->efapOutWrapper.pCustomLsSetup = NULL; move32(); -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_UNSET; move32(); -#endif hIvasRend->num_subframes = num_subframes; move16(); @@ -4391,7 +4372,6 @@ static ivas_error isar_pre_rend_init( return IVAS_ERR_OK; } -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE static IVAS_ROOM_SIZE_T getDefaultReverbSize( input_ism *ismInputs, input_masa *masaInputs, @@ -4483,7 +4463,6 @@ static IVAS_ROOM_SIZE_T getDefaultReverbSize( return selectedReverb; } -#endif /*-------------------------------------------------------------------* * IVAS_REND_AddInput() @@ -4591,7 +4570,6 @@ ivas_error IVAS_REND_AddInput_fx( /* set global maximum delay after adding an input */ setMaxGlobalDelayNs( hIvasRend ); -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE /* select default reverb size after adding an input */ IF( EQ_32( hIvasRend->selectedRoomReverbSize, DEFAULT_REVERB_UNSET ) ) @@ -4602,7 +4580,6 @@ ivas_error IVAS_REND_AddInput_fx( hIvasRend->inputsMc, hIvasRend->inputsSba ) ); } -#endif return IVAS_ERR_OK; } @@ -5262,10 +5239,8 @@ ivas_error IVAS_REND_GetRenderConfig( } hRCin = hIvasRend->hRendererConfig; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT hRCout->roomAcoustics.aeID = hRCin->roomAcoustics.aeID; move16(); -#endif hRCout->roomAcoustics.nBands = hRCin->roomAcoustics.nBands; hRCout->roomAcoustics.acousticPreDelay_fx = hRCin->roomAcoustics.acousticPreDelay_fx; hRCout->roomAcoustics.inputPreDelay_fx = hRCin->roomAcoustics.inputPreDelay_fx; @@ -5294,9 +5269,7 @@ ivas_error IVAS_REND_GetRenderConfig( move16(); move32(); -#ifdef FIX_1053_REVERB_RECONFIGURATION Copy32( hRCin->distAtt_fx, hRCout->distAtt_fx, 3 ); -#endif return IVAS_ERR_OK; } @@ -5329,10 +5302,8 @@ ivas_error IVAS_REND_FeedRenderConfig( hRenderConfig = hIvasRend->hRendererConfig; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT hRenderConfig->roomAcoustics.aeID = renderConfig.roomAcoustics.aeID; move16(); -#endif hRenderConfig->roomAcoustics.nBands = renderConfig.roomAcoustics.nBands; move16(); hRenderConfig->roomAcoustics.acousticPreDelay_fx = renderConfig.roomAcoustics.acousticPreDelay_fx; @@ -5343,9 +5314,7 @@ ivas_error IVAS_REND_FeedRenderConfig( Copy32( renderConfig.roomAcoustics.pAcoustic_rt60_fx, hRenderConfig->roomAcoustics.pAcoustic_rt60_fx, CLDFB_NO_CHANNELS_MAX ); Copy32( renderConfig.roomAcoustics.pAcoustic_dsr_fx, hRenderConfig->roomAcoustics.pAcoustic_dsr_fx, CLDFB_NO_CHANNELS_MAX ); Copy( renderConfig.directivity_fx, hRenderConfig->directivity_fx, 3 * MAX_NUM_OBJECTS ); -#ifdef FIX_1053_REVERB_RECONFIGURATION Copy32( renderConfig.distAtt_fx, hRenderConfig->distAtt_fx, 3 ); -#endif hRenderConfig->roomAcoustics.use_er = 0; move16(); @@ -5832,7 +5801,6 @@ ivas_error IVAS_REND_CombineHeadAndExternalOrientation( * *---------------------------------------------------------------------*/ -#ifdef FIX_1318_ROOM_SIZE_CMD_LINE /*---------------------------------------------------------------------* * IVAS_REND_GetReverbRoomSize() @@ -5915,7 +5883,6 @@ ivas_error IVAS_REND_SetReverbRoomSize( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* @@ -9493,7 +9460,6 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( Word16 max_bands; Word16 Q_out[2]; Word16 pcm_out_flag; -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word32 *p_Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; Word32 *p_Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX]; Word16 j; @@ -9506,7 +9472,6 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( p_Cldfb_ImagBuffer_Binaural[i][j] = Cldfb_ImagBuffer_Binaural[i][j]; } } -#endif max_bands = 0; move16(); @@ -9606,11 +9571,7 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( } } -#ifdef FIX_1119_SPLIT_RENDERING_VOIP Word16 q1 = 31, q2 = 31, Q_buff; -#else - Word16 q1 = 31, q2 = 31, Q_buff, j; -#endif Word16 num_poses = hIvasRend->splitRendWrapper->multiBinPoseData.num_poses; FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; i++ ) @@ -9651,7 +9612,6 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( } max_bands = extract_l( Mpy_32_32( imult3216( hIvasRend->sampleRateOut, BINAURAL_MAXBANDS ), 44740 /* 1/48000 in Q31 */ ) ); -#ifdef FIX_1119_SPLIT_RENDERING_VOIP IF( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], pSplitRendConfig->splitRendBitRate, @@ -9669,25 +9629,6 @@ ivas_error IVAS_REND_GetSplitBinauralBitstream( ro_md_flag, Q_buff, Q_out ) ) != IVAS_ERR_OK ) -#else - IF( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, - hIvasRend->headRotData.headPositions[0], - pSplitRendConfig->splitRendBitRate, - pSplitRendConfig->codec, - pSplitRendConfig->isar_frame_size_ms, - pSplitRendConfig->codec_frame_size_ms, - &bits, - Cldfb_RealBuffer_Binaural, - Cldfb_ImagBuffer_Binaural, - max_bands, - tmpBinaural, - 1, - cldfb_in_flag, - pcm_out_flag, - ro_md_flag, - Q_buff, - Q_out ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -9739,12 +9680,8 @@ ivas_error IVAS_REND_GetSplitRendBitstreamHeader( ISAR_SPLIT_REND_CODEC *pCodec, /* o : pointer to codec setting */ ISAR_SPLIT_REND_POSE_CORRECTION_MODE *poseCorrection, /* o : pointer to pose correction mode */ Word16 *pCodec_frame_size_ms, /* o : pointer to codec frame size setting */ -#ifdef FIX_1437_LC3PLUS_EXTREND_HIRES - Word16 *pIsar_frame_size_ms, /* o : pointer to ISAR frame size setting */ - Word16 *pLc3plusHighRes /* o : pointer to LC3plus High-Res setting */ -#else - Word16 *pIsar_frame_size_ms /* o : pointer to ISAR frame size setting */ -#endif + Word16 *pIsar_frame_size_ms, /* o : pointer to ISAR frame size setting */ + Word16 *pLc3plusHighRes /* o : pointer to LC3plus High-Res setting */ ) { test(); @@ -9757,9 +9694,7 @@ ivas_error IVAS_REND_GetSplitRendBitstreamHeader( *pCodec_frame_size_ms = hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms; *pIsar_frame_size_ms = hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms; *poseCorrection = hIvasRend->hRendererConfig->split_rend_config.poseCorrectionMode; -#ifdef FIX_1437_LC3PLUS_EXTREND_HIRES *pLc3plusHighRes = hIvasRend->hRendererConfig->split_rend_config.lc3plus_highres; -#endif return IVAS_ERR_OK; } diff --git a/lib_util/aeid_file_reader.c b/lib_util/aeid_file_reader.c index 02ec5de80..6f877452e 100644 --- a/lib_util/aeid_file_reader.c +++ b/lib_util/aeid_file_reader.c @@ -31,7 +31,6 @@ *******************************************************************************************************/ #include "aeid_file_reader.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION #include "ivas_error_utils.h" #include #include @@ -184,4 +183,3 @@ const char *aeidFileReader_getFilePath( return aeidReader->file_path; } -#endif diff --git a/lib_util/aeid_file_reader.h b/lib_util/aeid_file_reader.h index 6049ecc6b..2eb38b90f 100644 --- a/lib_util/aeid_file_reader.h +++ b/lib_util/aeid_file_reader.h @@ -36,7 +36,6 @@ #include "common_api_types.h" -#ifdef FIX_1053_REVERB_RECONFIGURATION struct aeidFileReader; typedef struct aeidFileReader aeidFileReader; @@ -85,6 +84,5 @@ const char *aeidFileReader_getFilePath( aeidFileReader *aeidReader /* i : aeidFileReader handle */ ); -#endif #endif /* IVAS_AEID_FILE_READER_H */ diff --git a/lib_util/g192.c b/lib_util/g192.c index 7ea8b55ec..5a8ed1065 100644 --- a/lib_util/g192.c +++ b/lib_util/g192.c @@ -482,11 +482,7 @@ G192_ERROR G192_WriteVoipFrame_short( const uint16_t *serial, const int16_t numBits, uint16_t const rtpSequenceNumber, -#ifdef IVAS_RTPDUMP uint32_t const rtpTimeStamp, -#else - uint16_t const rtpTimeStamp, -#endif uint32_t const rcvTime_ms ) { int16_t G192_HEADER[2], G192_DATA[IVAS_MAX_BITS_PER_FRAME]; diff --git a/lib_util/g192.h b/lib_util/g192.h index aa491f1e8..e6ad2b4ee 100644 --- a/lib_util/g192.h +++ b/lib_util/g192.h @@ -93,11 +93,7 @@ G192_ERROR G192_Writer_Open_filename( G192_HANDLE *phG192, const char *filename G192_ERROR G192_WriteFrame( G192_HANDLE const hG192, const uint16_t *serial, const int16_t numBits ); -#ifdef IVAS_RTPDUMP G192_ERROR G192_WriteVoipFrame_short( G192_HANDLE const hG192, const uint16_t *serial, const int16_t num_bits, uint16_t const rtpSequenceNumber, uint32_t const rtpTimeStamp, uint32_t const rcvTime_ms ); -#else -G192_ERROR G192_WriteVoipFrame_short( G192_HANDLE const hG192, const uint16_t *serial, const int16_t num_bits, uint16_t const rtpSequenceNumber, uint16_t const rtpTimeStamp, uint32_t const rcvTime_ms ); -#endif G192_ERROR G192_Writer_Close( G192_HANDLE *phG192 ); diff --git a/lib_util/ism_file_reader.c b/lib_util/ism_file_reader.c index 2cced2665..5982229e4 100644 --- a/lib_util/ism_file_reader.c +++ b/lib_util/ism_file_reader.c @@ -155,18 +155,7 @@ ivas_error IsmFileReader_readNextFrame( /* Invalid number of metadata parameters (2-7 supported) */ return IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT; } -#ifndef FIX_2084_FLOATING_POINT_LEFTOVERS - ismMetadata->azimuth = meta_prm[0]; - ismMetadata->elevation = meta_prm[1]; - ismMetadata->radius = meta_prm[2]; - ismMetadata->spread = meta_prm[3]; - ismMetadata->gainFactor = meta_prm[4]; - ismMetadata->yaw = meta_prm[5]; - ismMetadata->pitch = meta_prm[6]; - ismMetadata->non_diegetic_flag = (int16_t) meta_prm[7]; -#else ismMetadata->non_diegetic_flag = (Word16) meta_prm[7]; -#endif ismMetadata->azimuth_fx = floatToFixed( meta_prm[0], Q22 ); ismMetadata->elevation_fx = floatToFixed( meta_prm[1], Q22 ); ismMetadata->radius_fx = (Word16) floatToFixed( meta_prm[2], Q9 ); @@ -181,59 +170,31 @@ ivas_error IsmFileReader_readNextFrame( return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS if ( ( ismMetadata->azimuth_fx > DEG_180_IN_Q22 ) || ( ismMetadata->azimuth_fx < -DEG_180_IN_Q22 ) ) -#else - if ( ismMetadata->azimuth > 180 || ismMetadata->azimuth < -180 ) -#endif { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS if ( ( ismMetadata->elevation_fx > DEG_90_IN_Q22 ) || ( ismMetadata->elevation_fx < -DEG_90_IN_Q22 ) ) -#else - if ( ismMetadata->elevation > 90 || ismMetadata->elevation < -90 ) -#endif { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS if ( ismMetadata->radius_fx < 0 ) /* Negative radius not supported. Max quantized radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ -#else - if ( ismMetadata->radius < 0 ) /* Negative radius not supported. Max quantized radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ -#endif { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS if ( ( ismMetadata->spread_fx > DEG_360_IN_Q22 ) || ( ismMetadata->spread_fx < 0 ) ) -#else - if ( ismMetadata->spread > 360 || ismMetadata->spread < 0 ) -#endif { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS if ( /*( ismMetadata->gainFactor_fx > ONE_IN_Q31 ) ||*/ ( ismMetadata->gainFactor_fx < 0 ) ) -#else - if ( ismMetadata->gainFactor > 1 || ismMetadata->gainFactor < 0 ) -#endif { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS if ( ( ismMetadata->yaw_fx > DEG_180_IN_Q22 ) || ( ismMetadata->yaw_fx < -DEG_180_IN_Q22 ) ) -#else - if ( ismMetadata->yaw > 180 || ismMetadata->yaw < -180 ) -#endif { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS if ( ( ismMetadata->pitch_fx > DEG_90_IN_Q22 ) || ( ismMetadata->pitch_fx < -DEG_90_IN_Q22 ) ) -#else - if ( ismMetadata->pitch > 90 || ismMetadata->pitch < -90 ) -#endif { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } diff --git a/lib_util/ism_file_writer.c b/lib_util/ism_file_writer.c index ba53566af..975412b00 100644 --- a/lib_util/ism_file_writer.c +++ b/lib_util/ism_file_writer.c @@ -116,7 +116,6 @@ ivas_error IsmFileWriter_writeFrame( } file = ismWriter->file; -#ifdef FIX_2084_FLOATING_POINT_LEFTOVERS float azimuth = fixedToFloat( ismMetadata.azimuth_fx, Q22 ); float elevation = fixedToFloat( ismMetadata.elevation_fx, Q22 ); float radius = fix16_to_float( ismMetadata.radius_fx, Q9 ); @@ -126,17 +125,6 @@ ivas_error IsmFileWriter_writeFrame( float pitch = fixedToFloat( ismMetadata.pitch_fx, Q22 ); snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f,%d\n", azimuth, elevation, radius, spread, gainFactor, yaw, pitch, ismMetadata.non_diegetic_flag ); -#else - ismMetadata.azimuth = fixedToFloat( ismMetadata.azimuth_fx, Q22 ); - ismMetadata.elevation = fixedToFloat( ismMetadata.elevation_fx, Q22 ); - ismMetadata.radius = fix16_to_float( ismMetadata.radius_fx, Q9 ); - ismMetadata.spread = fixedToFloat( ismMetadata.spread_fx, Q22 ); - ismMetadata.gainFactor = fixedToFloat( ismMetadata.gainFactor_fx, Q29 ); // TODO: Change to Q28 or Q12? - ismMetadata.yaw = fixedToFloat( ismMetadata.yaw_fx, Q22 ); - ismMetadata.pitch = fixedToFloat( ismMetadata.pitch_fx, Q22 ); - - snprintf( char_buff, sizeof( char_buff ), "%+07.2f,%+06.2f,%05.2f,%06.2f,%04.2f,%+07.2f,%+06.2f,%d\n", ismMetadata.azimuth, ismMetadata.elevation, ismMetadata.radius, ismMetadata.spread, ismMetadata.gainFactor, ismMetadata.yaw, ismMetadata.pitch, ismMetadata.non_diegetic_flag ); -#endif if ( file ) { fputs( char_buff, file ); diff --git a/lib_util/ivas_rtp_api.h b/lib_util/ivas_rtp_api.h index a296e8ab3..6698daaea 100644 --- a/lib_util/ivas_rtp_api.h +++ b/lib_util/ivas_rtp_api.h @@ -123,7 +123,6 @@ typedef enum IVAS_FMT_NO_REQ, /* No preference */ } IVAS_RTP_FORMAT; -#ifdef RTP_S4_251135_CR26253_0016_REV1 /* Coded Subformat Requests */ typedef enum { @@ -204,7 +203,6 @@ typedef struct uint32_t roll : 1; /* transmission metadata for correction around roll axis */ uint32_t reserved : 27; /* reserved */ } IVAS_RTP_SPLITRENDER; -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ /* Remote Requests Types (Keys) */ typedef enum @@ -214,25 +212,21 @@ typedef enum IVAS_REQUEST_BANDWIDTH, /* Request bandwidth, value of type IVAS_RTP_BANDWIDTH */ IVAS_REQUEST_FORMAT, /* Request format, value of type IVAS_RTP_FORMAT */ IVAS_REQUEST_CA_MODE, /* Request channel awareness, value of type IVAS_RTP_CA_MODE */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 IVAS_REQUEST_SUBFORMAT, /* Request subFormat, value of type IVAS_RTP_SUBFORMAT */ IVAS_REQUEST_SR_CONFIG, /* Request spit rendering, value of type IVAS_RTP_SPLITRENDER */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ IVAS_REQUEST_MAX /* Max number of requests */ } IVAS_RTP_REQUEST_TYPE; /* Remote Request Values */ typedef union { - uint32_t bitrate; /* bitrate in kbps when request type is IVAS_REQUEST_BITRATE */ - IVAS_RTP_CODEC codec; /* codec id when request type is IVAS_REQUEST_CODEC */ - IVAS_RTP_BANDWIDTH bandwidth; /* badwidth when request type is IVAS_REQUEST_BANDWIDTH */ - IVAS_RTP_FORMAT formatType; /* format type when request type is IVAS_REQUEST_FORMAT */ - IVAS_RTP_CA_MODE caMode; /* channel aware mode when request type is IVAS_REQUEST_CA_MODE */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 + uint32_t bitrate; /* bitrate in kbps when request type is IVAS_REQUEST_BITRATE */ + IVAS_RTP_CODEC codec; /* codec id when request type is IVAS_REQUEST_CODEC */ + IVAS_RTP_BANDWIDTH bandwidth; /* badwidth when request type is IVAS_REQUEST_BANDWIDTH */ + IVAS_RTP_FORMAT formatType; /* format type when request type is IVAS_REQUEST_FORMAT */ + IVAS_RTP_CA_MODE caMode; /* channel aware mode when request type is IVAS_REQUEST_CA_MODE */ IVAS_RTP_SUBFORMAT subFormatType; /* sub-format type when request type is IVAS_REQUEST_SUBFORMAT */ IVAS_RTP_SPLITRENDER srConfig; /* split rendering config when request type is IVAS_REQUEST_SR_CONFIG */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ } IVAS_RTP_REQUEST_VALUE; /* Template for pi data types, all defined pi data follow this template @@ -263,7 +257,6 @@ typedef struct uint8_t *buffer; /* pointer to the payload buffer */ } IVAS_DATA_BUFFER; -#ifdef RTP_S4_251135_CR26253_0016_REV1 typedef enum { IVAS_SR_TRANSPORT_LCLD, @@ -272,15 +265,12 @@ typedef enum typedef struct { - bool valid; /* Valid Split Rendering Info for/in the ToC */ - bool diegetic; /* SR content digetic */ - uint32_t bitrateKbps; /* SR bitrate in kbps */ -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE - uint32_t codecFrameSizeMs; /* SR transport codec framesize in ms (5/10/20) */ -#endif + bool valid; /* Valid Split Rendering Info for/in the ToC */ + bool diegetic; /* SR content digetic */ + uint32_t bitrateKbps; /* SR bitrate in kbps */ + uint32_t codecFrameSizeMs; /* SR transport codec framesize in ms (5/10/20) */ IVAS_RTP_SR_TRANSPORT codec; /* SR Transport Codec used*/ } IVAS_RTP_SR_INFO; -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ /**********************************************/ /* IVAS RTP PACKER API */ @@ -312,7 +302,6 @@ void IVAS_RTP_PACK_Close( ); /* Update the RTP Header structure */ -#ifdef FIXED_RTP_SEQUENCE_NUM ivas_error IVAS_RTP_PACK_UpdateHeader( IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ uint16_t seqNumInitVal, /* i : Initial sequence number to be used for 1st packet */ @@ -323,17 +312,6 @@ ivas_error IVAS_RTP_PACK_UpdateHeader( uint16_t numExtensionBytes, /* i : length of the extension data */ uint8_t *extData /* i : extension data pointer */ ); -#else -ivas_error IVAS_RTP_PACK_UpdateHeader( - IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ - uint32_t ssrc, /* i : Unique 32-bit Source ID as negotiated during SDP */ - uint8_t numCC, /* i : numCC indicates no. of contributing sources */ - uint32_t *csrc, /* i : SSRCs of contributing Sources for a mixed stream */ - uint16_t extHeaderId, /* i : extension header ID */ - uint16_t numExtensionBytes, /* i : length of the extension data */ - uint8_t *extData /* i : extension data pointer */ -); -#endif /* Add requests for remote sender using a key value pair api * each key must be provided with a corresponding value type @@ -358,11 +336,9 @@ ivas_error IVAS_RTP_PACK_PushRemoteRequest( * */ ivas_error IVAS_RTP_PACK_PushFrame( - IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle */ - IVAS_RTP_CODEC codecId, /* i : Codec type (IVAS/EVS) */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_CODEC codecId, /* i : Codec type (IVAS/EVS) */ const IVAS_RTP_SR_INFO *srInfo, /* i : Split Rendering Info (NULL if absent) */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ const IVAS_DATA_BUFFER *frameBuffer /* i : packed frame bitstream for IVAS/EVS */ ); @@ -423,9 +399,7 @@ typedef struct IVAS_RTP_UNPACK *IVAS_RTP_UNPACK_HANDLE; /* rtp unpacker handle t typedef struct { uint32_t maxFramesPerPacket; /* maximum no of frame per packet expected during the session */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 uint32_t srCodecFrameSizeMs; /* split rendering transport codec frame size in ms (5/10/20) set by sdp negotiation */ -#endif } IVAS_RTP_UNPACK_CONFIG; /* Open an instance of the RTP unpacker and return a handle to rtp unpacker on success @@ -586,15 +560,13 @@ ivas_error IVAS_RTP_UNPACK_GetRequest( ivas_error IVAS_RTP_UNPACK_PullFrame( IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle */ IVAS_RTP_CODEC *receivedCodecId, /* o : Codec type (IVAS/EVS) */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 - IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering Info */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ - IVAS_DATA_BUFFER *frameBuffer, /* o : packed frame bitstream for IVAS/EVS */ - int16_t *frameSizeInBits, /* o : exact frame size in bits (AMRWB IO) */ - uint32_t *timestamp, /* o : timestamp in RTP Clock @ 16KHz */ - uint16_t *sequenceNumber, /* o : sequence number from rtp header */ - bool *speechLostIndicated, /* o : Is current frame indicated as Lost */ - bool *isAMRWB_IOmode /* o : Is AMRWB_IO mode EVS frame */ + IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering Info */ + IVAS_DATA_BUFFER *frameBuffer, /* o : packed frame bitstream for IVAS/EVS */ + int16_t *frameSizeInBits, /* o : exact frame size in bits (AMRWB IO) */ + uint32_t *timestamp, /* o : timestamp in RTP Clock @ 16KHz */ + uint16_t *sequenceNumber, /* o : sequence number from rtp header */ + bool *speechLostIndicated, /* o : Is current frame indicated as Lost */ + bool *isAMRWB_IOmode /* o : Is AMRWB_IO mode EVS frame */ ); /* Pull a single PI data from rtp unpacker instance for current packet diff --git a/lib_util/ivas_rtp_file.c b/lib_util/ivas_rtp_file.c index 32bd7e815..26af1e201 100644 --- a/lib_util/ivas_rtp_file.c +++ b/lib_util/ivas_rtp_file.c @@ -157,21 +157,15 @@ void IVAS_RTP_LogPiData( uint32_t nPiDataPresent /* i : Number of valid elements in the piData array */ ) { -#ifdef ISM_PI_DATA uint16_t n; -#endif uint32_t timestamp = ~0u; if ( f_piDataOut == NULL || piData == NULL || nPiDataPresent == 0 ) { return; } -#ifdef ISM_PI_DATA #ifdef _WIN32 if ( ftell( f_piDataOut ) > 3 ) -#else - if ( ftell( f_piDataOut ) > 2 ) -#endif #else if ( ftell( f_piDataOut ) > 2 ) #endif @@ -201,13 +195,8 @@ void IVAS_RTP_LogPiData( case IVAS_PI_SCENE_ORIENTATION: case IVAS_PI_DEVICE_ORIENTATION_COMPENSATED: case IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED: -#ifdef RTP_S4_251135_CR26253_0016_REV1 case IVAS_PI_PLAYBACK_DEVICE_ORIENTATION: case IVAS_PI_HEAD_ORIENTATION: -#ifndef REVERSE_ISM_PI_DATA - case IVAS_PI_R_ISM_ORIENTATION: -#endif -#endif { fprintf( f_piDataOut, "{\n\t\t\t\"w\": %f,\n\t\t\t\"x\": %f,\n\t\t\t\"y\": %f,\n\t\t\t\"z\": %f \n\t\t}", fixedToFloat( cur->data.scene.orientation.w_fx, Q15 ), @@ -233,11 +222,7 @@ void IVAS_RTP_LogPiData( fprintf( f_piDataOut, "\n\t\t}" ); } break; -#ifdef RTP_S4_251135_CR26253_0016_REV1 case IVAS_PI_LISTENER_POSITION: -#ifndef REVERSE_ISM_PI_DATA - case IVAS_PI_R_ISM_POSITION: -#endif { fprintf( f_piDataOut, "{\n\t\t\t\"x\": %f,\n\t\t\t\"y\": %f,\n\t\t\t\"z\": %f \n\t\t}", cur->data.listnerPosition.position.x, cur->data.listnerPosition.position.y, cur->data.listnerPosition.position.z ); @@ -344,22 +329,13 @@ void IVAS_RTP_LogPiData( fprintf( f_piDataOut, "\n\t\t}" ); } break; -#ifdef RTP_S4_251135_CR26253_0016_REV1 case IVAS_PI_RESERVED27: case IVAS_PI_RESERVED28: case IVAS_PI_RESERVED29: -#else - case IVAS_PI_RESERVED15: - case IVAS_PI_RESERVED27: - case IVAS_PI_RESERVED28: - case IVAS_PI_RESERVED29: - case IVAS_PI_RESERVED30: -#endif { fprintf( f_piDataOut, "{}" ); } break; -#ifdef ISM_PI_DATA case IVAS_PI_ISM_ORIENTATION: { fprintf( f_piDataOut, "[\n" ); @@ -431,7 +407,6 @@ void IVAS_RTP_LogPiData( fprintf( f_piDataOut, "\n\t\t]" ); } break; -#ifdef RTP_UPDATES_SA4_134 case IVAS_PI_ISM_POSITION_COMPACT: { fprintf( f_piDataOut, "[\n" ); @@ -446,7 +421,6 @@ void IVAS_RTP_LogPiData( fprintf( f_piDataOut, "\n\t\t]" ); } break; -#endif case IVAS_PI_ISM_DISTANCE_ATTENUATION: { fprintf( f_piDataOut, "[\n" ); @@ -475,19 +449,6 @@ void IVAS_RTP_LogPiData( fprintf( f_piDataOut, "\n\t\t]" ); } break; -#else - case IVAS_PI_ISM_NUM: - case IVAS_PI_ISM_ID: - case IVAS_PI_ISM_GAIN: - case IVAS_PI_ISM_ORIENTATION: - case IVAS_PI_ISM_POSITION: - case IVAS_PI_ISM_DISTANCE_ATTENUATION: - case IVAS_PI_ISM_DIRECTIVITY: - { - fprintf( f_piDataOut, "{}" ); - } - break; -#endif case IVAS_PI_PI_LATENCY: { fprintf( f_piDataOut, "{" ); @@ -497,16 +458,13 @@ void IVAS_RTP_LogPiData( } break; case IVAS_PI_R_ISM_ID: -#ifdef REVERSE_ISM_PI_DATA { fprintf( f_piDataOut, "{\n" ); fprintf( f_piDataOut, "\t\t\t\"id\": %d", cur->data.ismEditId.id ); fprintf( f_piDataOut, "\n\t\t}" ); } break; -#endif case IVAS_PI_R_ISM_GAIN: -#ifdef REVERSE_ISM_PI_DATA { fprintf( f_piDataOut, "{\n" ); fprintf( f_piDataOut, "\t\t\t\"gain\": %d", cur->data.ismEditGain.dB ); @@ -528,24 +486,18 @@ void IVAS_RTP_LogPiData( cur->data.ismEditPosition.position.x, cur->data.ismEditPosition.position.y, cur->data.ismEditPosition.position.z ); } break; -#ifdef RTP_UPDATES_SA4_134 case IVAS_PI_R_ISM_POSITION_COMPACT: { fprintf( f_piDataOut, "{\n\t\t\t\"x\": %f,\n\t\t\t\"y\": %f,\n\t\t\t\"z\": %f \n\t\t}", cur->data.ismEditPositionCompact.position.x, cur->data.ismEditPositionCompact.position.y, cur->data.ismEditPositionCompact.position.z ); } break; -#endif -#endif case IVAS_PI_R_ISM_DIRECTION: -#ifdef REVERSE_ISM_PI_DATA { fprintf( f_piDataOut, "{\n\t\t\t\"azi\": %f,\n\t\t\t\"elev\": %f \n\t\t}", cur->data.ismEditDirection.azimuth, cur->data.ismEditDirection.elevation ); } break; -#endif -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ case IVAS_PI_NO_DATA: { fprintf( f_piDataOut, "{}" ); @@ -622,7 +574,6 @@ void IVAS_RTP_WriteExtPiData( } } break; -#ifdef RTP_S4_251135_CR26253_0016_REV1 case IVAS_PI_AUDIO_DESCRIPTION: { uint32_t nEntries = cur->data.audioDesc.nValidEntries; @@ -692,7 +643,6 @@ void IVAS_RTP_WriteExtPiData( } } break; -#ifdef RTP_UPDATES_SA4_134 case IVAS_PI_ISM_POSITION_COMPACT: { for ( i = 0; i < numObj; ++i ) @@ -705,7 +655,6 @@ void IVAS_RTP_WriteExtPiData( } } break; -#endif case IVAS_PI_ISM_DISTANCE_ATTENUATION: { for ( i = 0; i < numObj; ++i ) @@ -837,31 +786,20 @@ void IVAS_RTP_WriteExtPiData( fprintf( f_piDataOut, "%f,%f,%f", cur->data.ismEditPosition.position.x, cur->data.ismEditPosition.position.y, cur->data.ismEditPosition.position.z ); } break; -#ifdef RTP_UPDATES_SA4_134 case IVAS_PI_R_ISM_POSITION_COMPACT: { fprintf( f_piDataOut, "%f,%f,%f", cur->data.ismEditPositionCompact.position.x, cur->data.ismEditPositionCompact.position.y, cur->data.ismEditPositionCompact.position.z ); } break; -#endif case IVAS_PI_R_ISM_DIRECTION: { fprintf( f_piDataOut, "%f,%f", cur->data.ismEditDirection.azimuth, cur->data.ismEditDirection.elevation ); } break; -#ifdef RTP_UPDATES_SA4_134 case IVAS_PI_RESERVED27: case IVAS_PI_RESERVED28: case IVAS_PI_RESERVED29: -#else - case IVAS_PI_RESERVED15: - case IVAS_PI_RESERVED27: - case IVAS_PI_RESERVED28: - case IVAS_PI_RESERVED29: - case IVAS_PI_RESERVED30: -#endif break; -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ } fprintf( f_piDataOut, "\n" ); } @@ -929,19 +867,12 @@ void IVAS_RTP_Term( ivas_error IVAS_RTP_WRITER_Init( IVAS_RTP *rtp, /* i/o : IVAS RTP File writer handle */ const char *outputBitstreamFilename, /* i : RTP Dump filename */ -#ifdef FIXED_RTP_SEQUENCE_NUM - uint32_t numFramesPerPacket, /* i : No. of frames per packet desired */ - uint32_t SSRC, /* i : SSRC for RTP Header */ - uint16_t seqNumInitVal /* i : Initial seq number in rtp header */ -#else - uint32_t numFramesPerPacket /* i : No. of frames per packet desired */ -#endif + uint32_t numFramesPerPacket, /* i : No. of frames per packet desired */ + uint32_t SSRC, /* i : SSRC for RTP Header */ + uint16_t seqNumInitVal /* i : Initial seq number in rtp header */ ) { -#ifndef FIXED_RTP_SEQUENCE_NUM - uint32_t SSRC = ( rand() & 0xFFFF ) | ( (uint32_t) rand() << 16 ); -#endif ivas_error error = IVAS_ERR_OK; memset( rtp, 0, sizeof( IVAS_RTP ) ); @@ -960,11 +891,7 @@ ivas_error IVAS_RTP_WRITER_Init( return error; } -#ifdef FIXED_RTP_SEQUENCE_NUM error = IVAS_RTP_PACK_UpdateHeader( rtp->hPack, seqNumInitVal, SSRC, 0, NULL, 0, 0, NULL ); -#else - error = IVAS_RTP_PACK_UpdateHeader( rtp->hPack, SSRC, 0, NULL, 0, 0, NULL ); -#endif if ( error != IVAS_ERR_OK ) { fprintf( stderr, "error in IVAS_RTP_PACK_UpdateHeader(): %d\n", error ); @@ -975,12 +902,7 @@ ivas_error IVAS_RTP_WRITER_Init( } ivas_error IVAS_RTP_READER_Init( - IVAS_RTP *rtp, /* i/o : IVAS RTP File reader handle */ -#ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE -#ifdef RTP_S4_251135_CR26253_0016_REV1 - uint32_t srCodecFrameSizeMs, /* i : SR Codec Framesize in ms */ -#endif -#endif + IVAS_RTP *rtp, /* i/o : IVAS RTP File reader handle */ const char *inputBitstreamFilename, /* i : Input rtpdump filename */ const char *piOutputFilename, /* i : Output PI data json filename */ bool isExtOutput, /* i : External output mode */ @@ -992,11 +914,6 @@ ivas_error IVAS_RTP_READER_Init( memset( rtp, 0, sizeof( IVAS_RTP ) ); rtp->unpackCfg.maxFramesPerPacket = IVAS_MAX_FRAMES_PER_RTP_PACKET; -#ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE -#ifdef RTP_S4_251135_CR26253_0016_REV1 - rtp->unpackCfg.srCodecFrameSizeMs = srCodecFrameSizeMs; -#endif -#endif rtp->rtpPacket.buffer = rtp->packet; rtp->rtpPacket.capacity = sizeof( rtp->packet ); @@ -1046,14 +963,12 @@ ivas_error IVAS_RTP_READER_Init( } ivas_error IVAS_RTP_WriteNextFrame( - IVAS_RTP *rtp, /* i/o : IVAS RTP File writer handle */ - uint8_t *au, /* i : IVAS Compressed AU (Packed frame) */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP *rtp, /* i/o : IVAS RTP File writer handle */ + uint8_t *au, /* i : IVAS Compressed AU (Packed frame) */ const IVAS_RTP_SR_INFO *srInfo, /* i : Split rendering info in present, else NULL */ -#endif - int16_t auSizeBits, /* i : Frame size in bits */ - bool isMono, /* i : input was evs(true) or ivas(false) */ - bool forcePacket /* i : force packets with whatever frames pushed so far */ + int16_t auSizeBits, /* i : Frame size in bits */ + bool isMono, /* i : input was evs(true) or ivas(false) */ + bool forcePacket /* i : force packets with whatever frames pushed so far */ ) { ivas_error error = IVAS_ERR_OK; @@ -1068,9 +983,7 @@ ivas_error IVAS_RTP_WriteNextFrame( /* Push Encoded Stream to */ error = IVAS_RTP_PACK_PushFrame( rtp->hPack, isMono ? IVAS_RTP_EVS : IVAS_RTP_IVAS, -#ifdef RTP_S4_251135_CR26253_0016_REV1 srInfo, -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ &packedFrame ); if ( error != IVAS_ERR_OK ) { @@ -1116,10 +1029,8 @@ ivas_error IVAS_RTP_ReadNextFrame( uint32_t *rtpTimeStamp, /* o : RTP Timestamp for this frame */ uint16_t *rtpSequenceNumber, /* o : RTP sequence number for this packet */ uint32_t *nextPacketRcvTime_ms, /* i/o : Clock indicating packet receive times need in JBM */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 - IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering info if SR RTP frame unpacked */ -#endif - bool *qBit /* o : AMRWB Q bite as indicated in the RTP packet */ + IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering info if SR RTP frame unpacked */ + bool *qBit /* o : AMRWB Q bite as indicated in the RTP packet */ ) { ivas_error error = IVAS_ERR_OK; @@ -1164,11 +1075,7 @@ ivas_error IVAS_RTP_ReadNextFrame( IVAS_RTP_LogPiData( rtp->f_piDataOut, rtp->piData, rtp->nReadPiData ); } -#ifdef RTP_S4_251135_CR26253_0016_REV1 error = IVAS_RTP_UNPACK_PullFrame( rtp->hUnpack, &codecId, &rtp->srInfo, &packedFrame, auSizeBits, rtpTimeStamp, rtpSequenceNumber, &rtp->speechLostIndicated, &isAMRWB_IOmode ); -#else - error = IVAS_RTP_UNPACK_PullFrame( rtp->hUnpack, &codecId, &packedFrame, auSizeBits, rtpTimeStamp, rtpSequenceNumber, &rtp->speechLostIndicated, &isAMRWB_IOmode ); -#endif if ( error != IVAS_ERR_OK ) { fprintf( stderr, "failed to pull frame after unpack\n" ); @@ -1197,12 +1104,10 @@ ivas_error IVAS_RTP_ReadNextFrame( rtp->isAMRWB_IOmode = isAMRWB_IOmode; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( srInfo != NULL ) { *srInfo = rtp->srInfo; } -#endif *qBit = !rtp->speechLostIndicated; rtp->numFramesInPacket--; rtp->numFramesProduced++; diff --git a/lib_util/ivas_rtp_file.h b/lib_util/ivas_rtp_file.h index fc92a4d02..571281086 100644 --- a/lib_util/ivas_rtp_file.h +++ b/lib_util/ivas_rtp_file.h @@ -65,32 +65,14 @@ typedef struct IVAS_RTP_UNPACK_HANDLE hUnpack; IVAS_RTP_PACK_CONFIG packCfg; IVAS_RTP_UNPACK_CONFIG unpackCfg; -#ifdef RTP_S4_251135_CR26253_0016_REV1 IVAS_RTP_SR_INFO srInfo; -#endif } IVAS_RTP; -#ifdef FIXED_RTP_SEQUENCE_NUM ivas_error IVAS_RTP_WRITER_Init( IVAS_RTP *rtp, const char *outputBitstreamFilename, uint32_t numFramesPerPacket, uint32_t SSRC, uint16_t seqNumInitVal ); -#else -ivas_error IVAS_RTP_WRITER_Init( IVAS_RTP *rtp, const char *outputBitstreamFilename, uint32_t numFramesPerPacket ); -#endif -#ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE -#ifdef RTP_S4_251135_CR26253_0016_REV1 -ivas_error IVAS_RTP_READER_Init( IVAS_RTP *rtp, uint32_t srCodecFrameSizeMs, const char *inputBitstreamFilename, const char *piOutputFilename, bool isExtOutput, const char *outputWavFilename ); -#endif -#else ivas_error IVAS_RTP_READER_Init( IVAS_RTP *rtp, const char *inputBitstreamFilename, const char *piOutputFilename, bool isExtOutput, const char *outputWavFilename ); -#endif void IVAS_RTP_Term( IVAS_RTP *rtp ); -#ifdef RTP_S4_251135_CR26253_0016_REV1 ivas_error IVAS_RTP_WriteNextFrame( IVAS_RTP *rtp, uint8_t *au, const IVAS_RTP_SR_INFO *srInfo, int16_t auSizeBits, bool isMono, bool forcePacket ); ivas_error IVAS_RTP_ReadNextFrame( IVAS_RTP *rtp, uint8_t *au, int16_t *auSizeBits, uint32_t *rtpTimeStamp, uint16_t *rtpSequenceNumber, uint32_t *nextPacketRcvTime_ms, IVAS_RTP_SR_INFO *srInfo, bool *qBit ); -#else - -ivas_error IVAS_RTP_WriteNextFrame( IVAS_RTP *rtp, uint8_t *au, int16_t auSizeBits, bool isMono, bool forcePacket ); -ivas_error IVAS_RTP_ReadNextFrame( IVAS_RTP *rtp, uint8_t *au, int16_t *auSizeBits, uint32_t *rtpTimeStamp, uint16_t *rtpSequenceNumber, uint32_t *nextPacketRcvTime_ms, bool *qBit ); -#endif void IVAS_RTP_LogPiData( FILE *f_piDataOut, const PIDATA_TS *piData, uint32_t nPiDataPresent ); void IVAS_RTP_WriteExtPiData( FILE *f_piDataOut, const PIDATA_TS *piData, uint32_t nPiDataPresent, uint16_t numObj ); const char *IVAS_RTP_GetExtPiFilePath( IVAS_RTP *rtp ); diff --git a/lib_util/ivas_rtp_internal.h b/lib_util/ivas_rtp_internal.h index aa06e2b6c..b0c9e2550 100644 --- a/lib_util/ivas_rtp_internal.h +++ b/lib_util/ivas_rtp_internal.h @@ -36,7 +36,6 @@ #include "ivas_rtp_api.h" #include "ivas_rtp_pi_data.h" -#ifdef IVAS_RTPDUMP enum MASK_BITS { @@ -48,13 +47,9 @@ enum MASK_BITS MASK_6BIT = 0x3F, MASK_7BIT = 0x7F, MASK_8BIT = 0xFF, -#ifdef REVERSE_ISM_PI_DATA MASK_9BIT = 0x1FF, -#endif -#ifdef RTP_UPDATES_SA4_134 MASK_10BIT = 0x3FF, MASK_11BIT = 0x7FF, -#endif }; @@ -71,15 +66,13 @@ enum MASK_BITS #define MASK_DIM ( ( 1u << NBITS_DIM ) - 1 ) #define MASK_ABS ( ( 1u << NBITS_ABS ) - 1 ) -#define MAX_PI_POSITION_METERS ( 327.68f ) -#define FLOAT_FROM_Q15( q15Val ) ( (float) ( q15Val ) / 32768.0f ) -#ifdef RTP_UPDATES_SA4_134 +#define MAX_PI_POSITION_METERS ( 327.68f ) +#define FLOAT_FROM_Q15( q15Val ) ( (float) ( q15Val ) / 32768.0f ) #define MAX_PI_COMPACT_POSITION_XY_METERS ( 10.24f ) #define MAX_PI_COMPACT_POSITION_Z_METERS ( 5.12f ) #define FLOAT_FROM_Q10( q10Val ) ( (float) ( q10Val ) / 1024.0f ) #define FLOAT_FROM_Q9( q9Val ) ( (float) ( q9Val ) / 512.0f ) #define FLOAT_FROM_Q7( q7Val ) ( (float) ( q7Val ) / 128.0f ) -#endif extern const float mapDSR[1u << NBITS_DSR]; extern const float mapRT60[1u << NBITS_RT60]; @@ -111,19 +104,11 @@ enum IVAS_RTP_HEADER_BITS EBYTE_CMR_T_NO_REQ = 0xFF, /* If no bitrate and no CA mode requested for IVAS/EVS */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 EBYTE_BANDWIDTH_REQUEST = 0x80, /* Subsequent E-byte for Bandwidth Request */ EBYTE_FORMAT_REQUEST = 0x90, /* Subsequent E-byte for Format Request */ EBYTE_SUBFORMAT_REQUEST = 0x9F, /* Subsequent E-byte for SubFormat Request */ EBYTE_PI_INDICATOR = 0xA0, /* Subsequent E-byte for PI Indicator */ EBYTE_SR_REQUEST = 0xB0, /* Subsequent E-byte for Split Rendering Request */ -#else - EBYTE_BANDWIDTH_REQUEST = 0x40, /* Subsequent E-byte for Bandwidth Request */ - EBYTE_FORMAT_REQUEST = 0x50, /* Subsequent E-byte for Format Request */ - EBYTE_SUBFORMAT_REQUEST = 0x9F, /* Subsequent E-byte for SubFormat Request */ - EBYTE_PI_INDICATOR = 0x60, /* Subsequent E-byte for PI Indicator */ - EBYTE_SR_REQUEST = 0x70, /* Subsequent E-byte for Split Rendering Request */ -#endif PI_HEADER_PF_LAST = 0x00, /* Last PI header of the Payload in PI Header */ PI_HEADER_PF_NOT_LAST = 0x80, /* Another PI header follows after this in PI Header */ @@ -158,6 +143,5 @@ typedef struct ivas_error PI_PackData( const IVAS_PIDATA_GENERIC *piData, PIDATA_PACKED *packed, uint8_t pmBits ); ivas_error PI_UnPackData( uint8_t piDataType, uint32_t piSize, const uint8_t *piDataBuffer, IVAS_PIDATA_GENERIC *piData ); -#endif /* IVAS_RTPDUMP */ #endif /* IVAS_RTP_INTERNAL_H */ diff --git a/lib_util/ivas_rtp_payload.c b/lib_util/ivas_rtp_payload.c index b4a2983b7..9f6c22508 100644 --- a/lib_util/ivas_rtp_payload.c +++ b/lib_util/ivas_rtp_payload.c @@ -32,12 +32,8 @@ #include #include #include -#ifndef FIXED_RTP_SEQUENCE_NUM -#include -#endif #include "common_api_types.h" -#ifdef IVAS_RTPDUMP #include "ivas_rtp_internal.h" #include "ivas_bpool.h" @@ -80,10 +76,8 @@ static void initRequests( IVAS_RTP_REQUEST_VALUE *requests ) requests[IVAS_REQUEST_BANDWIDTH].bandwidth = IVAS_BANDWIDTH_NO_REQ; requests[IVAS_REQUEST_FORMAT].formatType = IVAS_FMT_NO_REQ; requests[IVAS_REQUEST_CA_MODE].caMode = IVAS_RTP_CA_NO_REQ; -#ifdef RTP_S4_251135_CR26253_0016_REV1 requests[IVAS_REQUEST_SUBFORMAT].subFormatType = IVAS_SUBFMT_NO_REQ; requests[IVAS_REQUEST_SR_CONFIG].srConfig.valid = false; -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ } static void initPiDataFrame( PIDATA_FRAME *piDataFrm ) @@ -132,9 +126,7 @@ typedef struct uint32_t auNumBits; /* Actual frame size in bits */ bool speechLostIndicated; /* Speech Lost indicated */ bool isAMRWB_IOmode; /* EVS frame is AMRWB_IO */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 - IVAS_RTP_SR_INFO srInfo; /* Split Rendering Info */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ + IVAS_RTP_SR_INFO srInfo; /* Split Rendering Info */ } TOC_INFO; typedef struct PIDATA_NODE @@ -184,9 +176,7 @@ static const uint32_t amrWBIOFrameSizeInBits[] = { /* Update the RTP Header structure */ ivas_error IVAS_RTP_PACK_UpdateHeader( IVAS_RTP_PACK_HANDLE hPack, /* i/o: pointer to an IVAS rtp packer handle to be opened */ -#ifdef FIXED_RTP_SEQUENCE_NUM - uint16_t seqNumInitVal, /* i : Initial sequence number to be used for 1st packet */ -#endif + uint16_t seqNumInitVal, /* i : Initial sequence number to be used for 1st packet */ uint32_t ssrc, /* i : Unique 32-bit Source ID as negotiated during SDP */ uint8_t numCC, /* i : numCC indicates no. of contributing sources */ uint32_t *csrc, /* i : SSRCs of contributing Sources for a mixed stream */ @@ -202,9 +192,7 @@ ivas_error IVAS_RTP_PACK_UpdateHeader( return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "CC must be less than 16" ); } -#ifdef FIXED_RTP_SEQUENCE_NUM header->seqNumber = seqNumInitVal; -#endif header->ssrc = ssrc; header->CC = numCC; if ( csrc != NULL ) @@ -237,16 +225,8 @@ static void InitRtpHeader( RTP_HEADER *header /* RTP header structure */ ) { -#ifdef FIXED_RTP_SEQUENCE_NUM memset( header, 0, sizeof( *header ) ); header->version = 2; -#else - time_t t; - memset( header, 0, sizeof( *header ) ); - srand( (uint32_t) time( &t ) ); - header->version = 2; - header->seqNumber = rand() & 0xFFFF; -#endif } static ivas_error PackRtpHeader( @@ -611,7 +591,6 @@ ivas_error IVAS_RTP_PACK_PushRemoteRequest( } } break; -#ifdef RTP_S4_251135_CR26253_0016_REV1 case IVAS_REQUEST_SUBFORMAT: { uint32_t subFormat = reqValue.subFormatType; @@ -630,7 +609,6 @@ ivas_error IVAS_RTP_PACK_PushRemoteRequest( } } break; -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ default: return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported request type" ); } @@ -773,13 +751,11 @@ static void packEBytes( bool isSubFormatProvided = false; bool isSRConfigProvided = false; -#ifdef RTP_S4_251135_CR26253_0016_REV1 IVAS_RTP_SUBFORMAT subFormat = hPack->requests[IVAS_REQUEST_SUBFORMAT].subFormatType; IVAS_RTP_SPLITRENDER srConfig = hPack->requests[IVAS_REQUEST_SR_CONFIG].srConfig; isSubFormatProvided = ( subFormat != IVAS_SUBFMT_NO_REQ ); isSRConfigProvided = srConfig.valid; -#endif /* Initial E-Byte only sent if either bitrate requested or subsequent E-byte is requested */ if ( !( ( bitrate > 0 ) || isBandwidthProvided || isFormatProvided || @@ -821,7 +797,6 @@ static void packEBytes( uint8_t fmtEByte = ( EBYTE_FORMAT_REQUEST | ( (uint8_t) format & MASK_3BIT ) ); eByte[nByte++] = isSubFormatProvided ? EBYTE_SUBFORMAT_REQUEST : fmtEByte; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( isSubFormatProvided && nByte < maxNumEBytes ) { eByte[nByte++] = ( (uint8_t) subFormat & MASK_6BIT ); /* Requested Coded subFormat */ @@ -833,7 +808,6 @@ static void packEBytes( ( (uint8_t) srConfig.diegetic << 3 ) | ( (uint8_t) srConfig.yaw << 2 ) | ( (uint8_t) srConfig.pitch << 1 ) | ( (uint8_t) srConfig.roll << 0 ); } -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ } /* Final E-byte is the PI Indicator E-Byte */ @@ -846,22 +820,17 @@ static void packEBytes( } -#ifdef RTP_S4_251135_CR26253_0016_REV1 static ivas_error getSRToCByte( const IVAS_RTP_SR_INFO *srInfo, /* i : Split Rendering Info */ uint8_t *tocByte /* o : toc byte 2 */ ) { -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE uint8_t bitIdx, codecId, digetic, codecFrameSize; if ( srInfo->codecFrameSizeMs != 5 && srInfo->codecFrameSizeMs != 10 && srInfo->codecFrameSizeMs != 20 ) { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported codec framesize for SR provided" ); } -#else - uint8_t bitIdx, codecId, digetic; -#endif if ( srInfo->bitrateKbps < 256000 || srInfo->bitrateKbps > 512000 ) { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Unsupported bitrate for SR" ); @@ -871,16 +840,11 @@ static ivas_error getSRToCByte( codecId = (uint8_t) srInfo->codec; digetic = srInfo->diegetic ? 1 : 0; -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE codecFrameSize = ( srInfo->codecFrameSizeMs == 20 ) ? 3 : (uint8_t) ( srInfo->codecFrameSizeMs / 5 ); *tocByte = ( digetic << 6 ) | ( codecId << 5 ) | ( bitIdx << 3 ) | ( codecFrameSize << 1 ); -#else - *tocByte = ( digetic << 6 ) | ( codecId << 5 ) | ( bitIdx << 3 ); -#endif return IVAS_ERR_OK; } -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ static void addPackedPiDataToFrame( PIDATA_FRAME *piDataFrm, const PIDATA_PACKED *packedPiData, uint32_t piDataType ) { @@ -905,11 +869,9 @@ static void addPackedPiDataToFrame( PIDATA_FRAME *piDataFrm, const PIDATA_PACKED } ivas_error IVAS_RTP_PACK_PushFrame( - IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ - IVAS_RTP_CODEC codecId, /* i : Codec type (IVAS/EVS) */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 + IVAS_RTP_PACK_HANDLE hPack, /* i/o : IVAS rtp packer handle */ + IVAS_RTP_CODEC codecId, /* i : Codec type (IVAS/EVS) */ const IVAS_RTP_SR_INFO *srInfo, /* i : Split Rendering Info */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ const IVAS_DATA_BUFFER *frameBuffer /* i : packed frame bitstream for IVAS/EVS */ ) { @@ -917,9 +879,7 @@ ivas_error IVAS_RTP_PACK_PushFrame( uint32_t bitrate = 0; uint32_t frameLengthInBits = 0; uint8_t tocByte = 0; -#ifdef RTP_S4_251135_CR26253_0016_REV1 uint8_t tocByte1 = 0; -#endif FRAME_NODE *node = NULL; PIDATA_FRAME *piDataFrame = &hPack->piDataCache; uint32_t piDataType = 0; @@ -929,7 +889,6 @@ ivas_error IVAS_RTP_PACK_PushFrame( /* Indicates a NO_DATA_FRAME in case of DTX mode */ tocByte = ( hPack->amrwbIOMode ) ? TOC_INDICATE_NO_DATA_AMRWB : TOC_INDICATE_NO_DATA; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 else if ( srInfo != NULL && srInfo->valid ) { tocByte = TOC_INDICATE_SR; @@ -937,7 +896,6 @@ ivas_error IVAS_RTP_PACK_PushFrame( error = getSRToCByte( srInfo, &tocByte1 ); ERR_CHECK_RETURN( error ); } -#endif else { error = getBitrateFromCodecAndFrameSize( codecId, frameBuffer->length, &bitrate, &frameLengthInBits, &tocByte, &hPack->amrwbIOMode ); @@ -952,12 +910,10 @@ ivas_error IVAS_RTP_PACK_PushFrame( /* Set ToC byte & frame */ node->toc[node->tocNumBytes++] = tocByte; -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( srInfo != NULL && srInfo->valid ) { node->toc[node->tocNumBytes++] = tocByte1; } -#endif node->auNumBits = frameLengthInBits; if ( frameBuffer != NULL ) @@ -1097,12 +1053,10 @@ ivas_error IVAS_RTP_PACK_GetPayload( uint8_t fBit = ( n != ( numFrame - 1 ) ) ? TOC_HEADER_FOLLOWS : 0; /* Next ToC present */ WRITE_BYTE_PAYLOAD_OR_EXIT( payload, ( node->toc[0] | fBit ) ); -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( node->tocNumBytes == 2 ) { WRITE_BYTE_PAYLOAD_OR_EXIT( payload, node->toc[1] ); } -#endif } /* Frame Data */ @@ -1366,11 +1320,7 @@ static uint32_t parseSubsequentEByte( const IVAS_DATA_BUFFER *payload, uint32_t while ( nBytes < payload->length ) { uint8_t byte = payload->buffer[nBytes]; -#ifdef RTP_S4_251135_CR26253_0016_REV1 uint8_t ET = ( byte & ( ~MASK_4BIT ) ); -#else - uint8_t ET = ( byte & ( ~MASK_3BIT ) ); -#endif if ( ( byte & EBYTE_TOC_HEADER_BIT ) == 0 ) { @@ -1388,7 +1338,6 @@ static uint32_t parseSubsequentEByte( const IVAS_DATA_BUFFER *payload, uint32_t break; case EBYTE_FORMAT_REQUEST: /* Format Request */ { -#ifdef RTP_S4_251135_CR26253_0016_REV1 bool S = ( byte >> 3 ) & MASK_1BIT; if ( S ) { @@ -1399,14 +1348,12 @@ static uint32_t parseSubsequentEByte( const IVAS_DATA_BUFFER *payload, uint32_t requests[IVAS_REQUEST_SUBFORMAT].subFormatType = byte & MASK_6BIT; } } -#endif requests[IVAS_REQUEST_FORMAT].formatType = byte & MASK_3BIT; } break; case EBYTE_PI_INDICATOR: /* PI Indication */ *piDataIndicated = true; break; -#ifdef RTP_S4_251135_CR26253_0016_REV1 case EBYTE_SR_REQUEST: /* Split Rendering Request */ { IVAS_RTP_SPLITRENDER *srConfig = &requests[IVAS_REQUEST_SR_CONFIG].srConfig; @@ -1417,7 +1364,6 @@ static uint32_t parseSubsequentEByte( const IVAS_DATA_BUFFER *payload, uint32_t srConfig->valid = true; } break; -#endif default: /* Reserved for future use - unhandled atm */ break; } @@ -1426,13 +1372,7 @@ static uint32_t parseSubsequentEByte( const IVAS_DATA_BUFFER *payload, uint32_t return nBytes; } -#ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE -#ifdef RTP_S4_251135_CR26253_0016_REV1 -static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBytes, uint32_t *numFrames, TOC_INFO *toc, uint32_t maxNumberOfToCBytes, uint32_t srCodecFrameSizeMs ) -#endif -#else static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBytes, uint32_t *numFrames, TOC_INFO *toc, uint32_t maxNumberOfToCBytes ) -#endif { bool headerFollows = true; uint32_t nBytes = *numBytes; @@ -1485,14 +1425,11 @@ static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBy toc->codecId = IVAS_RTP_IVAS; if ( BR == 14 ) { -#ifdef RTP_S4_251135_CR26253_0016_REV1 /* Read Unconditional SR-ToC byte */ if ( nBytes < payload->length ) { uint8_t SR_BR; -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE static const uint8_t codecFrameSizeMap[4] = { 0, 5, 10, 20 }; -#endif byte = payload->buffer[nBytes++]; SR_BR = ( byte >> 3 ) & MASK_2BIT; if ( SR_BR == 0 ) @@ -1503,21 +1440,13 @@ static ivas_error parseToCByte( const IVAS_DATA_BUFFER *payload, uint32_t *numBy toc->srInfo.diegetic = ( byte >> 6 ) & MASK_1BIT; toc->srInfo.codec = IVAS_SR_TRANSPORT_LCLD + ( ( byte >> 5 ) & MASK_1BIT ); toc->srInfo.bitrateKbps = ( SR_BR + 1 ) * 128000u; -#ifdef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE toc->srInfo.codecFrameSizeMs = codecFrameSizeMap[( byte >> 1 ) & MASK_2BIT]; toc->auNumBits = toc->srInfo.bitrateKbps * toc->srInfo.codecFrameSizeMs / 1000; -#else - toc->auNumBits = toc->srInfo.bitrateKbps * srCodecFrameSizeMs / 1000; -#endif } else { return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow during ToC SR byte" ); } -#else - /* Reserved bit not expected */ - return IVAS_ERROR( IVAS_ERR_RTP_UNSUPPORTED_FRAME, "Reserved BR idx reported in ToC" ); -#endif } else { @@ -1568,9 +1497,7 @@ static ivas_error parsePIData( IVAS_RTP_UNPACK_HANDLE hUnpack, uint32_t rtpTimes { bool PF = true; uint32_t nBytes = *numBytes; -#ifdef RTP_UPDATES_SA4_134 bool isFirstPiSize = true; -#endif while ( PF ) { @@ -1588,7 +1515,6 @@ static ivas_error parsePIData( IVAS_RTP_UNPACK_HANDLE hUnpack, uint32_t rtpTimes PM = ( piHeader0 & ( ~MASK_5BIT ) ) & MASK_7BIT; /* PI Marker Bits */ piDataType = ( piHeader0 & MASK_5BIT ); -#ifdef RTP_UPDATES_SA4_134 do { byte = payload->buffer[nBytes++]; @@ -1599,17 +1525,6 @@ static ivas_error parsePIData( IVAS_RTP_UNPACK_HANDLE hUnpack, uint32_t rtpTimes } isFirstPiSize = false; } while ( byte == 255 || piSize == 32 ); -#else - do - { - byte = payload->buffer[nBytes++]; - piSize += byte; - if ( nBytes >= payload->length ) - { - return IVAS_ERROR( IVAS_ERR_RTP_UNDERFLOW, "Underflow during reading piSize" ); - } - } while ( byte == 255 ); -#endif if ( piDataType == IVAS_PI_NO_DATA ) { @@ -1706,13 +1621,7 @@ ivas_error IVAS_RTP_UNPACK_PushPayload( nBytes = parseSubsequentEByte( payload, nBytes, hUnpack->requests, &piDataIndicated ); /* Unpack the ToC Bytes => Extract number of frames in packet */ -#ifndef RTP_SR_CODEC_FRAME_SIZE_IN_TOC_BYTE -#ifdef RTP_S4_251135_CR26253_0016_REV1 - error = parseToCByte( payload, &nBytes, &numFrames, toc, sizeof( toc ) / sizeof( toc[0] ), hUnpack->initConfig.srCodecFrameSizeMs ); -#endif -#else error = parseToCByte( payload, &nBytes, &numFrames, toc, sizeof( toc ) / sizeof( toc[0] ) ); -#endif ERR_CHECK_RETURN( error ); /* Read frame bits */ @@ -1824,15 +1733,13 @@ ivas_error IVAS_RTP_UNPACK_GetRequest( ivas_error IVAS_RTP_UNPACK_PullFrame( IVAS_RTP_UNPACK_HANDLE hUnpack, /* i/o : IVAS rtp unpacker handle */ IVAS_RTP_CODEC *receivedCodecId, /* o : Codec type (IVAS/EVS) */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 - IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering Info */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ - IVAS_DATA_BUFFER *frameBuffer, /* o : packed frame bitstream for IVAS/EVS */ - int16_t *frameSizeInBits, /* o : exact frame size in bits (AMRWB IO) */ - uint32_t *timestamp, /* o : timestamp in RTP Clock @ 16KHz */ - uint16_t *sequenceNumber, /* o : sequence number from rtp header */ - bool *speechLostIndicated, /* o : Is current frame indicated as Lost */ - bool *isAMRWB_IOmode /* o : Is AMRWB_IO mode EVS frame */ + IVAS_RTP_SR_INFO *srInfo, /* o : Split Rendering Info */ + IVAS_DATA_BUFFER *frameBuffer, /* o : packed frame bitstream for IVAS/EVS */ + int16_t *frameSizeInBits, /* o : exact frame size in bits (AMRWB IO) */ + uint32_t *timestamp, /* o : timestamp in RTP Clock @ 16KHz */ + uint16_t *sequenceNumber, /* o : sequence number from rtp header */ + bool *speechLostIndicated, /* o : Is current frame indicated as Lost */ + bool *isAMRWB_IOmode /* o : Is AMRWB_IO mode EVS frame */ ) { size_t length = 0; @@ -1861,12 +1768,10 @@ ivas_error IVAS_RTP_UNPACK_PullFrame( *receivedCodecId = node->toc.codecId; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 if ( srInfo != NULL ) { *srInfo = node->toc.srInfo; } -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ if ( timestamp != NULL ) { @@ -1921,5 +1826,3 @@ ivas_error IVAS_RTP_UNPACK_PullNextPiData( return BPOOL_FreeBuffer( hUnpack->piDataPool, node ); } - -#endif /* IVAS_RTPDUMP */ diff --git a/lib_util/ivas_rtp_pi_data.c b/lib_util/ivas_rtp_pi_data.c index 1a17318d7..cea96e441 100644 --- a/lib_util/ivas_rtp_pi_data.c +++ b/lib_util/ivas_rtp_pi_data.c @@ -32,10 +32,7 @@ #include "ivas_error_utils.h" #include "ivas_rtp_internal.h" -#ifdef REVERSE_ISM_PI_DATA #include -#endif -#ifdef ISM_PI_DATA #include #ifndef min @@ -46,14 +43,10 @@ #define max( x, y ) ( ( x ) > ( y ) ? ( x ) : ( y ) ) #endif -#endif -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #include "cnst.h" #include -#endif -#ifdef IVAS_RTPDUMP /* Generic PI data packing/unpacking functions */ typedef ivas_error ( *PACK_PI_FN )( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ); @@ -83,7 +76,6 @@ static int16_t ivasPayload_convertToQ15( float value ) value = value < -32768.0f ? -32768.0f : value; return (int16_t) ( value ); } -#ifdef RTP_UPDATES_SA4_134 /*-----------------------------------------------------------------------* * ivasPayload_convertToQ10() * @@ -110,7 +102,6 @@ static int16_t ivasPayload_convertToQ9( float value ) return (int16_t) ( value ); } -#ifdef COMPACT_ORIENTATION_PI_DATA static uint32_t packQuaternion( IVAS_QUATERNION orientation, uint8_t *buffer ) { uint32_t nBytes = 0; @@ -197,22 +188,6 @@ static ivas_error unpackQuaternion( const uint8_t *buffer, IVAS_QUATERNION *orie return IVAS_ERR_OK; } -#else - -/*-----------------------------------------------------------------------* - * ivasPayload_convertToQ7() - * - * Convert a float value into a Q7 encoded value. - *-----------------------------------------------------------------------*/ -static int16_t ivasPayload_convertToQ7( float value ) -{ - value = ( value * 128.0f ); - value = value > +128.0f ? +128.0f : value; - value = value < -128.0f ? -128.0f : value; - return (int16_t) ( value ); -} -#endif -#endif static ivas_error packUnsupportedData( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { @@ -278,53 +253,25 @@ static ivas_error packOrientation( const IVAS_PIDATA_GENERIC *piData, uint8_t *b return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in Orientation PI data" ); } - if ( ( piData->piDataType != IVAS_PI_SCENE_ORIENTATION ) && ( piData->piDataType != IVAS_PI_DEVICE_ORIENTATION_COMPENSATED ) && ( piData->piDataType != IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED ) -#ifdef RTP_S4_251135_CR26253_0016_REV1 - && ( piData->piDataType != IVAS_PI_PLAYBACK_DEVICE_ORIENTATION ) && ( piData->piDataType != IVAS_PI_HEAD_ORIENTATION ) -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ - ) + if ( ( piData->piDataType != IVAS_PI_SCENE_ORIENTATION ) && ( piData->piDataType != IVAS_PI_DEVICE_ORIENTATION_COMPENSATED ) && ( piData->piDataType != IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED ) && ( piData->piDataType != IVAS_PI_PLAYBACK_DEVICE_ORIENTATION ) && ( piData->piDataType != IVAS_PI_HEAD_ORIENTATION ) ) { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect PI ID in Orientation PI data" ); } -#ifdef RTP_UPDATES_SA4_134 /* Orientation data is 4 bytes, header is 2 bytes */ if ( maxDataBytes < 4 + 2 ) { return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack Orientation PI data" ); } -#else - /* Orientation data is 8 bytes, header is 2 bytes */ - if ( maxDataBytes < 8 + 2 ) - { - return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack Orientation PI data" ); - } -#endif buffer[nBytes++] = ( orientation->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ -#ifdef RTP_UPDATES_SA4_134 buffer[nBytes++] = 4; -#ifdef COMPACT_ORIENTATION_PI_DATA nBytes += packQuaternion( orientation->orientation, &buffer[nBytes] ); -#else - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation.w ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation.x ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation.y ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation.z ); -#endif -#else - buffer[nBytes++] = 8; - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation.w_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation.x_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation.y_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation.z_fx ) ); -#endif *nBytesWritten = nBytes; return IVAS_ERR_OK; } -#ifdef ISM_PI_DATA static ivas_error packISMOrientation( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0; @@ -341,54 +288,26 @@ static ivas_error packISMOrientation( const IVAS_PIDATA_GENERIC *piData, uint8_t { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect PI ID in Orientation PI data" ); } -#ifdef RTP_UPDATES_SA4_134 /* Orientation data is 4 bytes, header is 2 bytes */ if ( maxDataBytes < 4 * IVAS_MAX_NUM_OBJECTS + 2 ) { return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack Orientation PI data" ); } -#else - /* Orientation data is 8 bytes, header is 2 bytes */ - if ( maxDataBytes < 8 * IVAS_MAX_NUM_OBJECTS + 2 ) - { - return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack Orientation PI data" ); - } -#endif buffer[nBytes++] = ( orientation->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ -#ifdef RTP_UPDATES_SA4_134 buffer[nBytes++] = (uint8_t) orientation->numObjects * 4; for ( n = 0; n < orientation->numObjects; n++ ) { -#ifdef COMPACT_ORIENTATION_PI_DATA nBytes += packQuaternion( orientation->orientation[n], &buffer[nBytes] ); -#else - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation[n].w ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation[n].x ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation[n].y ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( orientation->orientation[n].z ); -#endif - } -#else - buffer[nBytes++] = (uint8_t) orientation->numObjects * 8; - for ( n = 0; n < orientation->numObjects; n++ ) - { - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation[n].w_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation[n].x_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation[n].y_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( orientation->orientation[n].z_fx ) ); } -#endif *nBytesWritten = nBytes; return IVAS_ERR_OK; } -#endif static ivas_error unpackOrientation( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) { IVAS_PIDATA_ORIENTATION *orientation = (IVAS_PIDATA_ORIENTATION *) piData; -#ifdef RTP_UPDATES_SA4_134 /* Orientation data is 4 bytes */ if ( numDataBytes != 4 ) { @@ -396,36 +315,14 @@ static ivas_error unpackOrientation( const uint8_t *buffer, uint32_t numDataByte } piData->size = sizeof( IVAS_PIDATA_ORIENTATION ); -#ifdef COMPACT_ORIENTATION_PI_DATA unpackQuaternion( buffer, &( orientation->orientation ) ); -#else - orientation->orientation.w = FLOAT_FROM_Q7( (int8_t) buffer[0] ); - orientation->orientation.x = FLOAT_FROM_Q7( (int8_t) buffer[1] ); - orientation->orientation.y = FLOAT_FROM_Q7( (int8_t) buffer[2] ); - orientation->orientation.z = FLOAT_FROM_Q7( (int8_t) buffer[3] ); -#endif -#else - /* Orientation data is 8 bytes */ - if ( numDataBytes != 8 ) - { - return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack Orientation PI data" ); - } - - piData->size = sizeof( IVAS_PIDATA_ORIENTATION ); - orientation->orientation.w_fx = L_deposit_l( readInt16( &buffer[0] ) ); - orientation->orientation.x_fx = L_deposit_l( readInt16( &buffer[2] ) ); - orientation->orientation.y_fx = L_deposit_l( readInt16( &buffer[4] ) ); - orientation->orientation.z_fx = L_deposit_l( readInt16( &buffer[6] ) ); -#endif return IVAS_ERR_OK; } -#ifdef ISM_PI_DATA static ivas_error unpackISMOrientation( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) { IVAS_PIDATA_ISM_ORIENTATION *ism_orientation = (IVAS_PIDATA_ISM_ORIENTATION *) piData; -#ifdef RTP_UPDATES_SA4_134 /* Orientation data is 4 bytes */ uint16_t n; if ( numDataBytes % 4 != 0 ) @@ -438,34 +335,8 @@ static ivas_error unpackISMOrientation( const uint8_t *buffer, uint32_t numDataB for ( n = 0; n < ism_orientation->numObjects; n++ ) { -#ifdef COMPACT_ORIENTATION_PI_DATA unpackQuaternion( &buffer[4 * n], &( ism_orientation->orientation[n] ) ); -#else - ism_orientation->orientation[n].w = FLOAT_FROM_Q7( (int8_t) buffer[4 * n] ); - ism_orientation->orientation[n].x = FLOAT_FROM_Q7( (int8_t) buffer[4 * n + 1] ); - ism_orientation->orientation[n].y = FLOAT_FROM_Q7( (int8_t) buffer[4 * n + 2] ); - ism_orientation->orientation[n].z = FLOAT_FROM_Q7( (int8_t) buffer[4 * n + 3] ); -#endif } -#else - /* Orientation data is 8 bytes */ - uint16_t n; - if ( numDataBytes % 8 != 0 ) - { - return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack Orientation PI data" ); - } - - ism_orientation->size = sizeof( IVAS_PIDATA_ISM_ORIENTATION ); - ism_orientation->numObjects = (uint16_t) numDataBytes / 8; - - for ( n = 0; n < ism_orientation->numObjects; n++ ) - { - ism_orientation->orientation[n].w_fx = L_deposit_l( readInt16( &buffer[8 * n] ) ); - ism_orientation->orientation[n].x_fx = L_deposit_l( readInt16( &buffer[8 * n + 2] ) ); - ism_orientation->orientation[n].y_fx = L_deposit_l( readInt16( &buffer[8 * n + 4] ) ); - ism_orientation->orientation[n].z_fx = L_deposit_l( readInt16( &buffer[8 * n + 6] ) ); - } -#endif for ( ; n < IVAS_MAX_NUM_OBJECTS; n++ ) { ism_orientation->orientation[n].w_fx = 0; @@ -476,7 +347,6 @@ static ivas_error unpackISMOrientation( const uint8_t *buffer, uint32_t numDataB return IVAS_ERR_OK; } -#endif static uint32_t getIndexTable( const float *table, uint32_t tableLength, float value ) { @@ -620,7 +490,6 @@ static ivas_error unpackAcousticEnvironment( const uint8_t *buffer, uint32_t num aeEnv->absorbCoeffs[IVAS_PI_AE_CEILING] = mapAbsorbtion[( dWord >> 2 ) & MASK_ABS]; aeEnv->absorbCoeffs[IVAS_PI_AE_FLOOR] = mapAbsorbtion[( dWord >> 0 ) & MASK_ABS]; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT aeEnv->rt60_fx[IVAS_PI_AE_LOW] = (Word32) ( aeEnv->rt60[IVAS_PI_AE_LOW] * ONE_IN_Q26 ); /* Q26 */ aeEnv->rt60_fx[IVAS_PI_AE_MID] = (Word32) ( aeEnv->rt60[IVAS_PI_AE_MID] * ONE_IN_Q26 ); aeEnv->rt60_fx[IVAS_PI_AE_HIGH] = (Word32) ( aeEnv->rt60[IVAS_PI_AE_HIGH] * ONE_IN_Q26 ); @@ -639,13 +508,11 @@ static ivas_error unpackAcousticEnvironment( const uint8_t *buffer, uint32_t num aeEnv->absorbCoeffs_fx[IVAS_PI_AE_RIGHT] = (Word32) ( aeEnv->absorbCoeffs[IVAS_PI_AE_RIGHT] * ONE_IN_Q30 ); aeEnv->absorbCoeffs_fx[IVAS_PI_AE_CEILING] = (Word32) ( aeEnv->absorbCoeffs[IVAS_PI_AE_CEILING] * ONE_IN_Q30 ); aeEnv->absorbCoeffs_fx[IVAS_PI_AE_FLOOR] = (Word32) ( aeEnv->absorbCoeffs[IVAS_PI_AE_FLOOR] * ONE_IN_Q30 ); -#endif } return IVAS_ERR_OK; } -#ifdef RTP_S4_251135_CR26253_0016_REV1 static ivas_error packAudioDescription( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t n; @@ -753,7 +620,6 @@ static ivas_error unpackDynamicSuppression( const uint8_t *buffer, uint32_t numD return IVAS_ERR_OK; } -#ifdef REVERSE_ISM_PI_DATA static ivas_error packPosition( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0; @@ -802,58 +668,6 @@ static ivas_error unpackPosition( const uint8_t *buffer, uint32_t numDataBytes, position->position.z = FLOAT_FROM_Q15( readInt16( &buffer[4] ) ) * MAX_PI_POSITION_METERS; return IVAS_ERR_OK; } -#else -static ivas_error packListenerPosition( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) -{ - uint32_t nBytes = 0; - const IVAS_PIDATA_LISTENER_POSITION *listener = (const IVAS_PIDATA_LISTENER_POSITION *) piData; - - *nBytesWritten = 0; - - if ( piData->size != sizeof( IVAS_PIDATA_LISTENER_POSITION ) ) - { - return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in LISTENER POSITION PI data" ); - } - - if ( piData->piDataType != IVAS_PI_LISTENER_POSITION ) - { - return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect PI ID in LISTENER POSITION PI data" ); - } - - /* Position data is 6 bytes, header is 2 bytes */ - if ( maxDataBytes < 6 + 2 ) - { - return IVAS_ERROR( IVAS_ERR_RTP_INSUFFICIENT_OUTPUT_SIZE, "Insufficient space to pack LISTENER POSITION PI data" ); - } - - buffer[nBytes++] = ( listener->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ - buffer[nBytes++] = 6; - nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( listener->position.x / MAX_PI_POSITION_METERS ) ); - nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( listener->position.y / MAX_PI_POSITION_METERS ) ); - nBytes = writeInt16( buffer, nBytes, ivasPayload_convertToQ15( listener->position.z / MAX_PI_POSITION_METERS ) ); - *nBytesWritten = nBytes; - return IVAS_ERR_OK; -} - -static ivas_error unpackListenerPosition( const uint8_t *buffer, uint32_t numDataBytes, IVAS_PIDATA_GENERIC *piData ) -{ - IVAS_PIDATA_LISTENER_POSITION *listener = (IVAS_PIDATA_LISTENER_POSITION *) piData; - - /* Position data is 6 bytes */ - if ( numDataBytes != 6 ) - { - return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack LISTENER POSITION PI data" ); - } - - listener->size = sizeof( IVAS_PIDATA_LISTENER_POSITION ); - listener->piDataType = IVAS_PI_LISTENER_POSITION; - listener->position.x = FLOAT_FROM_Q15( readInt16( &buffer[0] ) ) * MAX_PI_POSITION_METERS; - listener->position.y = FLOAT_FROM_Q15( readInt16( &buffer[2] ) ) * MAX_PI_POSITION_METERS; - listener->position.z = FLOAT_FROM_Q15( readInt16( &buffer[4] ) ) * MAX_PI_POSITION_METERS; - return IVAS_ERR_OK; -} -#endif -#ifdef RTP_UPDATES_SA4_134 static ivas_error packPositionCompact( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0; @@ -915,9 +729,7 @@ static ivas_error unpackPositionCompact( const uint8_t *buffer, uint32_t numData return IVAS_ERR_OK; } -#endif -#ifdef ISM_PI_DATA static ivas_error packISMPosition( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0, n; @@ -976,8 +788,6 @@ static ivas_error unpackISMPosition( const uint8_t *buffer, uint32_t numDataByte } return IVAS_ERR_OK; } -#endif -#ifdef RTP_UPDATES_SA4_134 static ivas_error packISMPositionCompact( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0, n; @@ -1045,7 +855,6 @@ static ivas_error unpackISMPositionCompact( const uint8_t *buffer, uint32_t numD } return IVAS_ERR_OK; } -#endif static ivas_error packDiegetic( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0, n; @@ -1122,7 +931,6 @@ static ivas_error packAudioFocusCommon( const IVAS_PIDATA_GENERIC *piData, uint8 { return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Incorrect size in PI data of type Audio Focus" ); } -#ifdef RTP_UPDATES_SA4_134 if ( audioFocus->availDirection && audioFocus->availLevel ) { packedSize = 5; @@ -1131,16 +939,6 @@ static ivas_error packAudioFocusCommon( const IVAS_PIDATA_GENERIC *piData, uint8 { packedSize = 4; } -#else - if ( audioFocus->availDirection && audioFocus->availLevel ) - { - packedSize = 9; - } - else if ( audioFocus->availDirection ) - { - packedSize = 8; - } -#endif else if ( audioFocus->availLevel ) { packedSize = 1; @@ -1158,35 +956,14 @@ static ivas_error packAudioFocusCommon( const IVAS_PIDATA_GENERIC *piData, uint8 buffer[nBytes++] = ( audioFocus->piDataType & MASK_5BIT ); /* PF/PM populated during final packing */ buffer[nBytes++] = packedSize; -#ifdef RTP_UPDATES_SA4_134 if ( packedSize == 5 || packedSize == 4 ) { -#ifdef COMPACT_ORIENTATION_PI_DATA nBytes += packQuaternion( audioFocus->direction, &buffer[nBytes] ); -#else - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( audioFocus->direction.w ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( audioFocus->direction.x ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( audioFocus->direction.y ); - buffer[nBytes++] = (uint8_t) ivasPayload_convertToQ7( audioFocus->direction.z ); -#endif } if ( packedSize == 5 || packedSize == 1 ) { buffer[nBytes++] = ( (uint8_t) audioFocus->flvl & MASK_4BIT ) << 4; } -#else - if ( packedSize == 9 || packedSize == 8 ) - { - nBytes = writeInt16( buffer, nBytes, round_fx( audioFocus->direction.w_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( audioFocus->direction.x_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( audioFocus->direction.y_fx ) ); - nBytes = writeInt16( buffer, nBytes, round_fx( audioFocus->direction.z_fx ) ); - } - if ( packedSize == 9 || packedSize == 1 ) - { - buffer[nBytes++] = ( (uint8_t) audioFocus->flvl & MASK_4BIT ) << 4; - } -#endif *nBytesWritten = nBytes; return IVAS_ERR_OK; @@ -1196,7 +973,6 @@ static ivas_error unpackAudioFocusCommon( const uint8_t *buffer, uint32_t numDat { IVAS_PIDATA_AUDIO_FOCUS *audioFocus = (IVAS_PIDATA_AUDIO_FOCUS *) piData; -#ifdef RTP_UPDATES_SA4_134 /* Audio Focus data is either 1, 4 or 5 bytes */ if ( numDataBytes != 1 && numDataBytes != 4 && numDataBytes != 5 ) { @@ -1213,53 +989,17 @@ static ivas_error unpackAudioFocusCommon( const uint8_t *buffer, uint32_t numDat } else { -#ifdef COMPACT_ORIENTATION_PI_DATA unpackQuaternion( buffer, &( audioFocus->direction ) ); -#else - audioFocus->direction.w = FLOAT_FROM_Q7( (int8_t) buffer[0] ); - audioFocus->direction.x = FLOAT_FROM_Q7( (int8_t) buffer[1] ); - audioFocus->direction.y = FLOAT_FROM_Q7( (int8_t) buffer[2] ); - audioFocus->direction.z = FLOAT_FROM_Q7( (int8_t) buffer[3] ); -#endif if ( numDataBytes == 5 ) { audioFocus->flvl = ( buffer[4] >> 4 ); } } -#else - /* Audio Focus data is either 1, 8 or 9 bytes */ - if ( numDataBytes != 1 && numDataBytes != 8 && numDataBytes != 9 ) - { - return IVAS_ERROR( IVAS_ERR_RTP_UNPACK_PI_DATA, "Incorrect size to unpack PI data of type Audio Focus" ); - } - - piData->size = sizeof( IVAS_PIDATA_AUDIO_FOCUS ); - audioFocus->availDirection = ( numDataBytes >= 8 ); - audioFocus->availLevel = ( numDataBytes == 1 || numDataBytes == 9 ); - - if ( numDataBytes == 1 ) - { - audioFocus->flvl = ( buffer[0] >> 4 ); - } - else - { - audioFocus->direction.w_fx = L_deposit_l( readInt16( &buffer[0] ) ); - audioFocus->direction.x_fx = L_deposit_l( readInt16( &buffer[2] ) ); - audioFocus->direction.y_fx = L_deposit_l( readInt16( &buffer[4] ) ); - audioFocus->direction.z_fx = L_deposit_l( readInt16( &buffer[6] ) ); - - if ( numDataBytes == 9 ) - { - audioFocus->flvl = ( buffer[8] >> 4 ); - } - } -#endif return IVAS_ERR_OK; } -#ifdef ISM_PI_DATA static ivas_error packISMNum( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0; @@ -1628,9 +1368,7 @@ static ivas_error unpackISMDirectivity( const uint8_t *buffer, uint32_t numDataB } return IVAS_ERR_OK; } -#endif -#ifdef REVERSE_ISM_PI_DATA static ivas_error packReverseISMID( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { uint32_t nBytes = 0; @@ -1811,7 +1549,6 @@ static ivas_error unpackReverseISMDirection( const uint8_t *buffer, uint32_t num return IVAS_ERR_OK; } -#endif static ivas_error packPiLatency( const IVAS_PIDATA_GENERIC *piData, uint8_t *buffer, uint32_t maxDataBytes, uint32_t *nBytesWritten ) { @@ -1879,215 +1616,78 @@ static ivas_error unpackPiLatency( const uint8_t *buffer, uint32_t numDataBytes, return IVAS_ERR_OK; } -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ static const PACK_PI_FN packPiDataFuntions[IVAS_PI_MAX_ID] = { - packOrientation, /* SCENE_ORIENTATION */ - packOrientation, /* DEVICE_ORIENTATION_COMPENSATED */ - packOrientation, /* DEVICE_ORIENTATION_UNCOMPENSATED */ - packAcousticEnvironment, /* ACOUSTIC_ENVIRONMENT */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 - packAudioDescription, /* AUDIO_DESCRIPTION */ -#else - packUnsupportedData, /* AUDIO_DESCRIPTION */ -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ -#ifdef ISM_PI_DATA - packISMNum, /* ISM_NUM */ - packISMID, /* ISM_ID */ - packISMGain, /* ISM_GAIN */ - packISMOrientation, /* ISM_ORIENTATION */ - packISMPosition, /* ISM_POSITION */ -#ifdef RTP_UPDATES_SA4_134 - packISMPositionCompact, /* ISM_POSITION_COMPACT */ -#endif + packOrientation, /* SCENE_ORIENTATION */ + packOrientation, /* DEVICE_ORIENTATION_COMPENSATED */ + packOrientation, /* DEVICE_ORIENTATION_UNCOMPENSATED */ + packAcousticEnvironment, /* ACOUSTIC_ENVIRONMENT */ + packAudioDescription, /* AUDIO_DESCRIPTION */ + packISMNum, /* ISM_NUM */ + packISMID, /* ISM_ID */ + packISMGain, /* ISM_GAIN */ + packISMOrientation, /* ISM_ORIENTATION */ + packISMPosition, /* ISM_POSITION */ + packISMPositionCompact, /* ISM_POSITION_COMPACT */ packISMDistanceAttenuation, /* ISM_DISTANCE_ATTENUATION */ packISMDirectivity, /* ISM_DIRECTIVITY */ -#else - packUnsupportedData, /* ISM_NUM */ - packUnsupportedData, /* ISM_ID */ - packUnsupportedData, /* ISM_GAIN */ - packUnsupportedData, /* ISM_ORIENTATION */ - packUnsupportedData, /* ISM_POSITION */ - packUnsupportedData, /* ISM_DISTANCE_ATTENUATION */ - packUnsupportedData, /* ISM_DIRECTIVITY */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - packDiegetic, /* DIEGETIC_TYPE */ -#else - packUnsupportedData, /* DIEGETIC_TYPE */ -#endif -#ifdef RTP_UPDATES_SA4_134 - packDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_INDICATION */ -#else - packUnsupportedData, /* RESERVED13 */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - packAudioFocusCommon, /* AUDIO_FOCUS_INDICATION */ -#else - packUnsupportedData, /* AUDIO_FOCUS_INDICATION */ -#endif -#ifndef RTP_UPDATES_SA4_134 - packUnsupportedData, /* RESERVED15 */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - packOrientation, /* PLAYBACK_DEVICE_ORIENTATION */ - packOrientation, /* HEAD_ORIENTATION */ -#ifdef REVERSE_ISM_PI_DATA - packPosition, /* LISTENER_POSITION */ -#else - packListenerPosition, /* LISTENER_POSITION */ -#endif -#ifdef RTP_UPDATES_SA4_134 - packDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_REQUEST */ -#else - packDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION */ -#endif - packAudioFocusCommon, /* AUDIO_FOCUS_REQUEST */ - packPiLatency, /* PI_LATENCY */ -#else - packUnsupportedData, /* PLAYBACK_DEVICE_ORIENTATION */ - packUnsupportedData, /* HEAD_ORIENTATION */ - packUnsupportedData, /* LISTENER_POSITION */ - packUnsupportedData, /* DYNAMIC_AUDIO_SUPPRESSION */ - packUnsupportedData, /* AUDIO_FOCUS_DIRECTION */ - packUnsupportedData, /* PI_LATENCY */ -#endif -#ifdef REVERSE_ISM_PI_DATA - packReverseISMID, /* R_ISM_ID */ - packReverseISMGain, /* R_ISM_GAIN */ -#else - packUnsupportedData, /* R_ISM_ID */ - packUnsupportedData, /* R_ISM_GAIN */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - packOrientation, /* R_ISM_ORIENTATION */ -#else - packUnsupportedData, /* R_ISM_ORIENTATION */ -#endif - -#ifdef REVERSE_ISM_PI_DATA - packPosition, /* R_ISM_POSITION */ -#ifdef RTP_UPDATES_SA4_134 - packPositionCompact, /* R_ISM_POSITION_COMPACT */ -#endif + packDiegetic, /* DIEGETIC_TYPE */ + packDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_INDICATION */ + packAudioFocusCommon, /* AUDIO_FOCUS_INDICATION */ + packOrientation, /* PLAYBACK_DEVICE_ORIENTATION */ + packOrientation, /* HEAD_ORIENTATION */ + packPosition, /* LISTENER_POSITION */ + packDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_REQUEST */ + packAudioFocusCommon, /* AUDIO_FOCUS_REQUEST */ + packPiLatency, /* PI_LATENCY */ + packReverseISMID, /* R_ISM_ID */ + packReverseISMGain, /* R_ISM_GAIN */ + packOrientation, /* R_ISM_ORIENTATION */ + + packPosition, /* R_ISM_POSITION */ + packPositionCompact, /* R_ISM_POSITION_COMPACT */ packReverseISMDirection, /* R_ISM_DIRECTION */ -#else - packUnsupportedData, /* R_ISM_POSITION */ - packUnsupportedData, /* R_ISM_DIRECTION */ -#endif - packUnsupportedData, /* RESERVED27 */ - packUnsupportedData, /* RESERVED28 */ - packUnsupportedData, /* RESERVED29 */ -#ifndef RTP_UPDATES_SA4_134 - packUnsupportedData, /* RESERVED30 */ - packNoPiData /* NO_DATA */ -#endif - packNoPiData /* NO_DATA */ + packUnsupportedData, /* RESERVED27 */ + packUnsupportedData, /* RESERVED28 */ + packUnsupportedData, /* RESERVED29 */ + packNoPiData /* NO_DATA */ }; static const UNPACK_PI_FN unpackPiDataFuntions[IVAS_PI_MAX_ID] = { - unpackOrientation, /* SCENE_ORIENTATION */ - unpackOrientation, /* DEVICE_ORIENTATION_COMPENSATED */ - unpackOrientation, /* DEVICE_ORIENTATION_UNCOMPENSATED */ - unpackAcousticEnvironment, /* ACOUSTIC_ENVIRONMENT */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 - unpackAudioDescription, /* AUDIO_DESCRIPTION */ -#else - unpackUnsupportedData, /* AUDIO_DESCRIPTION */ -#endif -#ifdef ISM_PI_DATA - unpackISMNum, /* ISM_NUM */ - unpackISMID, /* ISM_ID */ - unpackISMGain, /* ISM_GAIN */ - unpackISMOrientation, /* ISM_ORIENTATION */ - unpackISMPosition, /* ISM_POSITION */ -#ifdef RTP_UPDATES_SA4_134 - unpackISMPositionCompact, /* ISM_POSITION_COMPACT */ -#endif + unpackOrientation, /* SCENE_ORIENTATION */ + unpackOrientation, /* DEVICE_ORIENTATION_COMPENSATED */ + unpackOrientation, /* DEVICE_ORIENTATION_UNCOMPENSATED */ + unpackAcousticEnvironment, /* ACOUSTIC_ENVIRONMENT */ + unpackAudioDescription, /* AUDIO_DESCRIPTION */ + unpackISMNum, /* ISM_NUM */ + unpackISMID, /* ISM_ID */ + unpackISMGain, /* ISM_GAIN */ + unpackISMOrientation, /* ISM_ORIENTATION */ + unpackISMPosition, /* ISM_POSITION */ + unpackISMPositionCompact, /* ISM_POSITION_COMPACT */ unpackISMDistanceAttenuation, /* ISM_DISTANCE_ATTENUATION */ unpackISMDirectivity, /* ISM_DIRECTIVITY */ -#else - unpackUnsupportedData, /* ISM_NUM */ - unpackUnsupportedData, /* ISM_ID */ - unpackUnsupportedData, /* ISM_GAIN */ - unpackUnsupportedData, /* ISM_ORIENTATION */ - unpackUnsupportedData, /* ISM_POSITION */ - unpackUnsupportedData, /* ISM_DISTANCE_ATTENUATION */ - unpackUnsupportedData, /* ISM_DIRECTIVITY */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - unpackDiegetic, /* DIEGETIC_TYPE */ -#else - unpackUnsupportedData, /* DIEGETIC_TYPE */ -#endif -#ifdef RTP_UPDATES_SA4_134 - unpackDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_INDICATION */ -#else - unpackUnsupportedData, /* RESERVED13 */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - unpackAudioFocusCommon, /* AUDIO_FOCUS_INDICATION */ -#else - unpackUnsupportedData, /* AUDIO_FOCUS_INDICATION */ -#endif -#ifndef RTP_UPDATES_SA4_134 - unpackUnsupportedData, /* RESERVED15 */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - unpackOrientation, /* PLAYBACK_DEVICE_ORIENTATION */ - unpackOrientation, /* HEAD_ORIENTATION */ -#ifdef REVERSE_ISM_PI_DATA - unpackPosition, /* LISTENER_POSITION */ -#else - unpackListenerPosition, /* LISTENER_POSITION */ -#endif -#ifdef RTP_UPDATES_SA4_134 - unpackDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_REQUEST */ -#else - unpackDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION */ -#endif - unpackAudioFocusCommon, /* AUDIO_FOCUS_REQUEST */ - unpackPiLatency, /* PI_LATENCY */ -#else - unpackUnsupportedData, /* PLAYBACK_DEVICE_ORIENTATION */ - unpackUnsupportedData, /* HEAD_ORIENTATION */ - unpackUnsupportedData, /* LISTENER_POSITION */ - unpackUnsupportedData, /* DYNAMIC_AUDIO_SUPPRESSION */ - unpackUnsupportedData, /* AUDIO_FOCUS_DIRECTION */ - unpackUnsupportedData, /* PI_LATENCY */ -#endif -#ifdef REVERSE_ISM_PI_DATA - unpackReverseISMID, /* R_ISM_ID */ - unpackReverseISMGain, /* R_ISM_GAIN */ -#else - unpackUnsupportedData, /* R_ISM_ID */ - unpackUnsupportedData, /* R_ISM_GAIN */ -#endif -#ifdef RTP_S4_251135_CR26253_0016_REV1 - unpackOrientation, /* R_ISM_ORIENTATION */ -#else - unpackUnsupportedData, /* R_ISM_ORIENTATION */ -#endif -#ifdef REVERSE_ISM_PI_DATA - unpackPosition, /* R_ISM_POSITION */ -#ifdef RTP_UPDATES_SA4_134 - unpackPositionCompact, /* R_ISM_POSITION_COMPACT */ -#endif - unpackReverseISMDirection, /* R_ISM_DIRECTION */ -#else - unpackUnsupportedData, /* R_ISM_POSITION */ - unpackUnsupportedData, /* R_ISM_DIRECTION */ -#endif - unpackUnsupportedData, /* RESERVED27 */ - unpackUnsupportedData, /* RESERVED28 */ - unpackUnsupportedData, /* RESERVED29 */ -#ifndef RTP_UPDATES_SA4_134 - unpackUnsupportedData, /* RESERVED30 */ -#endif - unpackNoPiData /* NO_DATA */ + unpackDiegetic, /* DIEGETIC_TYPE */ + unpackDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_INDICATION */ + unpackAudioFocusCommon, /* AUDIO_FOCUS_INDICATION */ + unpackOrientation, /* PLAYBACK_DEVICE_ORIENTATION */ + unpackOrientation, /* HEAD_ORIENTATION */ + unpackPosition, /* LISTENER_POSITION */ + unpackDynamicSuppression, /* DYNAMIC_AUDIO_SUPPRESSION_REQUEST */ + unpackAudioFocusCommon, /* AUDIO_FOCUS_REQUEST */ + unpackPiLatency, /* PI_LATENCY */ + unpackReverseISMID, /* R_ISM_ID */ + unpackReverseISMGain, /* R_ISM_GAIN */ + unpackOrientation, /* R_ISM_ORIENTATION */ + unpackPosition, /* R_ISM_POSITION */ + unpackPositionCompact, /* R_ISM_POSITION_COMPACT */ + unpackReverseISMDirection, /* R_ISM_DIRECTION */ + unpackUnsupportedData, /* RESERVED27 */ + unpackUnsupportedData, /* RESERVED28 */ + unpackUnsupportedData, /* RESERVED29 */ + unpackNoPiData /* NO_DATA */ }; -#ifdef RTP_UPDATES_SA4_134 static const uint32_t maxPiDataSize[IVAS_PI_MAX_ID] = { 4, /* IVAS_PI_SCENE_ORIENTATION */ 4, /* IVAS_PI_DEVICE_ORIENTATION_COMPENSATED */ @@ -2122,42 +1722,6 @@ static const uint32_t maxPiDataSize[IVAS_PI_MAX_ID] = { 0, /* IVAS_PI_RESERVED29 */ 0, /* NO_DATA */ }; -#else -static const uint32_t maxPiDataSize[IVAS_PI_MAX_ID] = { - 8, /* IVAS_PI_SCENE_ORIENTATION */ - 8, /* IVAS_PI_DEVICE_ORIENTATION_COMPENSATED */ - 8, /* IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED */ - 8, /* IVAS_PI_ACOUSTIC_ENVIRONMENT */ - 5, /* IVAS_PI_AUDIO_DESCRIPTION */ - 1, /* IVAS_PI_ISM_NUM */ - 4, /* IVAS_PI_ISM_ID */ - 4, /* IVAS_PI_ISM_GAIN */ - 32, /* IVAS_PI_ISM_ORIENTATION */ - 24, /* IVAS_PI_ISM_POSITION */ - 12, /* IVAS_PI_ISM_DISTANCE_ATTENUATION */ - 8, /* IVAS_PI_ISM_DIRECTIVITY */ - 1, /* IVAS_PI_DIEGETIC_TYPE */ - 0, /* IVAS_PI_RESERVED13 */ - 9, /* IVAS_PI_AUDIO_FOCUS_INDICATION */ - 0, /* IVAS_PI_RESERVED15 */ - 8, /* IVAS_PI_PLAYBACK_DEVICE_ORIENTATION */ - 8, /* IVAS_PI_HEAD_ORIENTATION */ - 6, /* IVAS_PI_LISTENER_POSITION */ - 2, /* IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION */ - 9, /* IVAS_PI_AUDIO_FOCUS_REQUEST */ - 4, /* IVAS_PI_PI_LATENCY */ - 1, /* IVAS_PI_R_ISM_ID */ - 1, /* IVAS_PI_R_ISM_GAIN */ - 8, /* IVAS_PI_R_ISM_ORIENTATION */ - 6, /* IVAS_PI_R_ISM_POSITION */ - 2, /* IVAS_PI_R_ISM_DIRECTION */ - 0, /* IVAS_PI_RESERVED27 */ - 0, /* IVAS_PI_RESERVED28 */ - 0, /* IVAS_PI_RESERVED29 */ - 0, /* IVAS_PI_RESERVED30 */ - 0, /* IVAS_PI_NO_DATA = 31 */ -}; -#endif ivas_error PI_PackData( const IVAS_PIDATA_GENERIC *piData, PIDATA_PACKED *packed, uint8_t pmBits ) { @@ -2217,6 +1781,3 @@ const float mapRoomDims[1u << NBITS_DIM] = { const float mapAbsorbtion[1u << NBITS_ABS] = { 0.0800f, 0.1656f, 0.3430f, 0.7101f }; - - -#endif /* IVAS_RTPDUMP */ diff --git a/lib_util/ivas_rtp_pi_data.h b/lib_util/ivas_rtp_pi_data.h index c1f979c94..97519f588 100644 --- a/lib_util/ivas_rtp_pi_data.h +++ b/lib_util/ivas_rtp_pi_data.h @@ -35,43 +35,34 @@ #include "common_api_types.h" -#ifdef IVAS_RTPDUMP #define IVAS_PI_MAX_DATA_SIZE ( 32 + 2 ) /* max packed PI data bytes + pi header bytes */ -#ifdef REVERSE_ISM_PI_DATA #define REVERSE_ISM_DIRECTION_AZIMUTH_STEP 0.703125f #define REVERSE_ISM_DIRECTION_ELEVATION_STEP 1.417322835f #define REVERSE_ISM_DIRECTION_AZIMUTH_STEP_INV 1.4222222222f #define REVERSE_ISM_DIRECTION_ELEVATION_STEP_INV 0.7055555556f -#endif /* IVAS PI Data Types */ typedef enum { /* Forward direction PI types */ - IVAS_PI_SCENE_ORIENTATION, /* orientation of audio scene in unit quaternions */ - IVAS_PI_DEVICE_ORIENTATION_COMPENSATED, /* orientation of device in unit quaternions (compensated) */ - IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED, /* orientation of device in unit quaternions (un-compensated) */ - IVAS_PI_ACOUSTIC_ENVIRONMENT, /* describe the acoustic environment */ -#ifdef RTP_S4_251135_CR26253_0016_REV1 - IVAS_PI_AUDIO_DESCRIPTION, /* audio content description (voice/music/ambiance) */ - IVAS_PI_ISM_NUM, /* Number of objects */ - IVAS_PI_ISM_ID, /* id of each object */ - IVAS_PI_ISM_GAIN, /* gain of each object */ - IVAS_PI_ISM_ORIENTATION, /* orientation of each object */ - IVAS_PI_ISM_POSITION, /* position of each object */ -#ifdef RTP_UPDATES_SA4_134 - IVAS_PI_ISM_POSITION_COMPACT, /* position of each object in compact representation */ -#endif + IVAS_PI_SCENE_ORIENTATION, /* orientation of audio scene in unit quaternions */ + IVAS_PI_DEVICE_ORIENTATION_COMPENSATED, /* orientation of device in unit quaternions (compensated) */ + IVAS_PI_DEVICE_ORIENTATION_UNCOMPENSATED, /* orientation of device in unit quaternions (un-compensated) */ + IVAS_PI_ACOUSTIC_ENVIRONMENT, /* describe the acoustic environment */ + IVAS_PI_AUDIO_DESCRIPTION, /* audio content description (voice/music/ambiance) */ + IVAS_PI_ISM_NUM, /* Number of objects */ + IVAS_PI_ISM_ID, /* id of each object */ + IVAS_PI_ISM_GAIN, /* gain of each object */ + IVAS_PI_ISM_ORIENTATION, /* orientation of each object */ + IVAS_PI_ISM_POSITION, /* position of each object */ + IVAS_PI_ISM_POSITION_COMPACT, /* position of each object in compact representation */ IVAS_PI_ISM_DISTANCE_ATTENUATION, /* distance attenuation for each object */ IVAS_PI_ISM_DIRECTIVITY, /* directivity of each object */ IVAS_PI_DIEGETIC_TYPE, /* digetic audio indication */ IVAS_PI_DYNAMIC_AUDIO_SUPPRESSION_INDICATION, /* audio suppression indication */ IVAS_PI_AUDIO_FOCUS_INDICATION, /* audio focus indication (direction in Quaternions and/or level) */ -#ifndef RTP_UPDATES_SA4_134 - IVAS_PI_RESERVED15, /* reserved */ -#endif /* Reverse direction PI types */ IVAS_PI_PLAYBACK_DEVICE_ORIENTATION, /* orientation of the playback device in quaternions */ IVAS_PI_HEAD_ORIENTATION, /* head orientation of the listener in Quaternions */ @@ -83,19 +74,13 @@ typedef enum IVAS_PI_R_ISM_GAIN, /* editing request for gain factor for received object */ IVAS_PI_R_ISM_ORIENTATION, /* editing request for orientation for received object */ IVAS_PI_R_ISM_POSITION, /* editing request for position for received object */ -#ifdef RTP_UPDATES_SA4_134 - IVAS_PI_R_ISM_POSITION_COMPACT, /* editing request for position for received object in a compact representation*/ -#endif - IVAS_PI_R_ISM_DIRECTION, /* editing request for direction for received object */ - IVAS_PI_RESERVED27, /* reserved */ - IVAS_PI_RESERVED28, /* reserved */ - IVAS_PI_RESERVED29, /* reserved */ -#ifndef RTP_UPDATES_SA4_134 - IVAS_PI_RESERVED30, /* reserved */ -#endif -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ - IVAS_PI_NO_DATA = 31, /* Indicates an empty PI data frame */ - IVAS_PI_MAX_ID /* Max number of PI data IDs supprted */ + IVAS_PI_R_ISM_POSITION_COMPACT, /* editing request for position for received object in a compact representation*/ + IVAS_PI_R_ISM_DIRECTION, /* editing request for direction for received object */ + IVAS_PI_RESERVED27, /* reserved */ + IVAS_PI_RESERVED28, /* reserved */ + IVAS_PI_RESERVED29, /* reserved */ + IVAS_PI_NO_DATA = 31, /* Indicates an empty PI data frame */ + IVAS_PI_MAX_ID /* Max number of PI data IDs supprted */ } IVAS_PI_TYPE; /* cartesian coordinates (X,Y,Z) in 3D space */ @@ -140,14 +125,12 @@ typedef enum IVAS_PI_AE_NUM_BANDS /* number of ae bands */ } IVAS_PI_AE_BANDS; -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT typedef enum { IVAS_PI_AE_LOW_FREQ = 25, IVAS_PI_AE_MID_FREQ = 250, IVAS_PI_AE_HIGH_FREQ = 2500 } IVAS_PI_AE_BANDS_FREQ; -#endif typedef enum { @@ -169,26 +152,17 @@ typedef struct uint8_t aeid; /* seven-bit acoustic environment identifier */ /* only valid if availLateReverb==true or availEarlyReflections==true */ - float rt60[IVAS_PI_AE_NUM_BANDS]; /* time for the reflections to reduce 60 dB per band in seconds */ - float dsr[IVAS_PI_AE_NUM_BANDS]; /* diffuse to source signal energy ratio per band in dB */ -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT + float rt60[IVAS_PI_AE_NUM_BANDS]; /* time for the reflections to reduce 60 dB per band in seconds */ + float dsr[IVAS_PI_AE_NUM_BANDS]; /* diffuse to source signal energy ratio per band in dB */ Word32 rt60_fx[IVAS_PI_AE_NUM_BANDS]; /* Q26: time for the reflections to reduce 60 dB per band in seconds */ Word32 dsr_fx[IVAS_PI_AE_NUM_BANDS]; /* Q30: diffuse to source signal energy ratio per band in dB */ -#endif /* only valid if availEarlyReflections==true */ -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - IVAS_VECTOR3 roomDimensions; /* room dimensions in meters length (x), width (y), height (z) */ -#else - IVAS_COORDINATE roomDimensions; /* room dimensions in meters length (x), width (y), height (z) */ -#endif - float absorbCoeffs[IVAS_PI_AE_NUM_SURFACE]; /* absorption coefficients for all surfaces */ -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT + IVAS_VECTOR3 roomDimensions; /* room dimensions in meters length (x), width (y), height (z) */ + float absorbCoeffs[IVAS_PI_AE_NUM_SURFACE]; /* absorption coefficients for all surfaces */ Word32 absorbCoeffs_fx[IVAS_PI_AE_NUM_SURFACE]; /* Q30: absorption coefficients for all surfaces */ -#endif } IVAS_PIDATA_ACOUSTIC_ENV; -#ifdef RTP_S4_251135_CR26253_0016_REV1 /* Audio Description corresponding to IVAS_PI_AUDIO_DESCRIPTION * Describe the following audio decriptors per object/type :- * - audio content type is speech/music/ambiance @@ -241,44 +215,36 @@ typedef struct /* ISM ID */ typedef struct { - size_t size; /* sizeof(IVAS_PIDATA_ISM_ID) */ - uint32_t piDataType; /* IVAS_PI_ISM_ID */ -#ifdef ISM_PI_DATA - uint16_t numObjects; /* number of objects */ -#endif + size_t size; /* sizeof(IVAS_PIDATA_ISM_ID) */ + uint32_t piDataType; /* IVAS_PI_ISM_ID */ + uint16_t numObjects; /* number of objects */ uint8_t id[IVAS_MAX_NUM_OBJECTS]; /* 8-bit ISM id of object */ } IVAS_PIDATA_ISM_ID; /* ISM gain */ typedef struct { - size_t size; /* sizeof(IVAS_PIDATA_ISM_GAIN) */ - uint32_t piDataType; /* IVAS_PI_ISM_GAIN */ -#ifdef ISM_PI_DATA - uint16_t numObjects; /* number of objects */ -#endif + size_t size; /* sizeof(IVAS_PIDATA_ISM_GAIN) */ + uint32_t piDataType; /* IVAS_PI_ISM_GAIN */ + uint16_t numObjects; /* number of objects */ int8_t dB[IVAS_MAX_NUM_OBJECTS]; /* ISM gain in dB per object [-96, +3] */ } IVAS_PIDATA_ISM_GAIN; /* ISM orientation */ typedef struct { - size_t size; /* sizeof(IVAS_PIDATA_ISM_ORIENTATION) */ - uint32_t piDataType; /* IVAS_PI_ISM_ORIENTATION */ -#ifdef ISM_PI_DATA - uint16_t numObjects; /* number of objects */ -#endif + size_t size; /* sizeof(IVAS_PIDATA_ISM_ORIENTATION) */ + uint32_t piDataType; /* IVAS_PI_ISM_ORIENTATION */ + uint16_t numObjects; /* number of objects */ IVAS_QUATERNION orientation[IVAS_MAX_NUM_OBJECTS]; /* Orientation of audio objects in ISM(s) */ } IVAS_PIDATA_ISM_ORIENTATION; /* ISM position */ typedef struct { - size_t size; /* sizeof(IVAS_PIDATA_ISM_POSITION) */ - uint32_t piDataType; /* IVAS_PI_ISM_POSITION */ -#ifdef ISM_PI_DATA - uint16_t numObjects; /* number of objects */ -#endif + size_t size; /* sizeof(IVAS_PIDATA_ISM_POSITION) */ + uint32_t piDataType; /* IVAS_PI_ISM_POSITION */ + uint16_t numObjects; /* number of objects */ IVAS_COORDINATE position[IVAS_MAX_NUM_OBJECTS]; /* Position of audio objects in ISM(s) */ } IVAS_PIDATA_ISM_POSITION; @@ -296,11 +262,9 @@ typedef struct typedef struct { - size_t size; /* sizeof(IVAS_PIDATA_ISM_ATTENUATION) */ - uint32_t piDataType; /* IVAS_PI_ISM_DISTANCE_ATTENUATION */ -#ifdef ISM_PI_DATA - uint16_t numObjects; /* number of objects */ -#endif + size_t size; /* sizeof(IVAS_PIDATA_ISM_ATTENUATION) */ + uint32_t piDataType; /* IVAS_PI_ISM_DISTANCE_ATTENUATION */ + uint16_t numObjects; /* number of objects */ IVAS_DIST_ATTEN distAtten[IVAS_MAX_NUM_OBJECTS]; /* Distance attenuation of audio objects */ } IVAS_PIDATA_ISM_ATTENUATION; @@ -318,11 +282,9 @@ typedef struct typedef struct { - size_t size; /* sizeof(IVAS_PIDATA_ISM_DIRECTIVITY) */ - uint32_t piDataType; /* IVAS_PI_ISM_DIRECTIVITY */ -#ifdef ISM_PI_DATA - uint16_t numObjects; /* number of objects */ -#endif + size_t size; /* sizeof(IVAS_PIDATA_ISM_DIRECTIVITY) */ + uint32_t piDataType; /* IVAS_PI_ISM_DIRECTIVITY */ + uint16_t numObjects; /* number of objects */ IVAS_ISM_DIRECTIVITY directivity[IVAS_MAX_NUM_OBJECTS]; /* Directivity of audio objects */ } IVAS_PIDATA_ISM_DIRECTIVITY; @@ -374,7 +336,6 @@ typedef struct IVAS_FLVL flvl; /* audio focus level */ } IVAS_PIDATA_AUDIO_FOCUS; -#ifdef REVERSE_ISM_PI_DATA /* Position data corresponding to any of the following pi data types :- * - IVAS_PI_LISTENER_POSITION * - IVAS_PI_R_ISM_POSITION @@ -387,15 +348,6 @@ typedef struct uint32_t piDataType; /* one of supported position data types */ IVAS_COORDINATE position; /* Position data */ } IVAS_PIDATA_POSITION; -#else -/* Listener position */ -typedef struct -{ - size_t size; /* sizeof(IVAS_PIDATA_LISTENER_POSITION) */ - uint32_t piDataType; /* IVAS_PI_LISTENER_POSITION */ - IVAS_COORDINATE position; /* Position of audio objects in ISM(s) */ -} IVAS_PIDATA_LISTENER_POSITION; -#endif /* Dynamic Audio Suppression describes receiver’s preference with respect to the @@ -471,15 +423,6 @@ typedef struct IVAS_QUATERNION orientation; /* orientation editing request for received ISM */ } IVAS_PIDATA_ISM_EDIT_ORIENTATION; -#ifndef REVERSE_ISM_PI_DATA -/* Editing request for ISM position */ -typedef struct -{ - size_t size; /* sizeof(IVAS_PIDATA_ISM_EDIT_POSITION) */ - uint32_t piDataType; /* IVAS_PI_R_ISM_POSITION */ - IVAS_COORDINATE position; /* Positional editing request for received ISM */ -} IVAS_PIDATA_ISM_EDIT_POSITION; -#endif /* Editing request for ISM direction */ typedef struct @@ -489,7 +432,6 @@ typedef struct float azimuth; /* azimuth angle in degrees [-180, 180] */ float elevation; /* elevation angle in degrees [-90°, 90°] */ } IVAS_PIDATA_ISM_EDIT_DIRECTION; -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ typedef struct { @@ -504,16 +446,13 @@ typedef union IVAS_PIDATA_ORIENTATION deviceCompensated; IVAS_PIDATA_ORIENTATION deviceUnCompensated; IVAS_PIDATA_ACOUSTIC_ENV acousticEnv; -#ifdef RTP_S4_251135_CR26253_0016_REV1 IVAS_PIDATA_AUDIO_DESC audioDesc; IVAS_PIDATA_ISM_NUM ismNum; IVAS_PIDATA_ISM_ID ismId; IVAS_PIDATA_ISM_GAIN ismGain; IVAS_PIDATA_ISM_ORIENTATION ismOrientation; IVAS_PIDATA_ISM_POSITION ismPosition; -#ifdef RTP_UPDATES_SA4_134 IVAS_PIDATA_ISM_POSITION ismPositionCompact; -#endif IVAS_PIDATA_ISM_ATTENUATION ismAttenuation; IVAS_PIDATA_ISM_DIRECTIVITY ismDirectivity; IVAS_PIDATA_DIEGETIC digeticIndicator; @@ -522,27 +461,16 @@ typedef union IVAS_PIDATA_ORIENTATION playbackOrientation; IVAS_PIDATA_ORIENTATION headOrientation; -#ifdef REVERSE_ISM_PI_DATA IVAS_PIDATA_POSITION listnerPosition; -#else - IVAS_PIDATA_LISTENER_POSITION listnerPosition; -#endif IVAS_PIDATA_DYNAMIC_SUPPRESSION dynSuppressionRequest; IVAS_PIDATA_AUDIO_FOCUS focusRequest; IVAS_PIDATA_REVERSE_PI_LATENCY piLatency; IVAS_PIDATA_ISM_EDIT_ID ismEditId; IVAS_PIDATA_ISM_EDIT_GAIN ismEditGain; IVAS_PIDATA_ISM_EDIT_ORIENTATION ismEditOrientation; -#ifdef REVERSE_ISM_PI_DATA IVAS_PIDATA_POSITION ismEditPosition; -#else - IVAS_PIDATA_ISM_EDIT_POSITION ismEditPosition; -#endif -#ifdef RTP_UPDATES_SA4_134 IVAS_PIDATA_POSITION ismEditPositionCompact; -#endif IVAS_PIDATA_ISM_EDIT_DIRECTION ismEditDirection; -#endif /* RTP_S4_251135_CR26253_0016_REV1 */ IVAS_PIDATA_NO_DATA noPiData; } PIDATA; @@ -552,6 +480,5 @@ typedef struct pidata_ts_struct uint32_t timestamp; } PIDATA_TS; -#endif /* IVAS_RTPDUMP */ #endif /* IVAS_RTP_PI_DATA_H */ diff --git a/lib_util/obj_edit_file_reader.c b/lib_util/obj_edit_file_reader.c index 44c100973..2d9a2fd6e 100644 --- a/lib_util/obj_edit_file_reader.c +++ b/lib_util/obj_edit_file_reader.c @@ -70,11 +70,7 @@ ivas_error ObjectEditFileReader_open( } self = (ObjectEditFileReader *) calloc( 1, sizeof( ObjectEditFileReader ) ); -#ifndef FIX_2192_OBJ_EDITING_EXT_METADATA - self->maxLineLen = 256; -#else self->maxLineLen = 1024; -#endif self->editFileHandle = fileHandle; self->inLine = (char *) calloc( self->maxLineLen, sizeof( char ) ); @@ -93,7 +89,6 @@ ivas_error ObjectEditFileReader_open( self->readInfo->obj_ele[obj_idx] = 0.0f; self->readInfo->obj_ele_edited[obj_idx] = false; self->readInfo->obj_ele_relative[obj_idx] = false; -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA self->readInfo->obj_radius[obj_idx] = 0.0f; self->readInfo->obj_radius_edited[obj_idx] = false; self->readInfo->obj_radius_relative[obj_idx] = false; @@ -103,7 +98,6 @@ ivas_error ObjectEditFileReader_open( self->readInfo->obj_pitch[obj_idx] = 0.0f; self->readInfo->obj_pitch_edited[obj_idx] = false; self->readInfo->obj_pitch_relative[obj_idx] = false; -#endif } self->rewound = false; @@ -150,14 +144,12 @@ ivas_error ObjectEditFileReader_readNextFrame( readEdits->obj_azi_relative[obj_idx] = false; readEdits->obj_ele_edited[obj_idx] = false; readEdits->obj_ele_relative[obj_idx] = false; -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA readEdits->obj_radius_edited[obj_idx] = false; readEdits->obj_radius_relative[obj_idx] = false; readEdits->obj_yaw_edited[obj_idx] = false; readEdits->obj_yaw_relative[obj_idx] = false; readEdits->obj_pitch_edited[obj_idx] = false; readEdits->obj_pitch_relative[obj_idx] = false; -#endif } /* tokenize the line by comma */ @@ -229,7 +221,6 @@ ivas_error ObjectEditFileReader_readNextFrame( { readEdits->obj_ele_relative[obj_idx] = ( strcmp( paramValue, "1" ) == 0 ); } -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA else if ( strcmp( param, "radius" ) == 0 ) { readEdits->obj_radius[obj_idx] = strtof( paramValue, NULL ); @@ -257,7 +248,6 @@ ivas_error ObjectEditFileReader_readNextFrame( { readEdits->obj_pitch_relative[obj_idx] = ( strcmp( paramValue, "1" ) == 0 ); } -#endif } } } @@ -281,7 +271,6 @@ ivas_error ObjectEditFileReader_readNextFrame( { readEdits->obj_ele[obj_idx] = max( min( readEdits->obj_ele[obj_idx], 90.f ), -90.f ); } -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA if ( readEdits->obj_radius_edited[obj_idx] && !readEdits->obj_radius_relative[obj_idx] ) { readEdits->obj_radius[obj_idx] = max( min( readEdits->obj_radius[obj_idx], OBJ_EDIT_RADIUS_MAX ), 0.0f ); @@ -294,7 +283,6 @@ ivas_error ObjectEditFileReader_readNextFrame( { readEdits->obj_pitch[obj_idx] = max( min( readEdits->obj_pitch[obj_idx], 90.f ), -90.f ); } -#endif } } else diff --git a/lib_util/obj_edit_file_reader.h b/lib_util/obj_edit_file_reader.h index eb8fe681c..016425c2e 100644 --- a/lib_util/obj_edit_file_reader.h +++ b/lib_util/obj_edit_file_reader.h @@ -41,23 +41,14 @@ the United Nations Convention on Contracts on the International Sales of Goods. * Constants ans structures *---------------------------------------------------------------------*/ -#ifdef FIX_GAIN_EDIT_LIMITS #define OBJ_EDIT_GAIN_MIN_FX 0 /* Q29, 0.0f, -inf dB */ #define OBJ_EDIT_GAIN_MAX_FX 2137321728 /* Q29, 3.9810719f, +12 dB */ #define OBJ_EDIT_GAIN_MIN 0.0f /* -inf dB */ #define OBJ_EDIT_GAIN_MAX 3.9810719f /* +12 dB */ -#else -#define OBJ_EDIT_GAIN_MIN_FX 33874262 /* Q29, 0.06309573f, -24 dB */ -#define OBJ_EDIT_GAIN_MAX_FX 2127207375 /* Q29, 3.9622325f, +12 dB, TODO: align with float */ -#define OBJ_EDIT_GAIN_MIN 0.06309573f /* -24 dB */ -#define OBJ_EDIT_GAIN_MAX 3.9622325f /* +12 dB */ -#endif - -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA + #define OBJ_EDIT_RADIUS_MAX 15.75f /* Max radius = (2^ISM_RADIUS_NBITS-1)*0.25 = 15.75 */ #define OBJ_EDIT_RADIUS_MAX_FX 8064 /* Q9, 15.75f (15.75 * 512 = 8064) */ #define OBJ_EDIT_RADIUS_MIN_FX 0 -#endif typedef struct ObjectEditFileReader ObjectEditFileReader; typedef struct ReadObjectEditInfo ReadObjectEditInfo; @@ -79,7 +70,6 @@ struct ReadObjectEditInfo bool obj_ele_edited[IVAS_MAX_NUM_OBJECTS]; bool obj_ele_relative[IVAS_MAX_NUM_OBJECTS]; -#ifdef FIX_2192_OBJ_EDITING_EXT_METADATA float obj_radius[IVAS_MAX_NUM_OBJECTS]; bool obj_radius_edited[IVAS_MAX_NUM_OBJECTS]; bool obj_radius_relative[IVAS_MAX_NUM_OBJECTS]; @@ -91,7 +81,6 @@ struct ReadObjectEditInfo float obj_pitch[IVAS_MAX_NUM_OBJECTS]; bool obj_pitch_edited[IVAS_MAX_NUM_OBJECTS]; bool obj_pitch_relative[IVAS_MAX_NUM_OBJECTS]; -#endif }; struct ObjectEditFileReader diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index c56ab9df9..111f8d978 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -38,9 +38,7 @@ #include #include "cmdl_tools.h" #include "prot_fx.h" -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT #include "ivas_cnst.h" -#endif /*------------------------------------------------------------------------------------------* * PreProc Local Macros @@ -1305,62 +1303,26 @@ ivas_error RenderConfigReader_checkValues( if ( pRoom_acoustics->use_er == 1 ) { /* Room dimensions */ -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->dimensions.x < ER_MIN_ROOM_DIMENSION ) - { - pRoom_acoustics->dimensions.x = ER_MIN_ROOM_DIMENSION; - } -#endif if ( pRoom_acoustics->dimensions.x_fx < ER_MIN_ROOM_DIMENSION_FX ) { pRoom_acoustics->dimensions.x_fx = ER_MIN_ROOM_DIMENSION_FX; } -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->dimensions.x > ER_MAX_ROOM_DIMENSION ) - { - pRoom_acoustics->dimensions.x = ER_MAX_ROOM_DIMENSION; - } -#endif if ( pRoom_acoustics->dimensions.x_fx > ER_MAX_ROOM_DIMENSION_FX ) { pRoom_acoustics->dimensions.x_fx = ER_MAX_ROOM_DIMENSION_FX; } -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->dimensions.y < ER_MIN_ROOM_DIMENSION ) - { - pRoom_acoustics->dimensions.y = ER_MIN_ROOM_DIMENSION; - } -#endif if ( pRoom_acoustics->dimensions.y_fx < ER_MIN_ROOM_DIMENSION_FX ) { pRoom_acoustics->dimensions.y_fx = ER_MIN_ROOM_DIMENSION_FX; } -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->dimensions.y > ER_MAX_ROOM_DIMENSION ) - { - pRoom_acoustics->dimensions.y = ER_MAX_ROOM_DIMENSION; - } -#endif if ( pRoom_acoustics->dimensions.y_fx > ER_MAX_ROOM_DIMENSION_FX ) { pRoom_acoustics->dimensions.y_fx = ER_MAX_ROOM_DIMENSION_FX; } -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->dimensions.z < ER_MIN_ROOM_DIMENSION ) - { - pRoom_acoustics->dimensions.z = ER_MIN_ROOM_DIMENSION; - } -#endif if ( pRoom_acoustics->dimensions.z_fx < ER_MIN_ROOM_DIMENSION_FX ) { pRoom_acoustics->dimensions.z_fx = ER_MIN_ROOM_DIMENSION_FX; } -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->dimensions.z > ER_MAX_ROOM_DIMENSION ) - { - pRoom_acoustics->dimensions.z = ER_MAX_ROOM_DIMENSION; - } -#endif if ( pRoom_acoustics->dimensions.z_fx > ER_MAX_ROOM_DIMENSION_FX ) { pRoom_acoustics->dimensions.z_fx = ER_MAX_ROOM_DIMENSION_FX; @@ -1369,22 +1331,10 @@ ivas_error RenderConfigReader_checkValues( /* Abs Coeff */ for ( wall_idx = 0; wall_idx < IVAS_ROOM_ABS_COEFF; wall_idx++ ) { -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->AbsCoeff[wall_idx] < ER_MIN_ABS_COEFF ) - { - pRoom_acoustics->AbsCoeff[wall_idx] = ER_MIN_ABS_COEFF; - } -#endif if ( pRoom_acoustics->AbsCoeff_fx[wall_idx] < ER_MIN_ABS_COEFF_FX ) { pRoom_acoustics->AbsCoeff_fx[wall_idx] = ER_MIN_ABS_COEFF_FX; } -#ifndef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT - if ( pRoom_acoustics->AbsCoeff[wall_idx] > ER_MAX_ABS_COEFF ) - { - pRoom_acoustics->AbsCoeff[wall_idx] = ER_MAX_ABS_COEFF; - } -#endif if ( pRoom_acoustics->AbsCoeff_fx[wall_idx] > ER_MAX_ABS_COEFF_FX ) { pRoom_acoustics->AbsCoeff_fx[wall_idx] = ER_MAX_ABS_COEFF_FX; @@ -2875,7 +2825,6 @@ ivas_error RenderConfigReader_read( return IVAS_ERR_OK; } -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /*------------------------------------------------------------------------------------------* * RenderConfigReader_getAcousticEnvironmentCount() * @@ -2973,7 +2922,6 @@ ivas_error RenderConfigReader_getAcousticEnvironments( return IVAS_ERR_OK; } -#endif /*------------------------------------------------------------------------------------------* * RenderConfigReader_getAcousticEnvironment() @@ -2996,11 +2944,7 @@ ivas_error RenderConfigReader_getAcousticEnvironment( } /* case when -aeid is not specified, select first ID from config file */ -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT if ( id == (UWord16) IVAS_DEFAULT_AEID && pRenderConfigReader->nAE > 0 ) -#else - if ( id == 65535 && pRenderConfigReader->nAE > 0 ) -#endif { id = (uint16_t) pRenderConfigReader->pAE[0].id; } diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index b3cdd3f11..420e17ad6 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -51,7 +51,6 @@ ivas_error RenderConfigReader_open( RenderConfigReader **ppRenderConfigReader /* o : RenderConfigReader handle */ ); -#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT /* Get number of acoustic environments */ uint32_t RenderConfigReader_getAcousticEnvironmentCount( RenderConfigReader *pRenderConfigReader /* i : RenderConfigReader handle */ @@ -62,7 +61,6 @@ ivas_error RenderConfigReader_getAcousticEnvironments( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ IVAS_ROOM_ACOUSTICS_CONFIG_DATA **ppAcEnv /* o : Acoustic environment array pointer */ ); -#endif /* Get an acoustic environment */ ivas_error RenderConfigReader_getAcousticEnvironment( diff --git a/lib_util/rtpdump.c b/lib_util/rtpdump.c index cd4928b79..0b818ee19 100644 --- a/lib_util/rtpdump.c +++ b/lib_util/rtpdump.c @@ -111,17 +111,10 @@ static int readShort( FILE *file, unsigned short *value ) static int writeLong( FILE *file, unsigned int value ) { char buffer[4] = { 0 }; -#ifdef IVAS_RTPDUMP buffer[3] = (char) ( value & 0xff ); buffer[2] = (char) ( ( value >> 8 ) & 0xff ); buffer[1] = (char) ( ( value >> 16 ) & 0xff ); buffer[0] = (char) ( ( value >> 24 ) & 0xff ); -#else - buffer[3] = value & 0xff; - buffer[2] = ( value >> 8 ) & 0xff; - buffer[1] = ( value >> 16 ) & 0xff; - buffer[0] = ( value >> 24 ) & 0xff; -#endif if ( fwrite( buffer, 4, 1, file ) != 1U ) { return -1; @@ -133,13 +126,8 @@ static int writeLong( FILE *file, unsigned int value ) static int writeShort( FILE *file, unsigned short value ) { char buffer[2] = { 0 }; -#ifdef IVAS_RTPDUMP buffer[1] = (char) ( value & 0xff ); buffer[0] = (char) ( ( value >> 8 ) & 0xff ); -#else - buffer[1] = value & 0xff; - buffer[0] = ( value >> 8 ) & 0xff; -#endif if ( fwrite( buffer, 2, 1, file ) != 1U ) { return -1; -- GitLab