diff --git a/apps/decoder.c b/apps/decoder.c index 7f94e19808d8b87dfc2df054745085d41609fbf8..6396e3ab9428cda787f84be83b18245ae52b1732 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -70,15 +70,8 @@ static #endif int32_t frame = 0; /* Counter of frames */ -#define MIN_NUM_BITS_ACTIVE_FRAME 56 -#ifdef REMOVE_SID_HARM_LEFTOVERS -#define NUM_BITS_SID_IVAS_5K2 104 -#else -#define NUM_BITS_SID_IVAS_4K4 88 -#define NUM_BITS_SID_IVAS_7K8 156 -#define NUM_BITS_SID_IVAS_9K3 186 -#define NUM_BITS_SID_IVAS_10K2 204 -#endif +#define MIN_NUM_BITS_ACTIVE_FRAME 56 +#define NUM_BITS_SID_IVAS_5K2 104 #define MAX_FRAME_SIZE ( 48000 / 50 ) #define MAX_NUM_OUTPUT_CHANNELS 16 #define MAX_OUTPUT_PCM_BUFFER_SIZE ( MAX_NUM_OUTPUT_CHANNELS * MAX_FRAME_SIZE ) @@ -353,11 +346,7 @@ int main( fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } -#ifdef REMOVE_SID_HARM_LEFTOVERS } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); -#else - } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_4K4 || num_bits == NUM_BITS_SID_IVAS_7K8 || num_bits == NUM_BITS_SID_IVAS_9K3 || num_bits == NUM_BITS_SID_IVAS_10K2 ); -#endif BS_Reader_Rewind( hBsReader ); diff --git a/apps/renderer.c b/apps/renderer.c index 9fb5337ed8c92ea22dbd501e824a9914a1d45b6a..8682232fa0f3a0f2b32e2bdce8ba83e31319da22 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -62,7 +62,6 @@ #include #include -#ifdef EXT_RENDERER #ifndef count_malloc #ifdef RAM_COUNTING_TOOL #define count_malloc( n1 ) MALLOC_FCT_CALL( n1 ) @@ -426,12 +425,8 @@ static int16_t getTotalNumInChannels( IVAS_REND_HANDLE hIvasRend, IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS], IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS], - IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] -#ifdef NOKIA_MASA_EXTERNAL_RENDERER - , - IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] -#endif -) + IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS], + IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] ) { int16_t totalNumInChannels = 0; int16_t i, numInputChannels; @@ -486,7 +481,6 @@ static int16_t getTotalNumInChannels( totalNumInChannels += numInputChannels; } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { if ( masaIds[i] == 0 ) @@ -502,7 +496,6 @@ static int16_t getTotalNumInChannels( } totalNumInChannels += numInputChannels; } -#endif return totalNumInChannels; } @@ -676,9 +669,7 @@ int main( IVAS_REND_InputId mcIds[RENDERER_MAX_MC_INPUTS] = { 0 }; IVAS_REND_InputId ismIds[RENDERER_MAX_ISM_INPUTS] = { 0 }; IVAS_REND_InputId sbaIds[RENDERER_MAX_SBA_INPUTS] = { 0 }; -#ifdef NOKIA_MASA_EXTERNAL_RENDERER IVAS_REND_InputId masaIds[RENDERER_MAX_MASA_INPUTS] = { 0 }; -#endif if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig ) ) != IVAS_ERR_OK ) { @@ -787,7 +778,6 @@ int main( } } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { if ( ( error = IVAS_REND_AddInput( hIvasRend, args.inConfig.masaBuses[i].audioConfig, &masaIds[i] ) ) != IVAS_ERR_OK ) @@ -802,13 +792,8 @@ int main( exit( -1 ); } } -#endif -#ifdef NOKIA_MASA_EXTERNAL_RENDERER const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds, masaIds ); -#else - const int16_t totalNumInChannels = getTotalNumInChannels( hIvasRend, mcIds, ismIds, sbaIds ); -#endif if ( AudioFileReader_getNumChannels( audioReader ) != 0 /* If input file is raw PCM, audio reader has no info about number of channels */ && totalNumInChannels != AudioFileReader_getNumChannels( audioReader ) ) @@ -905,18 +890,6 @@ int main( } #endif -#ifndef NOKIA_MASA_EXTERNAL_RENDERER - for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) - { - if ( masaReaders[i] != NULL ) - { - MasaFileReader_readNextFrame( masaReaders[i] ); - /* TODO: Feed MASA metadata here once MASA inputs are supported. - For now avoid unused var warning */ - (void) hMasaMetadata; - } - } -#endif ObjectPositionBuffer mtdBuffer; IsmPositionProvider_getNextFrame( positionProvider, &mtdBuffer ); @@ -982,7 +955,6 @@ int main( } } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < args.inConfig.numMasaBuses; ++i ) { if ( ( error = IVAS_REND_GetInputNumChannels( hIvasRend, masaIds[i], &numChannels ) ) != IVAS_ERR_OK ) @@ -1010,7 +982,6 @@ int main( } } } -#endif IVAS_REND_GetSamples( hIvasRend, outBuffer ); @@ -2476,14 +2447,3 @@ static void convertOutputBuffer( return; } -#else -int main( - int argc, - char **argv ) -{ - (void) argc; - (void) argv; - fprintf( stderr, "Enable EXT_RENDERER in options.h to use the external renderer.\n" ); - return 0; -} -#endif diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 0fd3e7c5525a940ceede0b9021bace861ce3ff7a..fa14ecff238815dfaa88f19ea690659ab7799c3c 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -43,13 +43,11 @@ * Common API constants *----------------------------------------------------------------------------------*/ -#define IVAS_MAX_BITS_PER_FRAME ( 512000 / 50 ) -#define IVAS_MAX_NUM_OBJECTS 4 -#define IVAS_MAX_OUTPUT_CHANNELS 16 -#define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 ) -#ifdef EXT_RENDERER +#define IVAS_MAX_BITS_PER_FRAME ( 512000 / 50 ) +#define IVAS_MAX_NUM_OBJECTS 4 +#define IVAS_MAX_OUTPUT_CHANNELS 16 +#define IVAS_CLDFB_NO_CHANNELS_MAX ( 60 ) #define IVAS_MAX_INPUT_LFE_CHANNELS 4 -#endif /*----------------------------------------------------------------------------------* * Common API structures @@ -79,11 +77,7 @@ typedef struct _IVAS_ISM_METADATA float gainFactor; } IVAS_ISM_METADATA; -#ifdef EXT_RENDERER typedef struct -#else -typedef struct _IVAS_QUATERNION -#endif { float w, x, y, z; diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index dddc100f5830588a579307aef67ea20c97cec3d4..4bcac1555e942ac298a10fc7035d3bae06fa0e40 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -50,11 +50,7 @@ *--------------------------------------------------------------------------*/ /*! r: delay value in ns */ -#ifdef FIX_GET_DELAY_RETURN int32_t get_delay( -#else -float get_delay( -#endif const int16_t enc_dec, /* i : encoder/decoder flag */ const int32_t io_fs, /* i : input/output sampling frequency */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ @@ -63,11 +59,7 @@ float get_delay( const int32_t binaural_latency_ns /* i : binaural renderer HRTF delay in ns */ ) { -#ifdef FIX_GET_DELAY_RETURN int32_t delay = 0; -#else - float delay = 0; -#endif if ( enc_dec == ENC ) { diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index c575be0ee3c46a51f4349702ab125e9ec381f90c..4a9ce1e080d9b8237362f931a8dbec26ee7cbcae 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -107,10 +107,8 @@ typedef enum AUDIO_CONFIG_ISM2, /* ISM2 */ AUDIO_CONFIG_ISM3, /* ISM3 */ AUDIO_CONFIG_ISM4, /* ISM4 */ -#ifdef EXT_RENDERER /* TODO tmu : temporary, or use something like IVAS_ENC input format */ AUDIO_CONFIG_MASA1, /* MASA1 */ AUDIO_CONFIG_MASA2, /* MASA2 */ -#endif AUDIO_CONFIG_EXTERNAL /* external renderer */ } AUDIO_CONFIG; @@ -193,10 +191,8 @@ typedef enum #define IVAS_MAX_SBA_ORDER 3 /* Maximum supported Ambisonics order */ -#ifdef EXT_RENDERER #define IVAS_LIMITER_THRESHOLD 32729 /* -0.01 dBFS */ #define IVAS_LIMITER_ATTACK_SECONDS 0.005f -#endif #define IVAS_NUM_SUPPORTED_FS 3 /* number of supported sampling-rates in IVAS */ /*----------------------------------------------------------------------------------* @@ -1374,21 +1370,15 @@ typedef enum #define BINAURAL_COHERENCE_DIFFERENCE_BINS 9 /* Number of bins for direction-dependent diffuse-field binaural coherence */ -#ifdef EXT_RENDERER #define HEADROT_ORDER 3 #define HEADROT_SHMAT_DIM ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) ) #define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM ) -#endif /*----------------------------------------------------------------------------------* * TD Binaural Object renderer *----------------------------------------------------------------------------------*/ -#ifdef EXT_RENDERER #define MAX_NUM_TDREND_CHANNELS 16 /* max. number of channels in TD renderer (objects or loudspeaker channels) */ -#else -#define MAX_NUM_TDREND_CHANNELS 11 /* max. number of channels in TD renderer (objects or loudspeaker channels) */ -#endif #define SFX_SPAT_BIN_MAX_NO_OF_OUTPUT_SAMPLES 288 /* 288 = 6 msec @ 48 kHz. */ #define HRTF_MODEL_N_SECTIONS 3 /* No. sections used in approximate evaluation of model */ diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index b7265987d59e2d97f43cba9cdc5ab308bce07869..afb71a727898deeda4428000eeae55dc69b146d0 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -372,11 +372,7 @@ ivas_error ivas_dirac_sba_config( else if ( sba_total_brate <= IVAS_24k4 ) { hQMetaData->bits_frame_nominal = ACELP_16k40 / FRAMES_PER_SEC; -#ifdef FIX_185_REDUCE_MD_BITS hQMetaData->metadata_max_bits = 103; -#else - hQMetaData->metadata_max_bits = 106; -#endif } else if ( sba_total_brate <= IVAS_32k ) { diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index c6b517b9a0ce241963dfd16138c93f7e8946d7a8..07458f6b388d78acf3330e1e1f552adbce2954a2 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -59,14 +59,8 @@ typedef enum IVAS_ERR_INVALID_CICP_INDEX, IVAS_ERR_INVALID_BITRATE, IVAS_ERR_INVALID_MASA_CONFIG, -#ifdef EXT_RENDERER IVAS_ERR_TOO_MANY_INPUTS, -#else - IVAS_ERR_TOO_MANY_OBJECT_INPUTS, -#endif -#ifdef NOKIA_MASA_EXTERNAL_RENDERER IVAS_ERR_MISSING_METADATA, -#endif IVAS_ERR_INDEX_OUT_OF_BOUNDS, IVAS_ERR_RECONFIGURE_NOT_SUPPORTED, IVAS_ERR_INVALID_FEC_CONFIG, @@ -89,9 +83,7 @@ typedef enum IVAS_ERR_NOT_IMPLEMENTED, IVAS_ERR_FILE_READER_TIMESTAMP_MISMATCH, IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT, -#ifdef FIX_ISM_METADATA_READER IVAS_ERR_ISM_INVALID_METADATA_VALUE, -#endif IVAS_ERR_INVALID_MASA_FORMAT_METADATA_FILE, #ifdef DEBUGGING IVAS_ERR_INVALID_FORCE_MODE, @@ -128,7 +120,6 @@ typedef enum IVAS_ERR_BITSTREAM_READER_INVALID_DATA, IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, -#ifdef EXT_RENDERER /*----------------------------------------* * renderer (lib_rend only) * *----------------------------------------*/ @@ -138,7 +129,6 @@ typedef enum IVAS_ERR_INVALID_INPUT_ID, IVAS_ERR_WRONG_NUM_CHANNELS, IVAS_ERR_INVALID_BUFFER_SIZE, -#endif /*----------------------------------------* * unknown error * @@ -172,7 +162,6 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Internal error"; case IVAS_ERR_INTERNAL_FATAL: return "Internal fatal error"; -#ifdef EXT_RENDERER case IVAS_ERR_INVALID_SAMPLING_RATE: return "Invalid sampling rate"; case IVAS_ERR_INVALID_OUTPUT_FORMAT: @@ -185,7 +174,6 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Wrong number of channels"; case IVAS_ERR_INVALID_BUFFER_SIZE: return "Invalid buffer size"; -#endif case IVAS_ERR_FAILED_FILE_OPEN: return "File open error"; case IVAS_ERR_FAILED_FILE_WRITE: diff --git a/lib_com/ivas_fb_mixer.c b/lib_com/ivas_fb_mixer.c index 8e60b4f841f16ac6950cd2cdf0d6f94a59481ca9..84bbdf09035a082a9e9884a0b0a120fc88c43d4c 100644 --- a/lib_com/ivas_fb_mixer.c +++ b/lib_com/ivas_fb_mixer.c @@ -192,21 +192,17 @@ ivas_error ivas_FB_mixer_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } -#ifdef FIX_126_MDFT_FB_STATIC_MEM if ( fb_cfg->num_out_chans > 0 ) { -#endif if ( ( hFbMixer->pFb = (ivas_filterbank_t *) count_malloc( sizeof( ivas_filterbank_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } -#ifdef FIX_126_MDFT_FB_STATIC_MEM } else { hFbMixer->pFb = NULL; } -#endif if ( fb_cfg->active_w_mixing == -1 ) { num_chs_alloc = 0; @@ -323,30 +319,9 @@ ivas_error ivas_FB_mixer_open( } else { -#ifndef FIX_126_MDFT_FB_STATIC_MEM - int16_t k; -#endif /* ignore all the deeper filter bank stuff for now */ hFbMixer->num_diff_bands = 0; -#ifndef FIX_126_MDFT_FB_STATIC_MEM - hFbMixer->pFb->fb_consts.pFilterbank_bins_per_band = NULL; - hFbMixer->pFb->fb_consts.pFilterbank_bins_start_offset = NULL; - - for ( i = 0; i < 2; i++ ) - { - for ( k = 0; k < IVAS_MAX_NUM_BANDS; k++ ) - { - hFbMixer->pFb->fb_consts.ppFilterbank_FRs[i][k] = NULL; - hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[i][k] = NULL; - } - } - - for ( i = 0; i < IVAS_MAX_NUM_FB_BANDS; i++ ) - { - hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[i] = NULL; - } -#endif } hFbMixer->fb_cfg = fb_cfg; @@ -1074,12 +1049,6 @@ static ivas_error ivas_filterbank_setup( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong FB in ivas_filterbank_setup()!" ); } } -#ifndef FIX_126_MDFT_FB_STATIC_MEM - else - { - hFbMixer->pFb->filterbank_num_bands = 0; - } -#endif hFbMixer->cross_fade_end_offset = pCfg->fade_len + pCfg->pcm_offset; hFbMixer->cross_fade_start_offset = hFbMixer->cross_fade_end_offset - pCfg->fade_len; diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 2d7ef742103c0ff6994b500c2a5711053e40c3ee..c09adab6c853ce43023646db9eaeb772962d67ea 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -205,9 +205,7 @@ ivas_error pre_proc_front_ivas( const int16_t front_vad_flag, /* i : front-VAD flag to overwrite VAD decision */ const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag /* i : front-VAD DTX flag to overwrite VAD decision*/ -#ifdef FIX_DTX_RANGE ,const int32_t ivas_total_brate /* i : IVAS total bitrate */ -#endif ); ivas_error pre_proc_ivas( @@ -3181,7 +3179,6 @@ ivas_error ivas_sba_get_hoa_dec_matrix( const int16_t ambisonics_order /* i : Ambisonics order */ ); -#ifdef EXT_RENDERER void ivas_sba_mtx_mult( float output_f[][L_FRAME48k], /* i/o: synthesized core-corder transport channels/DirAC output */ const int16_t output_frame, /* i : frame length per channel */ @@ -3189,7 +3186,6 @@ void ivas_sba_mtx_mult( const IVAS_OUTPUT_SETUP output_setup, /* i : Output configuration */ const float *mtx_hoa_decoder /* o : HOA decoding matrix */ ); -#endif /*----------------------------------------------------------------------------------* * DirAC prototypes @@ -4570,32 +4566,22 @@ void ivas_binaural_add_LFE( ); void QuatToRotMat( -#ifdef EXT_RENDERER const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ -#else - const Quaternion quat, /* i : quaternion describing the rotation */ -#endif float Rmat[3][3] /* o : real-space rotation matrix for this rotation */ ); void Quat2Euler( -#ifdef EXT_RENDERER const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ -#else - const Quaternion quat, /* i : quaternion describing the rotation */ -#endif float *yaw, /* o : yaw */ float *pitch, /* o : pitch */ float *roll /* o : roll */ ); -#ifdef EXT_RENDERER void SHrotmatgen( float SHrotmat[SBA_NHARM_HOA3][SBA_NHARM_HOA3], /* o : SHD rotation matrix */ float Rmat[3][3], /* i : real-space rotation matrix */ const int16_t order /* i : ambisonics order */ ); -#endif void rotateAziEle( float azi_in, /* i : output elevation */ @@ -4621,9 +4607,6 @@ ivas_error ivas_headTrack_open( void rotateFrame_shd( HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ float output[][L_FRAME48k], /* i/o: unrotated HOA3 signal buffer in TD */ -#ifndef EXT_RENDERER - const int32_t output_Fs, /* i : output sampling frequency */ -#endif const int16_t subframe_len, /* i : subframe length per channel */ const IVAS_OUTPUT_SETUP hTransSetup, /* i : format for rotation */ const int16_t subframe_idx /* i : subframe index */ @@ -4632,9 +4615,6 @@ void rotateFrame_shd( void rotateFrame_sd( HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ float output[][L_FRAME48k], /* i/o: unrotated SD signal buffer in TD */ -#ifndef EXT_RENDERER - const int32_t output_Fs, /* i : output sampling frequency */ -#endif const int16_t subframe_len, /* i : subframe length per channel */ const IVAS_OUTPUT_SETUP hTransSetup, /* i : format for rotation */ const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ @@ -4805,11 +4785,7 @@ ivas_error ivas_ls_custom_output_init( void ivas_ls_custom_setup( IVAS_OUTPUT_SETUP_HANDLE hOutSetup, /* o : IVAS output setup handle */ -#ifdef EXT_RENDERER const LSSETUP_CUSTOM_STRUCT *hLsSetupCustom /* i : Custom loudspeaker setup handle */ -#else - const LSSETUP_CUSTOM_HANDLE hLsSetupCustom /* i : Custom loudspeaker setup handle */ -#endif ); diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 2ec890b57d5e1ce3ed329f30c78e83f7b29d2bcb..79d29ea575361be5ef6f721c8ce1d02f6cbe14f9 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -315,9 +315,6 @@ typedef struct ivas_huff_coeffs_t /* AGC structures */ typedef struct ivas_agc_chan_data_t { -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - int16_t gainException; -#endif int16_t absGainExp; int16_t absGainExpCurr; diff --git a/lib_com/options.h b/lib_com/options.h index 9c71abfd9040c6a17014a88ea51a77c815e26266..9dc8ab44c80be8e4f09041ddd95648f28ab549dc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -145,35 +145,10 @@ /*#define ITD_WINNER_GAIN_MODIFY */ /* ITD optimization - WORK IN PROGRESS */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define FIX_I1_113 /* under review : MCT bit distribution optimization for SBA high bitrates*/ -#define PRINT_SBA_ORDER /* Issue 179: print-out also the SBA order of IVAS SBA format to stdout */ -#define EXT_RENDERER /* FhG: external renderer library and standalone application */ -#define NOKIA_MASA_EXTERNAL_RENDERER /* Nokia: MASA support for external renderer */ -#define FIX_EFAP_MATH /* fix for EFAP: remove angle quantization and a bug in polygon lookup causing incorrect gains. minor tweak for ALLRAD. non-BE for modes using EFAP */ #define FIX_124_DONT_ALLOC_PLCINFO_IN_IVAS /* Issue 124: do not allocate unused plc struct in IVAS modes which is only used in EVS mono */ -#define FIX_MCT_PLC_RECOVERY /* Issue 184: scale the old synthesis part correctly in the first good frame after lost frames in MCT modes - to be activated after previous switch is merged */ #define SBA_BR_SWITCHING /* Issue 114: Changes for sba bit rate switching*/ -#define FIX_AGC_WINFUNC_MEMORY /* Issue 62: lower agc_com.winFunc memory consumption */ #define FIX_ITD /* Contribution 16: TD renderer ITD improvement and code cleanup */ -#define REMOVE_SID_HARM_LEFTOVERS /* Issue 192: remove leftovers from the SID bitrate harmonization */ -#define FIX_MCT_UNINIT_MEM /* Issue 166: Reading of uninitialized memory in TCX range coder */ -#define FIX_IGF_NOISE_REPETITION /* Issue 182: fix repetition of same noise in IGF */ -#define FIX_126_MDFT_FB_STATIC_MEM /* Issue 126: reduce static mem consumption of the MDFT FB for non-SBA formats */ -#define FIX_I214_CLIPPING_STANDALONE_REND /* Issue 214: TD standalone renderer does not handle clipping */ -#define FIX_I218_PARAMISM_NOISY_SPEECH /* Issue 218: Fix noisy speech buffer in ParamISM */ -#define FIX_I217_GSC_FLAG_IN_ISM /* Issue 217: fix BER detected in ISM4 due to desynchronized 'GSC_IVAS_mode' parameter */ -#define FIX_158_DIRAC_MEM /* Issue 158: Reduce memory consumption in the hDirac_mem handle */ -#define BRATE_SWITCHING_FRAMEWORK /* Bitrate switching changes related to the general framework */ #define BRATE_SWITCHING_RENDERING /* Bitrate switching changes related to the renderers */ -#define FIX_185_REDUCE_MD_BITS /* Issue 185: Crash in SBA encoder for 24.4 kbps HOA3 input with longer testvector */ -#ifdef FIX_185_REDUCE_MD_BITS -#define CLEANUP_185_NO_AGC_EXCEPTION /* Issue 185: Cleanup AGC EXCEPTION code */ -#endif -#define FIX_I220_PARAMMC_CPROTO /* Issue 220: sanitizer error in the svd due to NaNs coming from negative energies in Cproto */ -#define FIX_221_BR_SWITCH_STEREO /* Issue 221: Fix missing initialization when switchin from TD to MDCT stereo*/ -#define FIX_DTX_RANGE /* Issue 118: fix the DTX usage: default DTX up to 64 kbps, otherwise only in silence */ -#define FIX_ISM_METADATA_READER /* Issue 211: make ISM metadata file reader robust against invalid files */ -#define FIX_GET_DELAY_RETURN /* Issue 223: change return data type in function get_delay() */ -#define NTT_REDUC_COMP_POC /* NTT Contribution 10: Complexity reduction of phase spectrum in stereo downmix*/ #define FIX_ISM_DECODER_PRINTOUT /* Issue 229: fix ISM decoder printout */ #define FIX_ITD_CNG /* Eri Contribution 11: Fix for CNG ITD */ #define FIX_VBR_COMPLEXITY /* Issue 234: fix extremely high complexity numbers for IVAS EVS mode */ diff --git a/lib_com/prot.h b/lib_com/prot.h old mode 100755 new mode 100644 index 0800ac92f512ca10e19a0c5837f7b4d9d1dbbda7..973f15ef5afca6255bdec249949ab9267e766ba3 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -712,11 +712,7 @@ int16_t lev_dur( ); /*! r: delay value in ns */ -#ifdef FIX_GET_DELAY_RETURN int32_t get_delay( -#else -float get_delay( -#endif const int16_t enc_dec, /* i : encoder/decoder flag */ const int32_t io_fs, /* i : input/output sampling frequency */ const IVAS_FORMAT ivas_format, /* i : IVAS format */ @@ -3897,12 +3893,10 @@ void td_cng_enc_init( ); void dtx( - Encoder_State *st, /* i/o: encoder state structure */ -#ifdef FIX_DTX_RANGE + Encoder_State *st, /* i/o: encoder state structure */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ -#endif - const int16_t vad, /* i : VAD flag for DTX */ - const float speech[] /* i : Pointer to the speech frame */ + const int16_t vad, /* i : VAD flag for DTX */ + const float speech[] /* i : Pointer to the speech frame */ ); void dtx_hangover_control( diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index 5b74ca0f6f4031481dee33aaa409d6b6eb362fe1..14865adc37edc04e9cd2a3617e7a69b23f948c09 100755 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -1309,7 +1309,6 @@ void decoder_tcx_noisefilling( IGFDecReplicateTCX10State( st->hIGFDec ); } -#ifdef FIX_IGF_NOISE_REPETITION if ( st->element_mode != EVS_MONO ) { if ( bfi ) @@ -1321,22 +1320,10 @@ void decoder_tcx_noisefilling( nf_seed = *st->hIGFDec->igfData.igfInfo.nfSeed; } } -#endif if ( st->igf ) { -#ifdef FIX_IGF_NOISE_REPETITION *st->hIGFDec->igfData.igfInfo.nfSeed = (int16_t) ( nf_seed * 31821L + 13849L ); -#else - if ( bfi && st->element_mode != EVS_MONO ) - { - *st->hIGFDec->igfData.igfInfo.nfSeed = (int16_t) ( st->seed_tcx_plc * 31821L + 13849L ); - } - else - { - *st->hIGFDec->igfData.igfInfo.nfSeed = (int16_t) ( nf_seed * 31821L + 13849L ); - } -#endif } return; diff --git a/lib_dec/ivas_agc_dec.c b/lib_dec/ivas_agc_dec.c index d9aa86d7cfe90e3c5feac06546b5f47251ef9825..827915efc2b9262c3326d094b2ee098937ee967f 100644 --- a/lib_dec/ivas_agc_dec.c +++ b/lib_dec/ivas_agc_dec.c @@ -78,9 +78,6 @@ static void ivas_agc_dec_init( /* gain_data */ ptr->absGainExp = hAgcDec->agc_com.absEmin; ptr->absGainExpCurr = hAgcDec->agc_com.absEmin; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - ptr->gainException = false; -#endif ptr++; } @@ -100,11 +97,7 @@ ivas_error ivas_spar_agc_dec_open( ) { ivas_agc_dec_state_t *hAgc; -#ifdef FIX_AGC_WINFUNC_MEMORY int16_t output_frame, delay; -#else - int16_t output_frame; -#endif if ( ( hAgc = (ivas_agc_dec_state_t *) count_malloc( sizeof( ivas_agc_dec_state_t ) ) ) == NULL ) { @@ -112,15 +105,9 @@ ivas_error ivas_spar_agc_dec_open( } output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); -#ifdef FIX_AGC_WINFUNC_MEMORY delay = NS2SA( output_Fs, ( IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ) ); -#endif -#ifdef FIX_AGC_WINFUNC_MEMORY if ( ( hAgc->agc_com.winFunc = (float *) count_malloc( sizeof( float ) * ( output_frame - delay ) ) ) == NULL ) -#else - if ( ( hAgc->agc_com.winFunc = (float *) count_malloc( sizeof( float ) * output_frame ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AGC decoder" ); } @@ -135,11 +122,7 @@ ivas_error ivas_spar_agc_dec_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AGC decoder" ); } -#ifdef FIX_AGC_WINFUNC_MEMORY ivas_agc_dec_init( hAgc, output_frame, delay ); -#else - ivas_agc_dec_init( hAgc, output_frame, NS2SA( output_Fs, ( IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ) ) ); -#endif *hAgcDec = hAgc; @@ -215,58 +198,32 @@ void ivas_agc_dec_process( pState->gain_state[i].lastGain = powf( pState->agc_com.winFunc[offset - 1], ( -1.f * (float) ( pState->gain_data[i].absGainExp - pState->agc_com.absEmin ) ) ); gainLast = 1.f / pState->gain_state[i].lastGain; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - if ( !pState->gain_data[i].gainException ) + if ( pState->gain_state[i].gainExpVal != 0 ) { -#endif - if ( pState->gain_state[i].gainExpVal != 0 ) + for ( idx = 0; idx < output_frame; idx++ ) { - for ( idx = 0; idx < output_frame; idx++ ) + if ( idx >= pState->agc_com.in_delay ) { - if ( idx >= pState->agc_com.in_delay ) - { - gain = powf( pState->agc_com.winFunc[idx - pState->agc_com.in_delay], (float) ( -1 * pState->gain_state[i].gainExpVal ) ) * gainLast; - } - else - { - gain = gainLast; - } - - pcm_out[i][idx] = pcm_in[i][idx] * gain; + gain = powf( pState->agc_com.winFunc[idx - pState->agc_com.in_delay], (float) ( -1 * pState->gain_state[i].gainExpVal ) ) * gainLast; } - - pState->gain_state[i].lastGain *= powf( pState->agc_com.winFunc[offset - 1], (float) pState->gain_state[i].gainExpVal ); - } - else - { - gain = gainLast; - for ( idx = 0; idx < output_frame; idx++ ) + else { - pcm_out[i][idx] = pcm_in[i][idx] * gain; + gain = gainLast; } + + pcm_out[i][idx] = pcm_in[i][idx] * gain; } -#ifndef CLEANUP_185_NO_AGC_EXCEPTION + + pState->gain_state[i].lastGain *= powf( pState->agc_com.winFunc[offset - 1], (float) pState->gain_state[i].gainExpVal ); } else { - float gainCurr = powf( pState->agc_com.winFunc[offset - 1], ( -1.f * (float) pState->gain_state[i].gainExpVal ) ); - float gainTot = gainCurr * gainLast; - + gain = gainLast; for ( idx = 0; idx < output_frame; idx++ ) { - if ( idx >= pState->agc_com.in_delay ) - { - gain = gainTot; - } - else - { - gain = gainLast; - } pcm_out[i][idx] = pcm_in[i][idx] * gain; } - pState->gain_state[i].lastGain /= gainCurr; } -#endif pState->gain_data[i].absGainExp = pState->gain_data[i].absGainExpCurr; } @@ -314,20 +271,10 @@ void ivas_agc_read_bits( if ( per_ch_bit[i] == 1 ) { pState->gain_data[i].absGainExpCurr = get_next_indice( st0, (int16_t) pState->agc_com.betaE ); -#ifdef FIX_185_REDUCE_MD_BITS -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - pState->gain_data[i].gainException = false; -#endif -#else - pState->gain_data[i].gainException = get_next_indice( st0, 1 ); -#endif } else { pState->gain_data[i].absGainExpCurr = (int32_t) pState->agc_com.absEmin; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - pState->gain_data[i].gainException = false; -#endif } } } @@ -336,9 +283,6 @@ void ivas_agc_read_bits( for ( i = 0; i < n_channels; i++ ) { pState->gain_data[i].absGainExpCurr = (int32_t) pState->agc_com.absEmin; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - pState->gain_data[i].gainException = false; -#endif } } @@ -349,10 +293,6 @@ void ivas_agc_read_bits( { fread( &( pState->gain_data[i].absGainExpCurr ), sizeof( int32_t ), 1, stream ); /* n bits */ num_bits += pState->agc_com.betaE; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - fread( &( pState->gain_data[i].gainException ), sizeof( int16_t ), 1, stream ); /* 1 bit */ - num_bits++; -#endif num_dmx_bits[i]++; /*fprintf(stdout, "AbsGain[%d]:= %d[%d bits]; ", i, pState->gain_data[i].absGainExp, pState->betaE);*/ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 1d98e39e2b2b3651d02b792bfeb93bcc91d47004..d356a7e093fe8561f76ceb8507f170ae70c046e9 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -182,11 +182,7 @@ ivas_error ivas_core_dec( } #ifdef FIX_124_DONT_ALLOC_PLCINFO_IN_IVAS -#ifdef FIX_MCT_PLC_RECOVERY if ( !st->bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hTcxDec != NULL ) -#else - if ( !st->bfi && st->prev_bfi && ( st->last_core_bfi == TCX_20_CORE || st->last_core_bfi == TCX_10_CORE ) && st->hTcxDec != NULL && hMCT == NULL ) -#endif { float gain; diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 5f9e908481d3aec147024820d2126d476ef364cf..f2273de26d20bc8dd327c9aaef8161ecc8a67a10 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -49,11 +49,7 @@ /*-----------------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------------*/ -#ifdef FIX_158_DIRAC_MEM static void ivas_dirac_alloc_mem( DIRAC_DEC_HANDLE hDirAC, const RENDERER_TYPE renderer_type, DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem ); -#else -static void ivas_dirac_alloc_mem( DIRAC_DEC_HANDLE hDirAC, DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem ); -#endif static void ivas_dirac_free_mem( DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem ); @@ -262,9 +258,7 @@ ivas_error ivas_dirac_dec_config( * set input parameters *-----------------------------------------------------------------*/ -#ifdef BRATE_SWITCHING_FRAMEWORK st_ivas->nchan_transport = nchan_transport_orig; -#endif if ( flag_config == DIRAC_OPEN ) { @@ -280,9 +274,6 @@ ivas_error ivas_dirac_dec_config( return IVAS_ERR_OK; } -#ifndef BRATE_SWITCHING_FRAMEWORK - st_ivas->nchan_transport = nchan_transport_orig; -#endif if ( nchan_transport_orig > 2 && hDirAC->hOutSetup.is_loudspeaker_setup && st_ivas->renderer_type == RENDERER_DIRAC ) { hDirAC->synthesisConf = DIRAC_SYNTHESIS_PSD_LS; @@ -723,12 +714,10 @@ ivas_error ivas_dirac_dec_config( } -#ifdef FIX_158_DIRAC_MEM if ( flag_config == DIRAC_OPEN ) { hDirAC->buffer_energy = NULL; } -#endif if ( ( flag_config == DIRAC_OPEN && hDirAC->hConfig->dec_param_estim == TRUE ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->hConfig->dec_param_estim == TRUE && dec_param_estim_old == FALSE ) ) ) { hDirAC->index_buffer_intensity = 0; @@ -741,12 +730,10 @@ ivas_error ivas_dirac_dec_config( set_f( hDirAC->buffer_intensity_real[i][j], 0.0f, CLDFB_NO_CHANNELS_MAX ); } } -#ifdef FIX_158_DIRAC_MEM if ( hDirAC->buffer_energy == NULL ) { hDirAC->buffer_energy = (float *) count_malloc( DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); } -#endif set_f( hDirAC->buffer_energy, 0.0f, DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX ); } else if ( ( flag_config == DIRAC_OPEN && hDirAC->hConfig->dec_param_estim == FALSE ) || ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->hConfig->dec_param_estim == FALSE && dec_param_estim_old == TRUE ) ) ) @@ -762,13 +749,11 @@ ivas_error ivas_dirac_dec_config( hDirAC->buffer_intensity_real[i][j] = NULL; } } -#ifdef FIX_158_DIRAC_MEM if ( hDirAC->buffer_energy != NULL ) { count_free( hDirAC->buffer_energy ); hDirAC->buffer_energy = NULL; } -#endif } /* output synthesis */ @@ -779,11 +764,7 @@ ivas_error ivas_dirac_dec_config( { ivas_dirac_free_mem( &( hDirAC->stack_mem ) ); } -#ifdef FIX_158_DIRAC_MEM ivas_dirac_alloc_mem( hDirAC, st_ivas->renderer_type, &( hDirAC->stack_mem ) ); -#else - ivas_dirac_alloc_mem( hDirAC, &( hDirAC->stack_mem ) ); -#endif mvs2s( DirAC_block_grouping, hDirAC->block_grouping, MAX_PARAM_SPATIAL_SUBFRAMES + 1 ); @@ -877,9 +858,6 @@ ivas_error ivas_dirac_dec_config( st_ivas->hDirAC = hDirAC; } -#ifndef BRATE_SWITCHING_FRAMEWORK - st_ivas->nchan_transport = nchan_transport_orig; -#endif return error; } @@ -967,13 +945,11 @@ void ivas_dirac_dec_close( } } } -#ifdef FIX_158_DIRAC_MEM if ( hDirAC->buffer_energy != NULL ) { count_free( hDirAC->buffer_energy ); hDirAC->buffer_energy = NULL; } -#endif for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) { @@ -1130,9 +1106,7 @@ void ivas_dirac_dec_close( static void ivas_dirac_alloc_mem( DIRAC_DEC_HANDLE hDirAC, -#ifdef FIX_158_DIRAC_MEM const RENDERER_TYPE renderer_type, -#endif DIRAC_DEC_STACK_MEM_HANDLE hDirAC_mem ) { int16_t num_freq_bands, num_freq_bands_diff, size; @@ -1165,14 +1139,10 @@ static void ivas_dirac_alloc_mem( set_zero( hDirAC_mem->proto_power_diff_smooth, size ); hDirAC_mem->direct_responses_square = (float *) malloc( sizeof( float ) * size ); set_zero( hDirAC_mem->direct_responses_square, size ); -#ifdef FIX_158_DIRAC_MEM if ( hDirAC->proto_signal_decorr_on && ( renderer_type != RENDERER_BINAURAL_PARAMETRIC && renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && renderer_type != RENDERER_STEREO_PARAMETRIC ) ) { -#endif hDirAC_mem->frame_dec_f = (float *) malloc( sizeof( float ) * 2 * num_outputs_diff * num_freq_bands ); -#ifdef FIX_158_DIRAC_MEM } -#endif } hDirAC->h_output_synthesis_psd_state.proto_power_smooth = hDirAC_mem->proto_power_smooth; hDirAC->h_output_synthesis_psd_state.proto_power_diff_smooth = hDirAC_mem->proto_power_diff_smooth; @@ -1201,17 +1171,13 @@ static void ivas_dirac_alloc_mem( hDirAC->h_output_synthesis_psd_state.direct_responses = hDirAC_mem->direct_responses; /* Prototypes */ -#ifdef FIX_158_DIRAC_MEM hDirAC_mem->proto_direct_buffer_f = NULL; hDirAC_mem->proto_diffuse_buffer_f = NULL; if ( renderer_type != RENDERER_BINAURAL_PARAMETRIC && renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && renderer_type != RENDERER_STEREO_PARAMETRIC ) { -#endif hDirAC_mem->proto_direct_buffer_f = (float *) malloc( sizeof( float ) * 2 * MAX_PARAM_SPATIAL_SUBFRAMES * num_protos_dir * num_freq_bands ); -#ifdef FIX_158_DIRAC_MEM if ( hDirAC->proto_signal_decorr_on ) { -#endif if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD ) { hDirAC_mem->proto_diffuse_buffer_f = (float *) malloc( sizeof( float ) * 2 * MAX_PARAM_SPATIAL_SUBFRAMES * size ); @@ -1220,25 +1186,19 @@ static void ivas_dirac_alloc_mem( { hDirAC_mem->proto_diffuse_buffer_f = (float *) malloc( sizeof( float ) * 2 * MAX_PARAM_SPATIAL_SUBFRAMES * num_outputs_diff * num_freq_bands ); } -#ifdef FIX_158_DIRAC_MEM } } -#endif hDirAC->h_output_synthesis_psd_state.proto_direct_buffer_f = hDirAC_mem->proto_direct_buffer_f; hDirAC->h_output_synthesis_psd_state.proto_diffuse_buffer_f = hDirAC_mem->proto_diffuse_buffer_f; /* Gains/power factors*/ -#ifdef FIX_158_DIRAC_MEM hDirAC_mem->direct_power_factor = NULL; hDirAC_mem->diffuse_power_factor = NULL; if ( renderer_type != RENDERER_BINAURAL_PARAMETRIC && renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && renderer_type != RENDERER_STEREO_PARAMETRIC ) { -#endif hDirAC_mem->direct_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ); hDirAC_mem->diffuse_power_factor = (float *) malloc( sizeof( float ) * num_freq_bands ); -#ifdef FIX_158_DIRAC_MEM } -#endif hDirAC->h_output_synthesis_psd_state.direct_power_factor = hDirAC_mem->direct_power_factor; hDirAC->h_output_synthesis_psd_state.diffuse_power_factor = hDirAC_mem->diffuse_power_factor; @@ -1246,20 +1206,14 @@ static void ivas_dirac_alloc_mem( hDirAC_mem->onset_filter = NULL; if ( hDirAC->synthesisConf != DIRAC_SYNTHESIS_GAIN_SHD ) { -#ifdef FIX_158_DIRAC_MEM if ( renderer_type != RENDERER_BINAURAL_PARAMETRIC && renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && renderer_type != RENDERER_STEREO_PARAMETRIC ) { -#endif hDirAC_mem->reference_power = (float *) malloc( sizeof( float ) * 2 * num_freq_bands ); -#ifdef FIX_158_DIRAC_MEM if ( hDirAC->proto_signal_decorr_on ) { -#endif hDirAC_mem->onset_filter = (float *) malloc( sizeof( float ) * num_outputs_diff * num_freq_bands ); -#ifdef FIX_158_DIRAC_MEM } } -#endif } else { @@ -1267,20 +1221,10 @@ static void ivas_dirac_alloc_mem( { hDirAC_mem->reference_power = (float *) malloc( sizeof( float ) * 5 * num_freq_bands ); } -#ifndef FIX_158_DIRAC_MEM - else - { - hDirAC_mem->reference_power = (float *) malloc( sizeof( float ) * num_freq_bands ); - } -#endif -#ifdef FIX_158_DIRAC_MEM if ( hDirAC->proto_signal_decorr_on ) { -#endif hDirAC_mem->onset_filter = (float *) malloc( sizeof( float ) * 2 * num_freq_bands ); -#ifdef FIX_158_DIRAC_MEM } -#endif } return; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 90dee220315ec1007285d97e5512e9b0d40e99e7..7557fed2140808452f4d97adc501d981ab833770 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1564,7 +1564,6 @@ static void ivas_param_mc_get_mixing_matrices( matrix_product( mat_mult_buffer1, nY_intern, nX, 0, hParamMC->proto_matrix_int, nY_intern, nX, 1, Cproto ); -#ifdef FIX_I220_PARAMMC_CPROTO for ( ch_idx1 = 0; ch_idx1 < nY_intern; ch_idx1++ ) { if ( Cproto[ch_idx1 + ch_idx1 * nY_intern] < 0.0f ) @@ -1572,7 +1571,6 @@ static void ivas_param_mc_get_mixing_matrices( Cproto[ch_idx1 + ch_idx1 * nY_intern] = 0.0f; } } -#endif ivas_param_mc_dequantize_cov( hParamMC, hParamMC->icld_q + param_band_idx * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe, @@ -1614,7 +1612,6 @@ static void ivas_param_mc_get_mixing_matrices( matrix_product_diag( mat_mult_buffer1, nY_band, nX, 0, proto_matrix_ptr, nY_band, nX, 1, Cproto_diag ); -#ifdef FIX_I220_PARAMMC_CPROTO /* make sure we have no negative entries in Cproto_diag due to rounding errors */ for ( ch_idx1 = 0; ch_idx1 < nY_band; ch_idx1++ ) { @@ -1623,7 +1620,6 @@ static void ivas_param_mc_get_mixing_matrices( Cproto_diag[ch_idx1] = 0.0f; } } -#endif /* Computing the mixing matrices */ diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 552435db66825cee3a7bc2a32a047be70428d7a3..a18f826921eac23410fd0d534d1f8ff80af15721 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -40,9 +40,7 @@ #include "ivas_cnst.h" #include "ivas_stat_com.h" #include "ivas_stat_rend.h" -#ifdef EXT_RENDERER #include "common_api_types.h" // VE2AT: don't we want to avoid this include in the library? I admit that the rules hefre are not 100% clear to me but introducing it just for IVAS_QUATERNION is not necessry I think -#endif /*----------------------------------------------------------------------------------* @@ -675,11 +673,7 @@ typedef struct ivas_dirac_dec_data_structure /*Parameter estimation*/ int16_t index_buffer_intensity; float *buffer_intensity_real[DIRAC_NUM_DIMS][DIRAC_NO_COL_AVG_DIFF]; -#ifdef FIX_158_DIRAC_MEM float *buffer_energy; -#else - float buffer_energy[DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX]; -#endif /*Decoder parameters */ /*Prototypes*/ @@ -1308,23 +1302,11 @@ typedef struct ivas_binaural_rendering_struct * Head tracking data structure *----------------------------------------------------------------------------------*/ // VE2AT: move to ivas_rom_rend.h ? -#ifndef EXT_RENDERER -/* Quaternion type for head orientation */ -typedef struct Quaternion_struct -{ - float w, x, y, z; - -} Quaternion; -#endif typedef struct ivas_binaural_head_track_struct { int16_t num_quaternions; -#ifdef EXT_RENDERER IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - Quaternion Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES]; -#endif float Rmat[3][3]; float Rmat_prev[3][3]; diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 83eb0c23e4cc3ea5c1add4b70020326b662bf126..56c1cfef5428aab7cd7b09857e367bd7a3f88e4a 100644 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -1469,24 +1469,11 @@ void stereo_switching_dec( { sts[1]->last_core = sts[0]->last_core; sts[1]->last_coder_type = sts[0]->last_coder_type; -#ifndef FIX_221_BR_SWITCH_STEREO - sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo; - sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode; -#endif mvr2r( sts[0]->hHQ_core->old_out, sts[1]->hHQ_core->old_out, L_FRAME48k ); mvr2r( sts[0]->delay_buf_out, sts[1]->delay_buf_out, HQ_DELTA_MAX * HQ_DELAY_COMP ); mvr2r( sts[0]->hTcxDec->old_syn_Overl, sts[1]->hTcxDec->old_syn_Overl, 256 ); /* Todo: apply panning to buffers instead of simply using dmx in left and right channel */ - -#ifndef FIX_221_BR_SWITCH_STEREO - sts[1]->fscale = sts[0]->fscale; - sts[1]->hTcxCfg->tcx_mdct_window_length = sts[0]->hTcxCfg->tcx_mdct_window_length; - sts[1]->pit_res_max = sts[0]->pit_res_max; - sts[1]->pit_res_max_past = sts[0]->pit_res_max_past; - sts[1]->hTcxDec->L_frameTCX = sts[0]->hTcxDec->L_frameTCX; - sts[1]->hTcxDec->conceal_eof_gain = sts[0]->hTcxDec->conceal_eof_gain; -#endif } } else if ( hCPE->element_mode == IVAS_CPE_TD && hCPE->last_element_mode == IVAS_CPE_MDCT ) @@ -1495,7 +1482,6 @@ void stereo_switching_dec( set_f( sts[1]->old_exc, 0.0f, L_EXC_MEM_DEC ); } -#ifdef FIX_221_BR_SWITCH_STEREO /* TD/DFT -> MDCT stereo switching (there is no TCX in the TD stereo secondary channel, or DFT stereo) */ if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->last_element_mode != IVAS_CPE_MDCT ) { @@ -1508,7 +1494,6 @@ void stereo_switching_dec( sts[1]->hTcxDec->L_frameTCX = sts[0]->hTcxDec->L_frameTCX; sts[1]->hTcxDec->conceal_eof_gain = sts[0]->hTcxDec->conceal_eof_gain; } -#endif return; } diff --git a/lib_dec/ivas_td_low_rate_dec.c b/lib_dec/ivas_td_low_rate_dec.c index 0e1c34db1db6cc14ed6801c9590fbf06bb547095..e610fcf0f38ec7aacd4788436b5fe75371d56c17 100644 --- a/lib_dec/ivas_td_low_rate_dec.c +++ b/lib_dec/ivas_td_low_rate_dec.c @@ -77,9 +77,7 @@ void tdm_low_rate_dec( nb_subfr = 2; -#ifdef FIX_I217_GSC_FLAG_IN_ISM st->GSC_IVAS_mode = 0; -#endif st->GSC_noisy_speech = 1; hGSCDec->noise_lev = 14; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 70e038483962294e2e4bdb89e4c62609d965e2ad..d45527b740d6a8faa80fddabf11d9d5688203bea 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1055,11 +1055,7 @@ ivas_error IVAS_DEC_GetDelay( st_ivas = hIvasDec->st_ivas; hDecoderConfig = st_ivas->hDecoderConfig; -#ifdef FIX_GET_DELAY_RETURN *nSamples = NS2SA( hDecoderConfig->output_Fs, get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->renderer_type, st_ivas->binaural_latency_ns ) ); -#else - *nSamples = NS2SA( hDecoderConfig->output_Fs, (int32_t) ( get_delay( DEC, hDecoderConfig->output_Fs, st_ivas->ivas_format, st_ivas->cldfbAnaDec[0], st_ivas->renderer_type, st_ivas->binaural_latency_ns ) + 0.5f ) ); -#endif *timeScale = hDecoderConfig->output_Fs; @@ -1770,11 +1766,7 @@ static ivas_error printConfigInfo_dec( } else if ( st_ivas->ivas_format == SBA_FORMAT ) { -#ifdef PRINT_SBA_ORDER fprintf( stdout, "Input configuration: Scene Based Audio, Ambisonic order %i%s, %d transport channel(s)\n", st_ivas->sba_order, st_ivas->sba_planar ? " (Planar)" : "", st_ivas->nchan_transport ); -#else - fprintf( stdout, "Input configuration: SBA - %d transport channel(s) %s\n", st_ivas->nchan_transport, st_ivas->sba_planar ? "(Planar)" : "" ); -#endif } else if ( st_ivas->ivas_format == MASA_FORMAT ) { diff --git a/lib_enc/amr_wb_enc.c b/lib_enc/amr_wb_enc.c index 68903a62da459ea0108a8ffb10960efeacec335c..c73e5a89497070d4515a4f12dc70288fc96bb842 100644 --- a/lib_enc/amr_wb_enc.c +++ b/lib_enc/amr_wb_enc.c @@ -316,11 +316,7 @@ void amr_wb_enc( st->fd_cng_reset_flag = 0; } -#ifdef FIX_DTX_RANGE dtx( st, -1, vad_flag_dtx, inp ); -#else - dtx( st, vad_flag_dtx, inp ); -#endif /*----------------------------------------------------------------* * Noise energy down-ward update and total noise energy estimation diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 1e80dfaf0655a805067063bc27af54185c006e2d..4d05245dbaa316da99e22809328701f0d7ad467a 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -63,10 +63,8 @@ #define LTE_VAR -4.0f -#ifdef FIX_DTX_RANGE #define MAX_BRATE_DTX_EVS ACELP_24k40 /* maximum bitrate to which the default DTX is applied in EVS; otherwise DTX is applied only in silence */ #define MAX_BRATE_DTX_IVAS IVAS_64k /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */ -#endif /*-------------------------------------------------------------------* * Local function prototypes @@ -81,12 +79,10 @@ static void update_SID_cnt( DTX_ENC_HANDLE hDtxEnc, const int32_t core_brate, co *-------------------------------------------------------------------*/ void dtx( - Encoder_State *st, /* i/o: encoder state structure */ -#ifdef FIX_DTX_RANGE + Encoder_State *st, /* i/o: encoder state structure */ const int32_t ivas_total_brate, /* i : IVAS total bitrate */ -#endif - const int16_t vad, /* i : VAD flag for DTX */ - const float speech[] /* i : Pointer to the speech frame */ + const int16_t vad, /* i : VAD flag for DTX */ + const float speech[] /* i : Pointer to the speech frame */ ) { float alpha; @@ -103,15 +99,9 @@ void dtx( } else { -#ifdef FIX_DTX_RANGE last_br_cng_flag = st->last_total_brate_cng <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate_cng <= MAX_BRATE_DTX_IVAS ); last_br_flag = st->last_total_brate <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate <= MAX_BRATE_DTX_IVAS ); -#else - last_br_cng_flag = st->last_total_brate_cng <= ACELP_24k40 || st->lp_noise < 15 || ( ( st->element_mode == IVAS_SCE ) && st->last_total_brate_cng <= ACELP_32k ); - - last_br_flag = st->last_total_brate <= ACELP_24k40 || st->lp_noise < 15 || ( ( st->element_mode == IVAS_SCE ) && st->last_total_brate <= ACELP_32k ); -#endif br_dtx_flag = 0; } @@ -187,14 +177,9 @@ void dtx( if ( st->dtx_sce_sba == 0 ) { -#ifdef FIX_DTX_RANGE br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) || ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || st->lp_noise < 15; -#else - br_dtx_flag = st->total_brate <= ACELP_24k40 || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->total_brate <= ACELP_32k ) || - st->element_mode == IVAS_CPE_DFT || ( st->element_mode == IVAS_CPE_MDCT && ( st->element_brate <= IVAS_64k || st->lp_noise < 15 ) ); -#endif } if ( st->Opt_DTX_ON && vad == 0 && @@ -254,11 +239,7 @@ void dtx( } else { -#ifdef FIX_DTX_RANGE if ( ( st->cng_type == FD_CNG && ( st->total_brate <= MAX_BRATE_DTX_EVS || ( st->element_mode == IVAS_SCE && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) ) ) || ( st->element_mode == IVAS_CPE_MDCT ) ) /* at highest bitrates, use exclusively LP_CNG */ -#else - if ( ( st->cng_type == FD_CNG && ( st->total_brate <= ACELP_24k40 || ( st->element_mode == IVAS_SCE && st->total_brate <= ACELP_32k ) ) ) || ( st->element_mode == IVAS_CPE_MDCT ) ) /* at highest bitrates, use exclusively LP_CNG */ -#endif { if ( st->element_mode == EVS_MONO && ( st->total_brate == ACELP_9k60 || st->total_brate == ACELP_16k40 || st->total_brate == ACELP_24k40 ) ) { diff --git a/lib_enc/ivas_agc_enc.c b/lib_enc/ivas_agc_enc.c index 3219807050d6c0a300c8ab014ac099bb72693439..d8d0f1f772761740e7c8077ffbd420b7cfe1c04e 100644 --- a/lib_enc/ivas_agc_enc.c +++ b/lib_enc/ivas_agc_enc.c @@ -130,9 +130,6 @@ static void ivas_agc_enc_init( /* gain_data */ ptr->absGainExp = hAgcEnc->agc_com.absEmin; ptr->absGainExpCurr = hAgcEnc->agc_com.absEmin; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - ptr->gainException = FALSE; -#endif ptr++; } @@ -153,11 +150,7 @@ ivas_error ivas_spar_agc_enc_open( ) { ivas_agc_enc_state_t *hAgc; -#ifdef FIX_AGC_WINFUNC_MEMORY int16_t input_frame, delay; -#else - int16_t input_frame; -#endif if ( ( hAgc = (ivas_agc_enc_state_t *) count_malloc( sizeof( ivas_agc_enc_state_t ) ) ) == NULL ) { @@ -165,15 +158,9 @@ ivas_error ivas_spar_agc_enc_open( } input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); -#ifdef FIX_AGC_WINFUNC_MEMORY delay = NS2SA( input_Fs, ( IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ) ); -#endif -#ifdef FIX_AGC_WINFUNC_MEMORY if ( ( hAgc->agc_com.winFunc = (float *) count_malloc( sizeof( float ) * ( input_frame - delay ) ) ) == NULL ) -#else - if ( ( hAgc->agc_com.winFunc = (float *) count_malloc( sizeof( float ) * input_frame ) ) == NULL ) -#endif { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR AGC encoder" ); } @@ -188,11 +175,7 @@ ivas_error ivas_spar_agc_enc_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR AGC encoder" ); } -#ifdef FIX_AGC_WINFUNC_MEMORY ivas_agc_enc_init( hAgc, input_frame, nchan_inp, delay ); -#else - ivas_agc_enc_init( hAgc, input_frame, nchan_inp, NS2SA( input_Fs, ( IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ) ) ); -#endif *hAgcEnc = hAgc; @@ -304,9 +287,6 @@ void ivas_agc_enc_process( isGainAdjusted = FALSE; if ( !isClipped ) { -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - pState->gain_data[i].gainException = FALSE; -#endif if ( pState->gain_state[i].lastExp == AGC_EMAX || MaxAbsVal < FLT_MIN ) { @@ -340,26 +320,15 @@ void ivas_agc_enc_process( if ( !isGainAdjusted ) { float actualMaxAbsVal = 0.f; - int16_t currMaxAttExp -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - , - gainExpValMaxRange -#endif - ; + int16_t currMaxAttExp; currMaxAttExp = min( ( pState->gain_state[i].lastExp + pState->agc_com.absEmin ), pState->agc_com.maxAttExp ); -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - gainExpValMaxRange = min( ( pState->gain_state[i].lastExp + pState->agc_com.absEmin ), pState->agc_com.maxAttExp + 1 ); -#endif extendedExpVal = FALSE; if ( isClipped ) { int16_t isCompensated = FALSE; actualMaxAbsVal = pState->gain_state[i].lastMaxAbs * pState->gain_state[i].lastGain; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - pState->gain_data[i].gainException = FALSE; -#endif pState->gain_state[i].gainExpVal = (int16_t) ceilf( -logf( actualMaxAbsVal * MDFT_NORM_SCALING ) / logf( pState->agc_com.winFunc[min( offset - 1, MaxAbsValIdx )] ) ); while ( !isCompensated ) @@ -396,71 +365,29 @@ void ivas_agc_enc_process( pState->gain_state[i].gainExpVal = min( pState->gain_state[i].gainExpVal, currMaxAttExp ); break; } - -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - if ( pState->gain_state[i].gainExpVal > currMaxAttExp ) - { - pState->gain_data[i].gainException = TRUE; - - if ( pState->gain_state[i].gainExpVal == gainExpValMaxRange ) - { - extendedExpVal = TRUE; - if ( isCompensated ) - { - pState->gain_data[i].gainException = FALSE; - } - } - break; - } -#endif } } -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - if ( !pState->gain_data[i].gainException ) + for ( idx = 0; idx < input_frame; idx++ ) { -#endif - for ( idx = 0; idx < input_frame; idx++ ) + if ( idx < offset ) { - if ( idx < offset ) - { - gain = powf( pState->agc_com.winFunc[idx], pState->gain_state[i].gainExpVal ); - } - else - { - - gain = powf( pState->agc_com.winFunc[offset - 1], pState->gain_state[i].gainExpVal ); - } - ppPcm_out[i][idx] *= gain; + gain = powf( pState->agc_com.winFunc[idx], pState->gain_state[i].gainExpVal ); } - - pState->gain_state[i].lastGain *= powf( pState->agc_com.winFunc[offset - 1], pState->gain_state[i].gainExpVal ); -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - } - else - { - pState->gain_state[i].gainExpVal = (int16_t) ( -floorf( -logf( ( actualMaxAbsVal + pState->minDelta ) * MDFT_NORM_SCALING ) * INV_LOG_2 ) ); - pState->gain_state[i].gainExpVal = min( gainExpValMaxRange, pState->gain_state[i].gainExpVal ); - - gain = powf( pState->agc_com.winFunc[offset - 1], pState->gain_state[i].gainExpVal ); - for ( idx = 0; idx < input_frame; idx++ ) + else { - ppPcm_out[i][idx] *= gain; + + gain = powf( pState->agc_com.winFunc[offset - 1], pState->gain_state[i].gainExpVal ); } - pState->gain_state[i].lastGain *= gain; + ppPcm_out[i][idx] *= gain; } -#endif + + pState->gain_state[i].lastGain *= powf( pState->agc_com.winFunc[offset - 1], pState->gain_state[i].gainExpVal ); /*safety check starts*/ if ( pState->gain_state[i].gainExpVal == pState->agc_com.maxAttExp + 1 ) { extendedExpVal = TRUE; } -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - else if ( pState->gain_state[i].gainExpVal == 0 ) - { - pState->gain_data[i].gainException = FALSE; - } -#endif /*safety check ends*/ pState->gain_state[i].prevExp = pState->gain_state[i].lastExp; @@ -469,39 +396,14 @@ void ivas_agc_enc_process( if ( extendedExpVal ) { -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - if ( !pState->gain_data[i].gainException ) - { - pState->gain_data[i].gainException = TRUE; -#endif - pState->gain_state[i].gainExpVal = -1; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - } - else - { - if ( pState->gain_state[i].gainExpVal == gainExpValMaxRange ) - { - pState->gain_state[i].gainExpVal = 0; - } - } -#endif + pState->gain_state[i].gainExpVal = -1; } } pState->gain_data[i].absGainExp = pState->gain_state[i].prevExp + pState->agc_com.absEmin; - if ( extendedExpVal -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - && pState->gain_data[i].gainException -#endif - && pState->gain_state[i].gainExpVal <= 0 ) + if ( extendedExpVal && pState->gain_state[i].gainExpVal <= 0 ) { -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - if ( pState->gain_state[i].gainExpVal == -1 ) - { - pState->gain_data[i].gainException = FALSE; - } -#endif pState->gain_state[i].gainExpVal = pState->agc_com.maxAttExp + 1; } @@ -542,12 +444,6 @@ void ivas_agc_enc_process( if ( per_ch_bit[i] == 1 ) { push_next_indice( hMetaData, (uint16_t) pState->gain_data[i].absGainExpCurr, (int16_t) pState->agc_com.betaE ); -#ifndef FIX_185_REDUCE_MD_BITS - push_next_indice( hMetaData, (uint16_t) pState->gain_data[i].gainException, 1 ); -#endif -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - assert( pState->gain_data[i].gainException == FALSE ); -#endif } } } @@ -584,10 +480,6 @@ static int16_t ivas_agc_writeBits( FILE *stream, const int16_t n_channels, ivas_ fwrite( &( pState->gain_data[i].absGainExpCurr ), sizeof( int32_t ), 1, stream ); /* n bits */ num_bits += pState->agc_com.betaE; -#ifndef CLEANUP_185_NO_AGC_EXCEPTION - fwrite( &( pState->gain_data[i].gainException ), sizeof( int16_t ), 1, stream ); /* 1 bit */ - num_bits++; -#endif num_dmx_bits[i]++; /*fprintf(stdout, "absGainExpCurr[%d]:= %d[%d bits]; ", i, pState->gain_data[i].absGainExpCurr, pState->betaE); */ diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index e38f81a79f67e021b5e740509f51ccf6776897ac..828fdf17a1db4fe7da194c0c38be216bbb7b5c14 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -101,10 +101,8 @@ ivas_error pre_proc_front_ivas( const int16_t front_vad_flag, /* i : front-VAD flag to overwrite VAD decision */ const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag /* i : front-VAD DTX flag to overwrite VAD decision*/ -#ifdef FIX_DTX_RANGE , const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ -#endif ) { float *inp_12k8, *new_inp_12k8; /* pointers to current frame and new data */ @@ -556,11 +554,7 @@ ivas_error pre_proc_front_ivas( st->cng_type = LP_CNG; } -#ifdef FIX_DTX_RANGE dtx( st, ivas_total_brate, *vad_flag_dtx, inp_12k8 ); -#else - dtx( st, *vad_flag_dtx, inp_12k8 ); -#endif #ifdef FIX_ITD_CNG if ( hCPE != NULL && hCPE->hStereoDft != NULL && st->core_brate == SID_2k40 ) diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 8295171f9f39336d3a13ff7cf715733acf9eb6f1..470d597b15ab425dcde5cf681e11ce7a7341dc68 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -436,12 +436,8 @@ ivas_error ivas_cpe_enc( { error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &Etot[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], - fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0 -#ifdef FIX_DTX_RANGE - , - ivas_total_brate -#endif - ); + fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, + ivas_total_brate ); if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index b83cb1233f09c7a416d4e35eddfae0a713d239b6..52b67fe0568bd3fac9bf195dc2dc10831b000fab 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -131,9 +131,7 @@ ivas_error ivas_dirac_enc_open( } else { -#ifdef BRATE_SWITCHING_FRAMEWORK hDirAC->num_samples_synchro_delay = 0; -#endif for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) { diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index 89d073aebad74ef6233a6184f36ace91a694524f..cc2a4b08d8de3756e85aa511212a63a1bfdeb851 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -438,11 +438,7 @@ ivas_error front_vad_spar( noise_est_down( fr_bands[0], hFrontVad->hNoiseEst->bckr, tmpN, tmpE, st->min_band, st->max_band, &hFrontVad->hNoiseEst->totalNoise, Etot[0], &hFrontVad->hNoiseEst->Etot_last, &hFrontVad->hNoiseEst->Etot_v_h2 ); corr_shift = correlation_shift( hFrontVad->hNoiseEst->totalNoise ); -#ifdef FIX_DTX_RANGE dtx( st, hEncoderConfig->ivas_total_brate, vad_flag_dtx[0], inp_12k8 ); -#else - dtx( st, vad_flag_dtx[0], inp_12k8 ); -#endif /* linear prediction analysis */ alw_pitch_lag_12k8[0] = st->old_pitch_la; diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 8e6c059c7ba8c2e2a5f2090f56a6d385c80ccf15..39d5b42a07fbc7adbfe56496949beed2abbeceba 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -150,12 +150,8 @@ ivas_error ivas_ism_enc( error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], &Etot[sce_id][0], &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], - fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0 -#ifdef FIX_DTX_RANGE - , - st_ivas->hEncoderConfig->ivas_total_brate -#endif - ); + fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, + st_ivas->hEncoderConfig->ivas_total_brate ); if ( error != IVAS_ERR_OK ) { return error; @@ -180,11 +176,7 @@ ivas_error ivas_ism_enc( /* For the current frame, make a decision based on some core-coder flags */ if ( st_ivas->hSCE[0]->hCoreCoder[0]->flag_noisy_speech_snr && st_ivas->hSCE[1]->hCoreCoder[0]->flag_noisy_speech_snr ) { -#ifdef FIX_I218_PARAMISM_NOISY_SPEECH if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag || st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) -#else - if ( st_ivas->hSCE[0]->hCoreCoder[0]->vad_flag && st_ivas->hSCE[1]->hCoreCoder[0]->vad_flag ) -#endif { st_ivas->hDirAC->hParamIsm->noisy_speech_buffer[i] = 0; } diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 9fbf63c952f4fd0c0b0dfbb27c6f5606385f0e03..c9f3698b27b720b8696de642d916436970193445 100644 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -44,7 +44,6 @@ #include "wmops.h" -#ifdef BRATE_SWITCHING_FRAMEWORK /*-------------------------------------------------------------------* * set_mct_enc_params() * @@ -83,7 +82,6 @@ static void set_mct_enc_params( return; } -#endif /*-------------------------------------------------------------------* @@ -318,27 +316,7 @@ ivas_error create_mct_enc( * Initializations *-----------------------------------------------------------------*/ -#ifdef BRATE_SWITCHING_FRAMEWORK set_mct_enc_params( hMCT, ivas_total_brate, st_ivas->sba_mode, 1 ); -#else - - hMCT->currBlockDataCnt = 0; - - /*Initialize bits required to signal channel-pair index*/ - hMCT->bitsChannelPairIndex = max( 1, (int16_t) ( floor( ( log( hMCT->nchan_out_woLFE * ( hMCT->nchan_out_woLFE - 1 ) / 2 - 1 ) / log( 2. ) ) ) + 1 ) ); - - set_s( hMCT->lowE_ch, 0, MCT_MAX_CHANNELS ); - - for ( n = 0; n < MCT_MAX_CHANNELS; n++ ) - { - set_f( hMCT->lastxCorrMatrix[n], 0, MCT_MAX_CHANNELS ); - } - hMCT->hbr_mct = 0; - if ( st_ivas->sba_mode == SBA_MODE_SPAR && ivas_total_brate >= IVAS_256k ) - { - hMCT->hbr_mct = 1; - } -#endif st_ivas->hMCT = hMCT; @@ -379,24 +357,11 @@ ivas_error mct_enc_reconfigure( hMCT->nchan_out_woLFE = st_ivas->hEncoderConfig->nchan_inp - 1; /* LFE channel is coded separately */ hMCT->num_lfe = TRUE; } -#ifdef BRATE_SWITCHING_FRAMEWORK else if ( ivas_format == SBA_FORMAT ) { hMCT->nchan_out_woLFE = st_ivas->nchan_transport; hMCT->num_lfe = FALSE; } -#else - else if ( ivas_format == SBA_FORMAT && st_ivas->hDirAC ) // VE: this condition to be reviewed together with the following one - { - hMCT->nchan_out_woLFE = ivas_get_sba_num_TCs( ivas_total_brate, st_ivas->sba_analysis_order ); - hMCT->num_lfe = FALSE; - } - else if ( ivas_format == SBA_FORMAT ) - { - hMCT->nchan_out_woLFE = ivas_sba_get_nchan( st_ivas->sba_analysis_order, st_ivas->hEncoderConfig->sba_planar ); - hMCT->num_lfe = FALSE; - } -#endif else { assert( !"IVAS format currently not supported for MCT" ); @@ -509,23 +474,7 @@ ivas_error mct_enc_reconfigure( * Initializations *-----------------------------------------------------------------*/ -#ifdef BRATE_SWITCHING_FRAMEWORK set_mct_enc_params( hMCT, ivas_total_brate, st_ivas->sba_mode, b_nchan_change ); -#else - if ( b_nchan_change ) - { - hMCT->currBlockDataCnt = 0; - /*Initialize bits required to signal channel-pair index*/ - hMCT->bitsChannelPairIndex = max( 1, (int16_t) ( floor( ( log( hMCT->nchan_out_woLFE * ( hMCT->nchan_out_woLFE - 1 ) / 2 - 1 ) / log( 2. ) ) ) + 1 ) ); - - set_s( hMCT->lowE_ch, 0, MCT_MAX_CHANNELS ); - - for ( n = 0; n < MCT_MAX_CHANNELS; n++ ) - { - set_f( hMCT->lastxCorrMatrix[n], 0, MCT_MAX_CHANNELS ); - } - } -#endif return IVAS_ERR_OK; } diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index aaf76ceb35269595cf420c735b6d61130e4094ef..a999681ab48948089aca55ec4ae7c00f2f6dbba9 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -881,11 +881,7 @@ void ivas_mdct_core_whitening_enc( { chE_tot = sum_f( chE, NB_DIV ); -#ifdef FIX_MCT_UNINIT_MEM if ( chE_tot < SILENT_CHANNEL_THRES && nSubframes == 1 ) -#else - if ( chE_tot < SILENT_CHANNEL_THRES ) -#endif { st->mct_chan_mode = MCT_CHAN_MODE_IGNORE; st->bits_frame_channel = 0; @@ -1059,11 +1055,7 @@ void ivas_mdct_core_whitening_enc( { st->side_bits_frame_channel = 0; /*dummy initialization to prevent range coder crashing in case all channels are silent and bits are distributed to channel 0 */ -#ifdef FIX_MCT_UNINIT_MEM *p_param[ch] = 1 + NOISE_FILL_RANGES + LTPSIZE + tnsSize[ch][0] + NPRM_CTX_HM; -#else - *p_param[ch] = 9; -#endif continue; } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index ba0c27ddd1a242a622903b89d367b2f84eeacde4..2a74fcf68d5c261a81a43fd12c6974684a98440f 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -185,12 +185,8 @@ ivas_error ivas_sce_enc( &Etot[0], &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, flag_16k_smc, - st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0 -#ifdef FIX_DTX_RANGE - , - st_ivas->hEncoderConfig->ivas_total_brate -#endif - ); + st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, + st_ivas->hEncoderConfig->ivas_total_brate ); if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index b0ec2f1c8ed0f22c5b6085ca389a48a288cfa833..e522912cc794345a68fcbedd5cde2422850e35cd 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -156,7 +156,6 @@ static void calc_poc( float *P; float tmp1, tmp2, Lr, Li, Rr, Ri, gamma, igamma, iN; -#ifdef NTT_REDUC_COMP_POC float specPOr[L_FRAME48k / 2 + 1], specPOi[L_FRAME48k / 2]; /*real and imaginary values for searching phase angle*/ float tmpPOC1[L_FRAME48k], tmpPOC2[L_FRAME48k]; float rfft_buf[L_FRAME48k]; @@ -164,13 +163,6 @@ static void calc_poc( int16_t mult_angle; int16_t j; int16_t end; -#else - float specPOr[L_FRAME48k], specPOi[L_FRAME48k]; - float tmpPOC1[L_FRAME48k], tmpPOC2[L_FRAME48k]; - float rfft_buf[L_FRAME48k]; - int16_t step, bias; - int16_t i_for; -#endif int16_t cos_step, cos_max; float eps_cos, eps_sin, EPS; @@ -186,7 +178,6 @@ static void calc_poc( igamma = STEREO_DMX_EVS_POC_GAMMA * iN; gamma = 1.0f - igamma; -#ifdef NTT_REDUC_COMP_POC /*apploximation of phase angle on an unit circle without using sqrt()*/ step = 1; bias = 0; @@ -346,80 +337,6 @@ static void calc_poc( } specPOr[n0] = sign( specLr[n0] * specRr[n0] ) * wnd[i * step + bias] * gamma; -#else /*NTT_REDUC_COMP_POC*/ - if ( input_frame == L_FRAME16k ) - { - step = 3; - bias = 1; - } - else - { - step = 1; - bias = 0; - } - - specPOr[0] = sign( specLr[0] ) * sign( specRr[0] ) * wnd[bias]; - specPOi[0] = 0.0f; - - EPS = hPOC->eps; - - if ( input_frame == L_FRAME16k ) - { - cos_step = 4; - cos_max = input_frame; - } - else /* for 32 kHz & 48 kHz */ - { - cos_step = 2; - cos_max = n0; - } - for ( i = 1; i < n0 / 2; i++ ) - { - Lr = specLr[i]; - Li = specLi[i]; - Rr = specRr[i]; - Ri = specRi[i]; - i_for = i * cos_step; - eps_cos = s[cos_max - i_for] * EPS; - eps_sin = s[i_for] * EPS; - Lr += ( specRr[i] * eps_cos + specRi[i] * eps_sin ); - Li += ( -specRr[i] * eps_sin + specRi[i] * eps_cos ); - Rr += ( specLr[i] * eps_cos + specLi[i] * eps_sin ); - Ri += ( -specLr[i] * eps_sin + specLi[i] * eps_cos ); - - tmp1 = wnd[i * step + bias] * gamma / ( sqrtf( ( ( Lr * Lr + Li * Li ) ) * ( ( Rr * Rr + Ri * Ri ) ) ) + EPS ); - - specPOr[i] = ( Lr * Rr + Li * Ri ) * tmp1; - specPOi[i] = ( Lr * Ri - Li * Rr ) * tmp1; - - gamma -= igamma; - } - - for ( i = n0 >> 1; i < n0; i++ ) - { - Lr = specLr[i]; - Li = specLi[i]; - Rr = specRr[i]; - Ri = specRi[i]; - - i_for = ( n0 - i ) * cos_step; - eps_cos = s[cos_max - i_for] * EPS; - eps_sin = s[i_for] * EPS; - - Lr += ( -specRr[i] * eps_cos + specRi[i] * eps_sin ); - Li += ( -specRr[i] * eps_sin - specRi[i] * eps_cos ); - Rr += ( -specLr[i] * eps_cos + specLi[i] * eps_sin ); - Ri += ( -specLr[i] * eps_sin - specLi[i] * eps_cos ); - - tmp1 = wnd[i * step + bias] * gamma / ( sqrtf( ( ( Lr * Lr + Li * Li ) ) * ( ( Rr * Rr + Ri * Ri ) ) ) + EPS ); - - specPOr[i] = ( Lr * Rr + Li * Ri ) * tmp1; - specPOi[i] = ( Lr * Ri - Li * Rr ) * tmp1; - gamma -= igamma; - } - - specPOr[n0] = sign( specLr[i] ) * sign( specRr[i] ) * wnd[i * step + bias] * gamma; -#endif rfft_buf[0] = specPOr[0]; rfft_buf[1] = specPOr[n0]; diff --git a/lib_enc/ivas_stereo_switching_enc.c b/lib_enc/ivas_stereo_switching_enc.c index 66f7c8fcd94c2847a0c2650822afcaa4f7f8b7bc..59adc49fef6eda1e46ec21310a51cd0c0e6f855e 100644 --- a/lib_enc/ivas_stereo_switching_enc.c +++ b/lib_enc/ivas_stereo_switching_enc.c @@ -815,10 +815,6 @@ void stereo_switching_enc( sts[1]->last_core = sts[0]->last_core; sts[1]->last_coder_type = sts[0]->last_coder_type; sts[1]->last_bwidth = sts[0]->last_bwidth; -#ifndef FIX_221_BR_SWITCH_STEREO - sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo; - sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode; -#endif } } else if ( hCPE->element_mode == IVAS_CPE_TD && hCPE->last_element_mode == IVAS_CPE_MDCT ) @@ -827,14 +823,12 @@ void stereo_switching_enc( set_f( sts[1]->hLPDmem->old_exc, 0.0f, L_EXC_MEM ); } -#ifdef FIX_221_BR_SWITCH_STEREO /* TD/DFT -> MDCT stereo switching (there is no TCX in the TD stereo secondary channel, or DFT stereo) */ if ( hCPE->element_mode == IVAS_CPE_MDCT && hCPE->last_element_mode != IVAS_CPE_MDCT ) { sts[1]->hTcxCfg->last_aldo = sts[0]->hTcxCfg->last_aldo; sts[1]->hTcxCfg->tcx_curr_overlap_mode = sts[0]->hTcxCfg->tcx_curr_overlap_mode; } -#endif return; } diff --git a/lib_enc/ivas_td_low_rate_enc.c b/lib_enc/ivas_td_low_rate_enc.c index 563e1d1b391ef090ae0730742424fc6a56d07fee..87140143470a208af975ac7e938ba975d261ef55 100644 --- a/lib_enc/ivas_td_low_rate_enc.c +++ b/lib_enc/ivas_td_low_rate_enc.c @@ -78,9 +78,7 @@ void tdm_low_rate_enc( nb_subfr = 2; -#ifdef FIX_I217_GSC_FLAG_IN_ISM st->GSC_IVAS_mode = 0; -#endif st->GSC_noisy_speech = 1; st->hGSCEnc->noise_lev = 14; diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index b3f8dc478d3c9fd3e077233c63a1c720fa0598cc..b4eb85915e3d878b70b8d4bee72dc22209ebce52 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -378,11 +378,7 @@ ivas_error IVAS_ENC_ConfigureForObjects( if ( numObjects > MAX_NUM_OBJECTS ) { -#ifdef EXT_RENDERER return IVAS_ERR_TOO_MANY_INPUTS; -#else - return IVAS_ERR_TOO_MANY_OBJECT_INPUTS; -#endif } st_ivas = hIvasEnc->st_ivas; @@ -876,20 +872,12 @@ static ivas_error configureEncoder( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "8kHz input sampling rate is not supported in IVAS." ); } -#ifdef FIX_DTX_RANGE if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && ( ( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp > 1 ) || // ToDo: see Issue 113 ( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate > IVAS_128k ) || // ToDo: remove the bitrate limitation ( hEncoderConfig->ivas_format == SBA_FORMAT && ivas_get_sba_num_TCs( hEncoderConfig->ivas_total_brate, 1 ) > 2 ) || // ToDo: support for 3+ TCs to be done hEncoderConfig->ivas_format == MC_FORMAT // ToDo: TBD ) ) -#else - if ( hEncoderConfig->Opt_DTX_ON && hEncoderConfig->ivas_format != MONO_FORMAT && - !( hEncoderConfig->ivas_format == MASA_FORMAT && hEncoderConfig->ivas_total_brate <= IVAS_128k ) && - hEncoderConfig->ivas_format != SBA_FORMAT && - ( hEncoderConfig->element_mode_init != IVAS_CPE_DFT && hEncoderConfig->element_mode_init != IVAS_CPE_TD ) && !( hEncoderConfig->ivas_format == ISM_FORMAT && hEncoderConfig->nchan_inp == 1 ) && - hEncoderConfig->element_mode_init != IVAS_CPE_MDCT ) -#endif { return IVAS_ERROR( IVAS_ERR_DTX_NOT_SUPPORTED, "DTX is not supported in this IVAS format and element mode." ); } @@ -963,11 +951,7 @@ ivas_error IVAS_ENC_GetDelay( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef FIX_GET_DELAY_RETURN *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) ); -#else - *delay = NS2SA( hEncoderConfig->input_Fs, (int32_t) ( get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, RENDERER_DISABLE, 0 ) + 0.5f ) ); -#endif *delay *= hEncoderConfig->nchan_inp; @@ -1377,11 +1361,7 @@ const char *IVAS_ENC_GetErrorMessage( return "invalid bitrate"; case IVAS_ERR_INVALID_MASA_CONFIG: return "invalid MASA config"; -#ifdef EXT_RENDERER case IVAS_ERR_TOO_MANY_INPUTS: -#else - case IVAS_ERR_TOO_MANY_OBJECT_INPUTS: -#endif return "too many object inputs provided"; case IVAS_ERR_INDEX_OUT_OF_BOUNDS: return "index out of bounds"; @@ -1410,10 +1390,8 @@ const char *IVAS_ENC_GetErrorMessage( return "mismatched timestamp"; case IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT: return "invalid metadata format"; -#ifdef FIX_ISM_METADATA_READER case IVAS_ERR_ISM_INVALID_METADATA_VALUE: return "invalid metadata value provided"; -#endif case IVAS_ERR_FAILED_FILE_READ: return "could not read from file"; case IVAS_ERR_NOT_SUPPORTED_OPTION: @@ -1520,11 +1498,7 @@ static ivas_error printConfigInfo_enc( } else if ( hEncoderConfig->ivas_format == SBA_FORMAT ) { -#ifdef PRINT_SBA_ORDER fprintf( stdout, "IVAS format: Scene Based Audio, Ambisonic order %i %s ", hEncoderConfig->sba_order, hEncoderConfig->sba_planar ? "(Planar)" : "" ); -#else - fprintf( stdout, "IVAS format: Scene Based Analysis %s ", hEncoderConfig->sba_planar ? "(Planar)" : "" ); -#endif if ( hEncoderConfig->Opt_PCA_ON ) { fprintf( stdout, "- PCA configured with signal adaptive decision " ); diff --git a/lib_enc/pre_proc.c b/lib_enc/pre_proc.c index 9729dd6d5459a761cf8ead91f87430c1b2fee59b..7fb89690f1be709c7b62c9f606994bf9076e5ea3 100644 --- a/lib_enc/pre_proc.c +++ b/lib_enc/pre_proc.c @@ -256,11 +256,7 @@ void pre_proc( * Select SID or FRAME_NO_DATA frame if DTX enabled *-----------------------------------------------------------------*/ -#ifdef FIX_DTX_RANGE dtx( st, -1, vad_flag_dtx, inp_12k8 ); -#else - dtx( st, vad_flag_dtx, inp_12k8 ); -#endif /*----------------------------------------------------------------* * Adjust FD-CNG Noise Estimator diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 3782f5789e941b380ec0865fefa84875868003f2..f63d729dc758990a14938286759ee1f09d77137e 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -39,10 +39,8 @@ #include "ivas_stat_dec.h" #include #include "ivas_rom_binaural_crend_head.h" -#ifdef EXT_RENDERER #include "lib_rend.h" #include "ivas_lib_rend_internal.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -1037,11 +1035,7 @@ ivas_error ivas_crend_process( { int16_t i, nchan_out, output_frame; int16_t subframe_len, subframe_idx; -#ifdef EXT_RENDERER float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; -#else - float pcm_tmp[MAX_TRANSPORT_CHANNELS][L_FRAME48k]; -#endif AUDIO_CONFIG intern_config; ivas_error error; @@ -1081,20 +1075,12 @@ ivas_error ivas_crend_process( */ if ( intern_config == AUDIO_CONFIG_FOA || intern_config == AUDIO_CONFIG_HOA2 || intern_config == AUDIO_CONFIG_HOA3 ) { -#ifdef EXT_RENDERER rotateFrame_shd( st_ivas->hHeadTrackData, output, subframe_len, st_ivas->hIntSetup, subframe_idx ); -#else - rotateFrame_shd( st_ivas->hHeadTrackData, output, st_ivas->hDecoderConfig->output_Fs, subframe_len, st_ivas->hIntSetup, subframe_idx ); -#endif } /* Rotation in SD for MC -> BINAURAL_ROOM */ else if ( st_ivas->ivas_format != ISM_FORMAT && st_ivas->hIntSetup.is_loudspeaker_setup ) { -#ifdef EXT_RENDERER rotateFrame_sd( st_ivas->hHeadTrackData, output, subframe_len, st_ivas->hIntSetup, st_ivas->hEFAPdata, subframe_idx ); -#else - rotateFrame_sd( st_ivas->hHeadTrackData, output, st_ivas->hDecoderConfig->output_Fs, subframe_len, st_ivas->hIntSetup, st_ivas->hEFAPdata, subframe_idx ); -#endif } } @@ -1136,7 +1122,6 @@ ivas_error ivas_crend_process( return IVAS_ERR_OK; } -#ifdef EXT_RENDERER /*------------------------------------------------------------------------- * ivas_rend_openCrend() @@ -1975,5 +1960,3 @@ ivas_error ivas_rend_crendConvolver( return IVAS_ERR_OK; } - -#endif diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 8314d3117f02f69ba8ce603490b0206bbaef5f0e..48bfd7b8a0e82333cc4edb4891a09c4b5e0517df 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -155,12 +155,7 @@ ivas_error efap_init_data( if ( !speaker_node_azi_deg || !speaker_node_ele_deg ) { hEFAPdata = NULL; -#ifdef EXT_RENDERER return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "EFAP requires arrays of speaker azimuths and elevations" ); -#else - /* TODO: is this path correct behaviour or and error ? */ - return IVAS_ERR_OK; -#endif } /*-----------------------------------------------------------------* @@ -1329,21 +1324,11 @@ static void efap_panning( float tmpBuff[EFAP_MAX_CHAN_NUM]; float normTmpBuff; float P[2]; -#ifndef FIX_EFAP_MATH - float P_tmp[2]; -#endif P[0] = azi; P[1] = ele; /* Finding in which polygon the point is */ -#ifndef FIX_EFAP_MATH - P_tmp[0] = roundf( P[0] / PANNING_AZI_RESOLUTION ); - P_tmp[1] = roundf( P[1] / PANNING_ELE_RESOLUTION ); - - P[0] = P_tmp[0] * PANNING_AZI_RESOLUTION; - P[1] = P_tmp[1] * PANNING_ELE_RESOLUTION; -#endif polyIdx = get_poly_num( P, polyData ); @@ -2265,11 +2250,7 @@ static int16_t in_tri( /* Verification of the non-colinearity */ invFactor = tmpDot1[0] * tmpDot2[1] - tmpDot1[1] * tmpDot2[0]; -#ifdef FIX_EFAP_MATH if ( fabsf( invFactor ) < thresh ) -#else - if ( invFactor < thresh ) -#endif { return 0; } diff --git a/lib_rend/ivas_lib_rend_internal.h b/lib_rend/ivas_lib_rend_internal.h index 6a362c8c1c435adff745a447f700cdb92047c9f7..f758bc780a12011e733f81c36b5ef2813ddef435 100644 --- a/lib_rend/ivas_lib_rend_internal.h +++ b/lib_rend/ivas_lib_rend_internal.h @@ -37,7 +37,6 @@ #ifndef IVAS_LIB_REND_INTERNALS_H #define IVAS_LIB_REND_INTERNALS_H -#ifdef EXT_RENDERER typedef struct { int8_t headRotEnabled; @@ -122,4 +121,3 @@ ivas_error ivas_rend_TDObjRendOpen( const int32_t output_Fs ); #endif -#endif diff --git a/lib_rend/ivas_limiter.c b/lib_rend/ivas_limiter.c index fd116223c5d42aaad6c84f4c34daa714c71104c5..56dbb39b070e5e54dbf319fda57532e9c97e53a2 100644 --- a/lib_rend/ivas_limiter.c +++ b/lib_rend/ivas_limiter.c @@ -39,15 +39,6 @@ #include "wmops.h" #include -#ifndef EXT_RENDERER -/*----------------------------------------------------------------------------------* - * Local constants - *----------------------------------------------------------------------------------*/ - -#define LIMITER_THRESHOLD 32729 /* -0.01 dBFS */ -#define LIMITER_ATTACK_SECONDS 0.005f - -#endif /*-------------------------------------------------------------------* * detect_strong_saturations() @@ -73,19 +64,11 @@ static int16_t detect_strong_saturations( *strong_saturation_cnt = 50; apply_strong_limiting = 1; } -#ifdef EXT_RENDERER else if ( max_val > 3 * IVAS_LIMITER_THRESHOLD && *strong_saturation_cnt > 0 ) -#else - else if ( max_val > 3 * LIMITER_THRESHOLD && *strong_saturation_cnt > 0 ) -#endif { apply_strong_limiting = 1; } -#ifdef EXT_RENDERER else if ( max_val > 10 * IVAS_LIMITER_THRESHOLD ) -#else - else if ( max_val > 10 * LIMITER_THRESHOLD ) -#endif { *strong_saturation_cnt += 20; *strong_saturation_cnt = min( *strong_saturation_cnt, 50 ); @@ -140,11 +123,7 @@ IVAS_LIMITER_HANDLE ivas_limiter_open( hLimiter->sampling_rate = sampling_rate; hLimiter->gain = 1.f; hLimiter->release_heuristic = 0.f; -#ifdef EXT_RENDERER hLimiter->attack_constant = powf( 0.01f, 1.0f / ( IVAS_LIMITER_ATTACK_SECONDS * sampling_rate ) ); -#else - hLimiter->attack_constant = powf( 0.01f, 1.0f / ( LIMITER_ATTACK_SECONDS * sampling_rate ) ); -#endif hLimiter->strong_saturation_count = 0; #ifdef DEBUGGING hLimiter->cnt_frames_limited = 0; @@ -216,11 +195,7 @@ void ivas_limiter_dec( channels[c] = output[c]; } -#ifdef EXT_RENDERER limiter_process( hLimiter, output_frame, IVAS_LIMITER_THRESHOLD, BER_detect, &hLimiter->strong_saturation_count ); -#else - limiter_process( hLimiter, output_frame, LIMITER_THRESHOLD, BER_detect, &hLimiter->strong_saturation_count ); -#endif return; } diff --git a/lib_rend/ivas_ls_custom_dec.c b/lib_rend/ivas_ls_custom_dec.c index 4f1042036386e5f3bbe103dd576ed5c5e0d0574a..28bd8c1dd81ff1c7ccb89117c794349f59f16ed2 100644 --- a/lib_rend/ivas_ls_custom_dec.c +++ b/lib_rend/ivas_ls_custom_dec.c @@ -79,13 +79,8 @@ ivas_error ivas_ls_custom_open( *-------------------------------------------------------------------------*/ void ivas_ls_custom_setup( -#ifdef EXT_RENDERER IVAS_OUTPUT_SETUP_HANDLE hOutSetup, /* o : IVAS output setup handle */ const LSSETUP_CUSTOM_STRUCT *hLsSetupCustom /* i : Custom loudspeaker setup handle */ -#else - IVAS_OUTPUT_SETUP_HANDLE hOutSetup, /* o : IVAS output setup handle */ - const LSSETUP_CUSTOM_HANDLE hLsSetupCustom /* i : Custom loudspeaker setup handle */ -#endif ) { hOutSetup->output_config = AUDIO_CONFIG_LS_CUSTOM; diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 1979abe230e67499416989b68fe0e8c4b51a1026..da4c10a888f9a7e1dc54bbae9eb00dac80eb9d49 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -37,10 +37,8 @@ #include #include "wmops.h" #include "ivas_rom_com.h" -#ifdef EXT_RENDERER #include "lib_rend.h" #include "ivas_lib_rend_internal.h" -#endif #ifdef DEBUGGING #include "debug.h" #endif @@ -59,17 +57,10 @@ static void TDREND_Clear_Update_flags( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRe static void TDREND_Update_listener_orientation( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, const int16_t headRotEnabled, -#ifdef EXT_RENDERER - const IVAS_QUATERNION *headPosition -#else - const Quaternion *headPosition -#endif -); + const IVAS_QUATERNION *headPosition ); static void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, const int16_t numSources, -#ifdef EXT_RENDERER const int16_t lfe_idx, -#endif const IVAS_FORMAT in_format, const ISM_METADATA_HANDLE *hIsmMetaData, float output[][L_FRAME48k] ); @@ -171,12 +162,10 @@ ivas_error ivas_td_binaural_open( ls_azimuth = ls_azimuth_CICP19; ls_elevation = ls_elevation_CICP19; break; -#ifdef EXT_RENDERER case AUDIO_CONFIG_LS_CUSTOM: ls_azimuth = st_ivas->hTransSetup.ls_azimuth; ls_elevation = st_ivas->hTransSetup.ls_elevation; break; -#endif default: ls_azimuth = NULL; ls_elevation = NULL; @@ -269,11 +258,7 @@ void ObjRenderIVASFrame( } /* Update object position(s) */ -#ifdef EXT_RENDERER TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, output ); -#else - TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, st_ivas->ivas_format, st_ivas->hIsmMetaData, output ); -#endif for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) { @@ -424,12 +409,10 @@ static void TDREND_Clear_Update_flags( static void TDREND_Update_object_positions( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o : TD Renderer handle */ const int16_t numSources, /* i : Number of sources to render */ -#ifdef EXT_RENDERER - const int16_t lfe_idx, /* i : Input LFE index */ -#endif - const IVAS_FORMAT in_format, /* i : Format of input sources */ - const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ - float output[][L_FRAME48k] /* i/o: SCE/MC channels */ + const int16_t lfe_idx, /* i : Input LFE index */ + const IVAS_FORMAT in_format, /* i : Format of input sources */ + const ISM_METADATA_HANDLE *hIsmMetaData, /* i : Input metadata for ISM objects */ + float output[][L_FRAME48k] /* i/o: SCE/MC channels */ ) { TDREND_DirAtten_t *DirAtten_p; @@ -444,11 +427,7 @@ static void TDREND_Update_object_positions( c_indx = 0; for ( nS = 0; nS < numSources; nS++ ) { -#ifdef EXT_RENDERER if ( !( in_format == MC_FORMAT && nS == lfe_idx ) ) /* Skip LFE for MC */ -#else - if ( !( in_format == MC_FORMAT && nS == LFE_CHANNEL ) ) /* Skip LFE for MC */ -#endif { hBinRendererTd->Sources[c_indx]->InputFrame_p = output[nS]; hBinRendererTd->Sources[c_indx]->SrcRend_p->InputAvailable = TRUE; @@ -492,11 +471,7 @@ static void TDREND_Update_object_positions( static void TDREND_Update_listener_orientation( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD Renderer handle */ const int16_t headRotEnabled, /* i : Headrotation flag */ -#ifdef EXT_RENDERER - const IVAS_QUATERNION *headPosition /* i : Head Position */ -#else - const Quaternion *headPosition /* i : Head Position */ -#endif + const IVAS_QUATERNION *headPosition /* i : Head Position */ ) { float Pos[3]; @@ -542,7 +517,6 @@ static void TDREND_Update_listener_orientation( return; } -#ifdef EXT_RENDERER ivas_error ivas_rend_TDObjRendOpen( TDREND_WRAPPER *pTDRend, @@ -799,4 +773,3 @@ ivas_error ivas_rend_TDObjRenderFrame( return IVAS_ERR_OK; } -#endif diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 100dded45933f19b30aba85b6a3c908887c2df52..cf0c7c69a94de9018ab5ebf56bf0ea00a1bb4814 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -361,7 +361,6 @@ const uint32_t ls_LFE_last_idx_CICP19[12] = { 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, /* Downmix matrices */ const float ls_conversion_cicpX_mono[12][1] = { -#ifdef EXT_RENDERER {1.00000000f}, {1.00000000f}, {1.00000000f}, @@ -374,20 +373,6 @@ const float ls_conversion_cicpX_mono[12][1] = {1.00000000f}, {1.00000000f}, {1.00000000f}, -#else - {1.00000000f}, - {1.00000000f}, - {0.70710677f}, - {0.70710677f}, - {0.79999995f}, - {0.79999995f}, - {0.79999995f}, - {0.79999995f}, - {0.849999964f}, - {0.849999964f}, - {0.849999964f}, - {0.849999964f} -#endif }; const float ls_conversion_cicpX_stereo[12][2] = @@ -408,13 +393,8 @@ const float ls_conversion_cicpX_stereo[12][2] = const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp6[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {8, 6.0f}, -#else - /* First row indicates the number of non-zero elements */ - {8, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {7, 1.000000000f}, @@ -428,13 +408,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp6[] = const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp6[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {8, 6.0f}, -#else - /* First row indicates the number of non-zero elements */ - {8, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {7, 1.000000000f}, @@ -448,13 +423,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp6[] = const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp12[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {8, 8.0f}, -#else - /* First row indicates the number of non-zero elements */ - {8, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {9, 1.000000000f}, @@ -468,13 +438,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp12[] = const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp6[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {10, 6.0f}, -#else - /* First row indicates the number of non-zero elements */ - {10, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {7, 1.000000000f}, @@ -490,13 +455,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp6[] = const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp12[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {10, 8.0f}, -#else - /* First row indicates the number of non-zero elements */ - {10, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {9, 1.000000000f}, @@ -513,13 +473,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp12[] = const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp14[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {10, 8.0f}, -#else - /* First row indicates the number of non-zero elements */ - {10, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {9, 1.000000000f}, @@ -535,13 +490,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp14[] = const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp6[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {14, 6.0f}, -#else - /* First row indicates the number of non-zero elements */ - {14, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {7, 1.000000000f}, @@ -561,13 +511,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp6[] = const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp12[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {14, 8.0f}, -#else - /* First row indicates the number of non-zero elements */ - {14, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {9, 1.000000000f}, @@ -587,13 +532,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp12[] = const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp14[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {14, 8.0f}, -#else - /* First row indicates the number of non-zero elements */ - {14, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {9, 1.000000000f}, @@ -613,13 +553,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp14[] = const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp16[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {14, 10.0f}, -#else - /* First row indicates the number of non-zero elements */ - {14, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.000000000f}, {11, 1.000000000f}, @@ -640,13 +575,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp19_cicp16[] = /* Upmix matrices */ const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp14[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {8, 8.0f}, -#else - /* First row indicates the number of non-zero elements */ - {8, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.0f}, {9, 1.0f}, @@ -660,13 +590,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp14[] = const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp16[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {8, 10.0f}, -#else - /* First row indicates the number of non-zero elements */ - {8, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.0f}, {11, 1.0f}, @@ -680,13 +605,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp16[] = const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp19[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {8, 12.0f}, -#else - /* First row indicates the number of non-zero elements */ - {8, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.0f}, {13, 1.0f}, @@ -700,13 +620,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp12_cicp19[] = const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp19[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {8, 12.0f}, -#else - /* First row indicates the number of non-zero elements */ - {8, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.0f}, {13, 1.0f}, @@ -720,13 +635,8 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp14_cicp19[] = const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp19[] = { -#ifdef EXT_RENDERER /* First row indicates the number of non-zero elements and the number of matrix columns */ {10, 12.0f}, -#else - /* First row indicates the number of non-zero elements */ - {10, 0.0f}, -#endif /* Index of non-zero element, value of non-zero element*/ {0, 1.0f}, {13, 1.0f}, diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 4f5ba72d3983d1725027722852c420cf3a838fe7..1a7cd8b830bbcf123b5d305bbed4fdf6956dcff2 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -45,24 +45,6 @@ #endif #include "wmops.h" -#ifndef EXT_RENDERER - -/*-----------------------------------------------------------------------* - * Local Constants - *-----------------------------------------------------------------------*/ - -#define HEADROT_ORDER 3 -#define HEADROT_SHMAT_DIM ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) -#define HEADROT_SHMAT_DIM2 HEADROT_SHMAT_DIM *HEADROT_SHMAT_DIM - - -/*-----------------------------------------------------------------------* - * Local Function prototypes - *-----------------------------------------------------------------------*/ - -static void SHrotmatgen( float SHrotmat[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM], float Rmat[3][3], const int16_t order ); - -#endif /*-----------------------------------------------------------------------* * ivas_headTrack_open() @@ -106,12 +88,8 @@ ivas_error ivas_headTrack_open( *---------------------------------------------------------------------------------*/ void QuatToRotMat( -#ifdef EXT_RENDERER const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ -#else - const Quaternion quat, /* i : quaternion describing the rotation */ -#endif - float Rmat[3][3] /* o : real-space rotation matrix for this rotation */ + float Rmat[3][3] /* o : real-space rotation matrix for this rotation */ ) { float s1, s2, s3, c1, c2, c3; @@ -179,14 +157,10 @@ void QuatToRotMat( *------------------------------------------------------------------------*/ void Quat2Euler( -#ifdef EXT_RENDERER const IVAS_QUATERNION quat, /* i : quaternion describing the rotation */ -#else - const Quaternion quat, /* i : quaternion describing the rotation */ -#endif - float *yaw, /* o : yaw */ - float *pitch, /* o : pitch */ - float *roll /* o : roll */ + float *yaw, /* o : yaw */ + float *pitch, /* o : pitch */ + float *roll /* o : roll */ ) { if ( quat.w != -3.0 ) @@ -312,49 +286,28 @@ void rotateAziEle_DirAC( void rotateFrame_shd( HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ float output[][L_FRAME48k], /* i/o: unrotated HOA3 signal buffer in TD */ -#ifndef EXT_RENDERER - const int32_t output_Fs, /* i : output sampling frequency */ -#endif - const int16_t subframe_len, /* i : subframe length per channel */ - const IVAS_OUTPUT_SETUP hTransSetup, /* i : format for rotation */ - const int16_t subframe_idx /* i : subframe index */ + const int16_t subframe_len, /* i : subframe length per channel */ + const IVAS_OUTPUT_SETUP hTransSetup, /* i : format for rotation */ + const int16_t subframe_idx /* i : subframe index */ ) { int16_t i, l, n, m; int16_t m1, m2; -#ifdef EXT_RENDERER int16_t shd_rot_max_order; -#else - int16_t shd_rot_max_order, fade_len_smp; -#endif float tmp; float tmpRot[2 * HEADROT_ORDER + 1]; float SHrotmat_prev[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM]; float SHrotmat[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM]; -#ifdef EXT_RENDERER float cross_fade[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - float cross_fade[IVAS_FB_1MS_48K_SAMP]; -#endif shd_rot_max_order = hTransSetup.ambisonics_order; -#ifdef EXT_RENDERER tmp = 1.0f / ( subframe_len - 1 ); for ( i = 0; i < subframe_len; i++ ) { cross_fade[i] = i * tmp; } -#else - /* 1ms linear crossfade */ - fade_len_smp = NS2SA( output_Fs, 1000000 ); - tmp = 1.0f / fade_len_smp; - for ( i = 0; i < fade_len_smp; i++ ) - { - cross_fade[i] = ( i + 1 ) * tmp; - } -#endif /* initialize rotation matrices with zeros */ for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) @@ -388,18 +341,7 @@ void rotateFrame_shd( for ( m = m1; m < m2; m++ ) { /* crossfade with previous rotation gains */ -#ifndef EXT_RENDERER - if ( i < fade_len_smp ) - { -#endif - tmpRot[n - m1] += cross_fade[i] * SHrotmat[n][m] * output[m][subframe_idx * subframe_len + i] + ( 1 - cross_fade[i] ) * SHrotmat_prev[n][m] * output[m][subframe_idx * subframe_len + i]; -#ifndef EXT_RENDERER - } - else - { - tmpRot[n - m1] += SHrotmat[n][m] * output[m][subframe_idx * subframe_len + i]; - } -#endif + tmpRot[n - m1] += cross_fade[i] * SHrotmat[n][m] * output[m][subframe_idx * subframe_len + i] + ( 1 - cross_fade[i] ) * SHrotmat_prev[n][m] * output[m][subframe_idx * subframe_len + i]; } } /* write back the result */ @@ -447,54 +389,34 @@ void rotateFrame_shd( void rotateFrame_sd( HEAD_TRACK_DATA_HANDLE hHeadTrackData, /* i : head track handle */ float output[][L_FRAME48k], /* i/o: unrotated SD signal buffer in TD */ -#ifndef EXT_RENDERER - const int32_t output_Fs, /* i : output sampling frequency */ -#endif - const int16_t subframe_len, /* i : subframe length per channel */ - const IVAS_OUTPUT_SETUP hTransSetup, /* i : format for rotation */ - const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ - const int16_t subframe_idx /* i : subframe index */ + const int16_t subframe_len, /* i : subframe length per channel */ + const IVAS_OUTPUT_SETUP hTransSetup, /* i : format for rotation */ + const EFAP_HANDLE hEFAPdata, /* i : EFAP structure */ + const int16_t subframe_idx /* i : subframe index */ ) { int16_t i, j; int16_t nchan, index_lfe; int16_t ch_in, ch_in_woLFE, ch_out, ch_out_woLFE; int16_t azimuth, elevation; -#ifndef EXT_RENDERER - int16_t fade_len_smp; -#endif float tmp; float tmp_gains[MAX_CICP_CHANNELS - 1]; float gains[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; float gains_prev[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS]; float output_tmp[MAX_CICP_CHANNELS][L_FRAME48k]; -#ifdef EXT_RENDERER float cross_fade[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; -#else - float cross_fade[IVAS_FB_1MS_48K_SAMP]; -#endif wmops_sub_start( "rotateFrame_sd" ); nchan = hTransSetup.nchan_out_woLFE + hTransSetup.num_lfe; index_lfe = hTransSetup.index_lfe[0]; -#ifdef EXT_RENDERER tmp = 1.0f / ( subframe_len - 1 ); for ( i = 0; i < subframe_len; i++ ) { cross_fade[i] = i * tmp; } -#else - /* 1ms linear crossfade */ - fade_len_smp = NS2SA( output_Fs, 1000000 ); - tmp = 1.0f / fade_len_smp; - for ( i = 0; i < fade_len_smp; i++ ) - { - cross_fade[i] = ( i + 1 ) * tmp; - } -#endif /* Get next quaternion and calculate rotation matrix */ QuatToRotMat( hHeadTrackData->Quaternions[hHeadTrackData->num_quaternions++], hHeadTrackData->Rmat ); @@ -521,11 +443,7 @@ void rotateFrame_sd( /* gains for previous subframe rotation */ rotateAziEle( hTransSetup.ls_azimuth[ch_in_woLFE], hTransSetup.ls_elevation[ch_in_woLFE], &azimuth, &elevation, hHeadTrackData->Rmat_prev, hTransSetup.is_planar_setup ); -#ifdef EXT_RENDERER if ( hEFAPdata != NULL && ( hTransSetup.ls_azimuth[ch_in_woLFE] != azimuth || hTransSetup.ls_elevation[ch_in_woLFE] != elevation ) ) -#else - if ( hEFAPdata != NULL && ( hTransSetup.ls_azimuth[ch_in_woLFE] != azimuth && hTransSetup.ls_elevation[ch_in_woLFE] != elevation ) ) -#endif { efap_determine_gains( hEFAPdata, tmp_gains, azimuth, elevation, EFAP_MODE_EFAP ); for ( ch_out = 0; ch_out < nchan; ch_out++ ) @@ -571,21 +489,11 @@ void rotateFrame_sd( { for ( ch_in = 0; ch_in < nchan; ch_in++ ) { -/* crossfade with previous rotation gains */ -#ifdef EXT_RENDERER + /* crossfade with previous rotation gains */ for ( i = subframe_idx * subframe_len, j = 0; j < subframe_len; i++, j++ ) -#else - for ( i = subframe_idx * subframe_len, j = 0; j < fade_len_smp; i++, j++ ) -#endif { output_tmp[ch_out][i] += ( cross_fade[j] ) * gains[ch_in][ch_out] * output[ch_in][i] + ( 1 - cross_fade[j] ) * gains_prev[ch_in][ch_out] * output[ch_in][i]; } -#ifndef EXT_RENDERER - for ( ; i < ( subframe_idx + 1 ) * subframe_len; i++ ) - { - output_tmp[ch_out][i] += gains[ch_in][ch_out] * output[ch_in][i]; - } -#endif } } @@ -937,11 +845,7 @@ static float SHrot_w( } } -#ifdef EXT_RENDERER void SHrotmatgen( -#else -static void SHrotmatgen( -#endif float SHrotmat[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM], /* o : rotation matrix in SHD */ float Rmat[3][3], /* i : real-space rotation matrix */ const int16_t order /* i : ambisonics order */ diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index e2977a81e475f3cce3a409028883335650eabd2e..dc41fc1805715aa26194e71e0a774101651877ff 100755 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -47,9 +47,6 @@ * Local function prototypes *-----------------------------------------------------------------------*/ -#ifndef EXT_RENDERER -static void ivas_sba_mtx_mult( float output_f[][L_FRAME48k], const int16_t output_frame, const int16_t nchan_in, const IVAS_OUTPUT_SETUP output_setup, const float *mtx_hoa_decoder ); -#endif #ifdef DEBUG_MODE_DIRAC static void debug_mode_dirac( float output[MAX_OUTPUT_CHANNELS][L_FRAME48k], const int16_t nchan_transport, const int16_t output_frame ); @@ -428,11 +425,7 @@ ivas_error ivas_sba_linear_renderer( * HOA decoding with LFE insertion *-------------------------------------------------------------------*/ -#ifdef EXT_RENDERER void ivas_sba_mtx_mult( -#else -static void ivas_sba_mtx_mult( -#endif float output_f[][L_FRAME48k], /* i/o: synthesized core-coder transport channels/DirAC output */ const int16_t output_frame, /* i : output frame length per channel */ const int16_t nchan_in, /* i : Number of ambisonic channels */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d766334988c1a9533f86e70a1584e81e60e34c53..2764aa6a10b4a8ed4f29fb9d6c502d58f469b344 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -48,7 +48,6 @@ #include #include -#ifdef EXT_RENDERER /* Maximum buffer length (per channel) in samples. * Keep this separate from L_FRAME48k in case we want to support different size later */ #define MAX_BUFFER_LENGTH_PER_CHANNEL ( L_FRAME48k ) @@ -140,7 +139,6 @@ typedef struct rotation_gains rot_gains_prev; } input_sba; -#ifdef NOKIA_MASA_EXTERNAL_RENDERER /* Due to API of some rendering methods, the renderer has to use the decoder struct. Only struct members relevant for rendering will be initialized, therefore typedef as "dummy" decoder struct */ typedef Decoder_Struct DecoderDummy; @@ -152,7 +150,6 @@ typedef struct MASA_METADATA_FRAME masaMetadata; bool metadataHasBeenFed; } input_masa; -#endif struct IVAS_REND { @@ -166,9 +163,7 @@ struct IVAS_REND input_ism inputsIsm[RENDERER_MAX_ISM_INPUTS]; input_mc inputsMc[RENDERER_MAX_MC_INPUTS]; input_sba inputsSba[RENDERER_MAX_SBA_INPUTS]; -#ifdef NOKIA_MASA_EXTERNAL_RENDERER input_masa inputsMasa[RENDERER_MAX_MASA_INPUTS]; -#endif /* TODO @Philips - inputConfig should not be stored here, but read from e.g. input_mc->input_base.inConfig, please remove this */ IVAS_REND_AudioConfig inputConfig; @@ -1872,7 +1867,6 @@ static void clearInputSba( return; } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER static ivas_error initMasaDummyDecForMcOut( input_masa *inputMasa, IVAS_REND_AudioConfig outConfig ) { ivas_error error; @@ -2234,7 +2228,6 @@ static void freeDecoderDummy( DecoderDummy **ppDecDummy ) } ivas_render_config_close( &pDecDummy->hRenderConfig ); -#ifdef NOKIA_MASA_EXTERNAL_RENDERER /* CLDFB handles */ for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) { @@ -2276,7 +2269,6 @@ static void freeDecoderDummy( DecoderDummy **ppDecDummy ) /* Parametric binaural renderer handle */ ivas_dirac_dec_close_binaural_data( &pDecDummy->hDiracDecBin ); -#endif count_free( pDecDummy ); pDecDummy = NULL; @@ -2291,7 +2283,6 @@ static void clearInputMasa( input_masa *inputMasa ) initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx ); freeDecoderDummy( &inputMasa->decDummy ); } -#endif ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, @@ -2369,7 +2360,6 @@ ivas_error IVAS_REND_Open( initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ) ); hIvasRend->inputsSba[i].crendWrapper.hCrend = NULL; } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsMasa[i].base, @@ -2379,7 +2369,6 @@ ivas_error IVAS_REND_Open( hIvasRend->inputsMasa[i].decDummy = NULL; hIvasRend->inputsMasa[i].metadataHasBeenFed = false; } -#endif return IVAS_ERR_OK; } @@ -2600,7 +2589,6 @@ static ivas_error getInputById( } pInputBase = &hIvasRend->inputsSba[inputIndex].base; break; -#ifdef NOKIA_MASA_EXTERNAL_RENDERER case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: if ( inputIndex > RENDERER_MAX_MASA_INPUTS ) { @@ -2608,7 +2596,6 @@ static ivas_error getInputById( } pInputBase = &hIvasRend->inputsMasa[inputIndex].base; break; -#endif default: return IVAS_ERR_INVALID_INPUT_ID; } @@ -2667,7 +2654,6 @@ static ivas_error getConstInputById( } pInputBase = &hIvasRend->inputsSba[inputIndex].base; break; -#ifdef NOKIA_MASA_EXTERNAL_RENDERER case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: if ( inputIndex > RENDERER_MAX_MASA_INPUTS ) { @@ -2675,7 +2661,6 @@ static ivas_error getConstInputById( } pInputBase = &hIvasRend->inputsMasa[inputIndex].base; break; -#endif default: return IVAS_ERR_INVALID_INPUT_ID; } @@ -2774,14 +2759,12 @@ ivas_error IVAS_REND_AddInput( inputStructSize = sizeof( *hIvasRend->inputsSba ); activateInput = setRendInputActiveSba; break; -#ifdef NOKIA_MASA_EXTERNAL_RENDERER case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: maxNumInputsOfType = RENDERER_MAX_MASA_INPUTS; inputsArray = hIvasRend->inputsMasa; inputStructSize = sizeof( *hIvasRend->inputsMasa ); activateInput = setRendInputActiveMasa; break; -#endif default: return IVAS_ERR_INVALID_INPUT_FORMAT; } @@ -2976,11 +2959,9 @@ ivas_error IVAS_REND_RemoveInput( case IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS: clearInputSba( (input_sba *) inputBase ); break; -#ifdef NOKIA_MASA_EXTERNAL_RENDERER case IVAS_REND_AUDIO_CONFIG_TYPE_MASA: clearInputMasa( (input_masa *) inputBase ); break; -#endif default: return IVAS_ERR_INVALID_INPUT_FORMAT; } @@ -3071,7 +3052,6 @@ ivas_error IVAS_REND_GetDelay( } } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { if ( hIvasRend->inputsMasa[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) @@ -3080,7 +3060,6 @@ ivas_error IVAS_REND_GetDelay( *nSamples = max( *nSamples, NS2SA( *timeScale, latency_ns ) ); } } -#endif return IVAS_ERR_OK; } @@ -3173,7 +3152,6 @@ ivas_error IVAS_REND_FeedInputObjectMetadata( return IVAS_ERR_OK; } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER ivas_error IVAS_REND_FeedInputMasaMetadata( IVAS_REND_HANDLE hIvasRend, const IVAS_REND_InputId inputId, @@ -3207,7 +3185,6 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( return IVAS_ERR_OK; } -#endif ivas_error IVAS_REND_InitConfig( IVAS_REND_HANDLE st, bool rendererConfigEnabled ) @@ -4548,7 +4525,6 @@ static ivas_error renderActiveInputsSba( return IVAS_ERR_OK; } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER static void copyMasaMetadataToDiracRenderer( MASA_METADATA_FRAME *meta, DIRAC_DEC_HANDLE hDirAC ) { int16_t band, sf, bin; @@ -4718,7 +4694,6 @@ static ivas_error renderActiveInputsMasa( return IVAS_ERR_OK; } -#endif ivas_error IVAS_REND_GetSamples( IVAS_REND_HANDLE hIvasRend, @@ -4773,12 +4748,10 @@ ivas_error IVAS_REND_GetSamples( { return error; } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER if ( ( error = renderActiveInputsMasa( hIvasRend, outAudio ) ) != IVAS_ERR_OK ) { return error; } -#endif #ifdef DEBUGGING hIvasRend->numClipping += @@ -4822,12 +4795,10 @@ void IVAS_REND_Close( { clearInputSba( &hIvasRend->inputsSba[i] ); } -#ifdef NOKIA_MASA_EXTERNAL_RENDERER for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { clearInputMasa( &hIvasRend->inputsMasa[i] ); } -#endif /* clear Config. Renderer */ ivas_render_config_close( &( hIvasRend->hRendererConfig ) ); @@ -4858,4 +4829,3 @@ int32_t IVAS_REND_GetCntFramesLimited( return hIvasRend->hLimiter->cnt_frames_limited; } #endif -#endif diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 158a734f4633a43ee65fb5a2a177a794684c3b7a..ea4b84d897ab49108e72e8ad7fd009501bd90619 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -41,7 +41,6 @@ #include "common_api_types.h" #include "ivas_error.h" -#ifdef EXT_RENDERER #define RENDERER_MAX_ISM_INPUTS 4 #define RENDERER_MAX_MC_INPUTS 1 @@ -229,20 +228,11 @@ ivas_error IVAS_REND_FeedInputObjectMetadata( const IVAS_REND_AudioObjectPosition objectPosition /* i : object position struct */ ); -#ifdef NOKIA_MASA_EXTERNAL_RENDERER ivas_error IVAS_REND_FeedInputMasaMetadata( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_REND_InputId inputId, /* i : ID of the input */ IVAS_MASA_METADATA_HANDLE masaMetadata /* i : MASA metadata frame */ ); -#else -/* Support for MASA input will be added in the future. */ -ivas_error IVAS_REND_FeedInputMasaMetadata( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_REND_InputId inputId, /* i : ID of the input */ - void* TODO -); -#endif ivas_error IVAS_REND_InitConfig( IVAS_REND_HANDLE st, /* i/o: Renderer handle */ @@ -287,5 +277,4 @@ int32_t IVAS_REND_GetCntFramesLimited( /* clang-format on */ -#endif /* LIB_REND_H */ #endif diff --git a/lib_util/ism_file_reader.c b/lib_util/ism_file_reader.c index cc93501571a5ae84a241dec84631c56228b5ba82..b511b304997c42ba9086f747b750aa3f93af4fc9 100644 --- a/lib_util/ism_file_reader.c +++ b/lib_util/ism_file_reader.c @@ -31,9 +31,7 @@ *******************************************************************************************************/ #include "ism_file_reader.h" -#ifdef FIX_ISM_METADATA_READER #include "cmdl_tools.h" -#endif #include #include #include @@ -117,20 +115,16 @@ ivas_error IsmFileReader_readNextFrame( char_ptr = strtok( char_buff, "," ); i = 0; meta_prm[i++] = (float) atof( char_ptr ); -#ifdef FIX_ISM_METADATA_READER if ( is_number( char_ptr ) == false ) { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#endif while ( ( char_ptr = strtok( NULL, "," ) ) != NULL && i < NUM_ISM_METADATA_PER_LINE ) { -#ifdef FIX_ISM_METADATA_READER if ( is_number( char_ptr ) == false ) { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#endif meta_prm[i++] = (float) atof( char_ptr ); } @@ -141,13 +135,11 @@ ivas_error IsmFileReader_readNextFrame( return IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT; } -#ifdef FIX_ISM_METADATA_READER if ( char_ptr != NULL ) { /* Too many values provided in one line */ return IVAS_ERR_ISM_FILE_READER_INVALID_METADATA_FORMAT; } -#endif ismMetadata->azimuth = meta_prm[0]; ismMetadata->elevation = meta_prm[1]; @@ -155,7 +147,6 @@ ivas_error IsmFileReader_readNextFrame( ismMetadata->spread = meta_prm[3]; ismMetadata->gainFactor = meta_prm[4]; -#ifdef FIX_ISM_METADATA_READER /* verify whether the read metadata values are in an expected range */ if ( ismMetadata->azimuth > 180 || ismMetadata->azimuth < -180 ) { @@ -181,7 +172,6 @@ ivas_error IsmFileReader_readNextFrame( { return IVAS_ERR_ISM_INVALID_METADATA_VALUE; } -#endif return IVAS_ERR_OK; } diff --git a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c index 0b386dd4194d5f64110498726e8dbd98427622a9..948da8a4259ed4da853bdd6ca0da696a6753f972 100644 --- a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c +++ b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c @@ -125,10 +125,8 @@ int main( int argc, char *argv[] ) int16_t *MixFrameWav; int16_t *input_buff; int16_t nChannels; -#ifdef FIX_I214_CLIPPING_STANDALONE_REND float tmp; int32_t noClipping; -#endif FILE *f_input; FILE *f_output; FILE *f_quat_traj; @@ -141,9 +139,7 @@ int main( int argc, char *argv[] ) MixFrameWav = count_malloc( 2 * L_FRAME48k * sizeof( int16_t ) ); input_buff = count_malloc( MAX_CICP_CHANNELS * L_FRAME48k * sizeof( int16_t ) ); nChannels = 0; -#ifdef FIX_I214_CLIPPING_STANDALONE_REND noClipping = 0; -#endif for ( i = 0; i < 2 * L_FRAME48k; i++ ) { @@ -327,21 +323,14 @@ int main( int argc, char *argv[] ) } st_ivas->hDecoderConfig->Opt_Headrotation = TRUE; } -#ifdef EXT_RENDERER else { st_ivas->hDecoderConfig->Opt_Headrotation = 0; } -#endif /* Init limiter */ -#ifdef FIX_I214_CLIPPING_STANDALONE_REND st_ivas->hLimiter = ivas_limiter_open( NumLdspks, st_ivas->hDecoderConfig->output_Fs ); st_ivas->hDecoderConfig->nchan_out = NumLdspks; -#else - st_ivas->hLimiter = ivas_limiter_open( nChannels, st_ivas->hDecoderConfig->output_Fs ); - st_ivas->hDecoderConfig->nchan_out = nChannels; -#endif st_ivas->hLimiter->strong_saturation_count = 0; st_ivas->hLimiter->gain = 1.f; st_ivas->hLimiter->release_heuristic = 0.f; @@ -479,7 +468,6 @@ int main( int argc, char *argv[] ) { for ( nS = 0; nS < NumLdspks; nS++ ) { -#ifdef FIX_I214_CLIPPING_STANDALONE_REND #ifdef FIX_ITD tmp = output[nS][n] + 0.5f * sign( output[nS][n] ); #else @@ -496,13 +484,6 @@ int main( int argc, char *argv[] ) noClipping++; } MixFrameWav[n * NumLdspks + nS] = (int16_t) ( tmp ); -#else -#ifdef FIX_ITD - MixFrameWav[n *NumLdspks + nS] = (int16_t) ( output[nS][n] + 0.5f * sign( output[nS][n] ) ); -#else - MixFrameWav[n * NumLdspks + nS] = (int16_t) ( output[nS][n + offset] + 0.5f * sign( output[nS][n + offset] ) ); -#endif -#endif } } #ifdef FIX_ITD @@ -562,12 +543,10 @@ int main( int argc, char *argv[] ) #endif fprintf( stdout, "Done rendering %d frames.\n", nFrameCount ); -#ifdef FIX_I214_CLIPPING_STANDALONE_REND if ( noClipping > 0 ) { fprintf( stderr, "*** Clipping on %d samples.\n", noClipping ); } -#endif /* system( "pause" ); */ return 0; }