diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 8a66cc117cd2d374e5a84dd240763e06f60c93bd..3c8ce9aa0693eaf7deae3643b196ed06bdd00178 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -2376,20 +2376,14 @@ ivas_error ivas_ism_dec_config_fx( ivas_error ivas_ism_metadata_dec_create_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE const Word16 n_ISms, /* i : number of separately coded objects */ -#else - const Word16 n_ISms, /* i : number of objects */ -#endif Word32 element_brate_tmp[] /* o : element bitrate per object */ ); -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE void ivas_ism_reset_metadata_handle_dec_fx( ISM_METADATA_HANDLE hIsmMeta /* i/o: ISM metadata handle */ ); -#endif ivas_error ivas_sba_dec_reconfigure_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ UWord16 *nSamplesFlushed, /* o : number of samples flushed */ diff --git a/lib_com/options.h b/lib_com/options.h index 3dc3b085bc5dbb0c59be85ac10dd7909b138177f..dcaa4dfca393b77e3b60bd4c9a0acdc9146189ba 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -92,32 +92,17 @@ /* #################### Start BASOP porting switches ############################ */ #define FIX_1372_ISAR_POST_REND -#define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ -#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM -#endif - #define NONBE_FIX_984_OMASA_EXT_OUTPUT /* Nokia: issue #984: complete the OMASA EXT output implementation */ -#define FIX_1044_ISM_REND_MEMORY /* VA: issue 1044: Lower the memory of the ISM renderer handle. */ - #define USE_NEW_HRTF_BINARY_FILE_FORMAT /* Orange: to activate when decided to change the hrtf binary file format */ - #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ #define FIX_1741_REVERB_TIMES_Q_FORMAT /* Philips: reverberation times in Q26 format instead of Q31 */ #define FIX_1831_REVERB_REGRESSION /* Philips: fixes reverb regression issues */ #define FIX_1835_REVERB_ACTIVATION /* FhG: Modified reverberation activation logic and corrected factEQ calculation */ -#define NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST /* FhG: address issue 1037 */ -#define FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* FhG: move setting of pointers for parameter decoding so they are skipped in lost frames when they are not needed */ -#define NONBE_FIX_1056_ISM_RATE_SWITCH /* FhG: Fix #1056: fix TC buffer udpate on a ISM rate switch */ -#define NONBE_FIX_1075 /* FhG: fix segfault for bitrate switching + BINAURAL_ROOM_REVERB output in MC */ -#define NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB /* FhG: fix bug in TD MDCT-Stereo concealment */ -#define NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG /* VoiceAge: issue 1063: division by zero for angle_rot feature in the UNCLR classifier */ -#define FIX_1060_USAN_ARRAY_BOUNDS /* FhG: issue 1060: USAN array-bounds errors */ #define NONBE_FIX_SBA_SIGNALING_BITS_B /* FhG: issue 1061: option B: signal sba order additionally in OSBA */ -#define NONBE_FIX_1045_ISM_BITRATE_SWITCHING /* Eri: Difference between ROM/File HRTF in ISM bitrate switching */ -#define NONBE_FIX_1065_ISM_MD_HANDLE /* VA: issue 1065: Allocate only the necessary number of ISM MD decoder handles. */ #define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */ #define FIX_1053_REVERB_RECONFIGURATION /* Philips: issue 1053: fix for dynamic switching of acoustic environment */ + /* #################### End BASOP porting switches ############################ */ #endif diff --git a/lib_dec/dec_LPD_fx.c b/lib_dec/dec_LPD_fx.c index 03cc8b3ce6875efc4b22c2979ad5b095e200a319..5549cc809ad29574368e183f5c9d4d96a91604f3 100644 --- a/lib_dec/dec_LPD_fx.c +++ b/lib_dec/dec_LPD_fx.c @@ -718,20 +718,12 @@ void decoder_LPD_fx( FOR( k = 0; k < 2; k++ ) { -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - /* Set pointer to parameters */ - prm = param + ( k * DEC_NPRM_DIV ); - - /* Stability Factor */ -#endif IF( bfi == 0 ) { -#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* Set pointer to parameters */ prm = param + ( k * DEC_NPRM_DIV ); /* Stability Factor */ -#endif st->stab_fac_fx = lsf_stab_fx( &lsf[( ( k + 1 ) ) * M], &lsf[k * M], 0, L_FRAME ); move16(); } diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 80eacd386529de9a74f56b8c7ff151a12e4be224..c0a099b87e6eb0bab02797146919f6f8d8c7b9e5 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -4401,15 +4401,11 @@ void decoder_tcx_invQ_fx( tnsSize = 0; move16(); -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - prm_target = NULL; /* just to suppress MSVC warnigs */ -#else /* just to suppress MSVC warnigs */ prm_target = NULL; prm_ltp = NULL; prm_tns = NULL; prm_sqQ = NULL; -#endif /*-----------------------------------------------------------------* * Initializations @@ -4433,10 +4429,6 @@ void decoder_tcx_invQ_fx( move16(); } -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - prm_ltp = &prm[1 + NOISE_FILL_RANGES]; - prm_tns = prm_ltp + LTPSIZE; -#endif gainCompensate = ONE_IN_Q14; move16(); @@ -4452,10 +4444,8 @@ void decoder_tcx_invQ_fx( IF( !bfi ) { -#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_ltp = &prm[1 + NOISE_FILL_RANGES]; prm_tns = prm_ltp + LTPSIZE; -#endif index = prm[0]; move16(); @@ -4477,11 +4467,6 @@ void decoder_tcx_invQ_fx( move16(); } -#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI - prm_hm = prm_tns + tnsSize; - prm_sqQ = prm_hm + NPRM_CTX_HM; - *prm_sqQ1 = prm_sqQ; -#endif /*-----------------------------------------------------------* * Spectrum data * @@ -4489,11 +4474,9 @@ void decoder_tcx_invQ_fx( IF( !bfi ) { -#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_hm = prm_tns + tnsSize; prm_sqQ = prm_hm + NPRM_CTX_HM; *prm_sqQ1 = prm_sqQ; -#endif /*-----------------------------------------------------------* * Context HM * *-----------------------------------------------------------*/ diff --git a/lib_dec/er_dec_tcx_fx.c b/lib_dec/er_dec_tcx_fx.c index c210cd29834a9c1abee1d778c356d8f1172939f8..aeb4c0783a0ff156761eef9263cbc451a1a354cf 100644 --- a/lib_dec/er_dec_tcx_fx.c +++ b/lib_dec/er_dec_tcx_fx.c @@ -1766,11 +1766,7 @@ void con_tcx_ivas_fx( alpha_inv = sub( 16384 /*Q.0f in Q14*/, alpha_delayed ); /*Q14*/ -#ifdef NON_BE_FIX_1041_USE_OLD_CNG_LSPS_IF_NONSTAB E_LPC_a_lsp_conversion( A_local, lsp_local, st->lspold_cng, M ); -#else - E_LPC_a_lsp_conversion( A_local, lsp_local, lsp_local, M ); -#endif FOR( i = 0; i < M; i++ ) { diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 877a4dfdb279716ff359a123db4e2148ec1461bf..53f1c271a5df5422cd6c7e9fb14dcab26f9059d1 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -1436,81 +1436,61 @@ ivas_error ivas_binRenderer_open_fx( #else IF( ( EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) || EQ_32( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) ) && EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #endif - { - IF( NE_32( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ) { - return error; - } + IF( NE_32( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes_fx, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections_fx ) ), IVAS_ERR_OK ) ){ + return error; +} - /* initialize the dmx matrix */ -#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM +/* initialize the dmx matrix */ #ifndef FIX_1053_REVERB_RECONFIGURATION - IF( NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) - { - FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) - { - FOR( k = 0; k < hBinRenderer->nInChannels; k++ ) - { - hBinRenderer->hReverb->dmxmtx_fx[chIdx][k] = dmxmtx_table_fx[chIdx][k]; - move32(); - } - } - } -#endif -#else - FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) +IF( NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) +{ + FOR( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) + { + FOR( k = 0; k < hBinRenderer->nInChannels; k++ ) { - FOR( k = 0; k < hBinRenderer->nInChannels; k++ ) - { - hBinRenderer->hReverb->dmxmtx_fx[chIdx][k] = dmxmtx_table_fx[chIdx][k]; - move32(); - } + hBinRenderer->hReverb->dmxmtx_fx[chIdx][k] = dmxmtx_table_fx[chIdx][k]; + move32(); } -#endif - } - ELSE - { - hBinRenderer->hReverb = NULL; } +} +#endif +} +ELSE +{ + hBinRenderer->hReverb = NULL; +} - hBinRenderer->hEFAPdata = NULL; +hBinRenderer->hEFAPdata = NULL; -#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM - IF( hBinRenderer->hReverb != NULL && NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) -#else - IF( hBinRenderer->hReverb != NULL ) -#endif +IF( hBinRenderer->hReverb != NULL && NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) +{ + test(); + test(); + IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) { - test(); - test(); -#ifdef NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM - IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 ) -#else - IF( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && NE_16( hBinRenderer->nInChannels, HOA3_CHANNELS ) ) -#endif + FOR( k = 0; k < 11; k++ ) { - FOR( k = 0; k < 11; k++ ) - { - ivas_dirac_dec_get_response_fx( extract_l( L_shr_r( ls_azimuth_CICP19_fx[k], 22 ) ), extract_l( L_shr_r( ls_elevation_CICP19_fx[k], 22 ) ), hBinRenderer->hReverb->foa_enc_fx[k], 1, Q29 ); - // Q29: hBinRenderer->hReverb->foa_enc_fx[k] - } + ivas_dirac_dec_get_response_fx( extract_l( L_shr_r( ls_azimuth_CICP19_fx[k], 22 ) ), extract_l( L_shr_r( ls_elevation_CICP19_fx[k], 22 ) ), hBinRenderer->hReverb->foa_enc_fx[k], 1, Q29 ); + // Q29: hBinRenderer->hReverb->foa_enc_fx[k] } - ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) + } + ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) + { + IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth_fx, st_ivas->hIntSetup.ls_elevation_fx, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) ) { - IF( NE_32( ( error = efap_init_data_fx( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth_fx, st_ivas->hIntSetup.ls_elevation_fx, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ), IVAS_ERR_OK ) ) - { - return error; - } - - /* Copy handles to bin renderer handle*/ - hBinRenderer->hEFAPdata = st_ivas->hEFAPdata; + return error; } + + /* Copy handles to bin renderer handle*/ + hBinRenderer->hEFAPdata = st_ivas->hEFAPdata; } +} - /* Copy the handles to main handle */ - st_ivas->hBinRenderer = hBinRenderer; +/* Copy the handles to main handle */ +st_ivas->hBinRenderer = hBinRenderer; - return error; +return error; } /*------------------------------------------------------------------------- diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 1713ec0bd19d391f3d20eca5018cad134da4fde0..370254a4eddb8775e5cee3cfa022f1349d36ec58 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -3777,18 +3777,10 @@ void ivas_dirac_dec_render_sf_fx( g_fx = Madd_32_16( Mpy_32_16_1( gain_fx, *w1_fx ), prev_gain_fx, w2_fx ); // Q15 FOR( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ ) { -#ifdef FIX_1060_USAN_ARRAY_BOUNDS Cldfb_RealBuffer_fx[j2][k][l] = Madd_32_32( Cldfb_RealBuffer_fx[j2][k][l], g_fx, *tc_re_fx ); -#else - Cldfb_RealBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l] = Madd_32_32( Cldfb_RealBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l], g_fx, *tc_re_fx ); -#endif move32(); tc_re_fx++; -#ifdef FIX_1060_USAN_ARRAY_BOUNDS Cldfb_ImagBuffer_fx[j2][k][l] = Madd_32_32( Cldfb_ImagBuffer_fx[j2][k][l], g_fx, *tc_im_fx ); -#else - Cldfb_ImagBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l] = Madd_32_32( Cldfb_ImagBuffer_fx[j2][0][k * hSpatParamRendCom->num_freq_bands + l], g_fx, *tc_im_fx ); -#endif move32(); tc_re_fx++; } diff --git a/lib_dec/ivas_init_dec_fx.c b/lib_dec/ivas_init_dec_fx.c index 218501a39edd0939ccb3f7ba478a92a9a8e6045e..7d623dc8c372410834a9a0eca346b1516ff53d9f 100644 --- a/lib_dec/ivas_init_dec_fx.c +++ b/lib_dec/ivas_init_dec_fx.c @@ -1508,11 +1508,7 @@ ivas_error ivas_init_decoder_fx( } } -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, element_brate_tmp ) ) != IVAS_ERR_OK ) -#else - IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nSCE, element_brate_tmp ) ), IVAS_ERR_OK ) ) -#endif { return error; } @@ -1919,7 +1915,6 @@ ivas_error ivas_init_decoder_fx( reset_indices_dec( st_ivas->hSCE[0]->hCoreCoder[0] ); -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { if ( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) @@ -1929,14 +1924,11 @@ ivas_error ivas_init_decoder_fx( } else { -#endif IF( NE_32( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, 1, NULL ) ), IVAS_ERR_OK ) ) { return error; } -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE } -#endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { @@ -2445,7 +2437,6 @@ ivas_error ivas_init_decoder_fx( SrcSpatial_p->q_Pos_p = Q31; move16(); } -#ifdef NONBE_FIX_1075 IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) @@ -2453,7 +2444,6 @@ ivas_error ivas_init_decoder_fx( return error; } } -#endif /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) @@ -2570,7 +2560,6 @@ ivas_error ivas_init_decoder_fx( SrcSpatial_p->q_Pos_p = Q31; move16(); } -#ifdef NONBE_FIX_1075 IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) @@ -2578,7 +2567,6 @@ ivas_error ivas_init_decoder_fx( return error; } } -#endif } } diff --git a/lib_dec/ivas_ism_dec_fx.c b/lib_dec/ivas_ism_dec_fx.c index febc6af54fd452401629ebdd1b61bb330a426da9..95ee97b2d9fc38b0b694a0bda15b2ade8646076c 100644 --- a/lib_dec/ivas_ism_dec_fx.c +++ b/lib_dec/ivas_ism_dec_fx.c @@ -142,16 +142,9 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( { test(); test(); -#ifndef NONBE_FIX_1056_ISM_RATE_SWITCH - test(); -#endif -/* transfer subframe info from DirAC or ParamMC to central tc buffer */ -#ifdef NONBE_FIX_1056_ISM_RATE_SWITCH + /* transfer subframe info from DirAC or ParamMC to central tc buffer */ /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ IF( EQ_32( last_ism_mode, ISM_MODE_PARAM ) && st_ivas->hSpatParamRendCom != NULL && NE_32( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) ) -#else - IF( EQ_32( last_ism_mode, ISM_MODE_PARAM ) && st_ivas->hSpatParamRendCom != NULL && ( NE_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) && NE_32( st_ivas->renderer_type, RENDERER_DISABLE ) ) ) -#endif { st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; move16(); @@ -278,25 +271,12 @@ static ivas_error ivas_ism_bitrate_switching_dec_fx( } /* Close the TD Binaural renderer */ -#ifdef NONBE_FIX_1045_ISM_BITRATE_SWITCHING ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { ivas_reverb_close( &st_ivas->hReverb ); } -#else - IF( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE ) - { - ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); - st_ivas->hHrtfTD = NULL; - - IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) - { - ivas_reverb_close( &st_ivas->hReverb ); - } - } -#endif } ELSE { diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index fcc22054a5f9cbfc62857fc5e6af1205e1f40503..17bc36346f7f6efd58cdafdbbf5095f71e52c5cd 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -780,7 +780,6 @@ ivas_error ivas_ism_metadata_dec_fx( return IVAS_ERR_OK; } -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE /*-------------------------------------------------------------------* * ivas_ism_reset_metadata_handle_dec() @@ -826,7 +825,6 @@ void ivas_ism_reset_metadata_handle_dec_fx( return; } -#endif /*------------------------------------------------------------------------- * ivas_ism_metadata_dec_create() @@ -835,12 +833,8 @@ void ivas_ism_reset_metadata_handle_dec_fx( *-------------------------------------------------------------------------*/ ivas_error ivas_ism_metadata_dec_create_fx( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE - const Word16 n_ISms, /* i : number of separately coded objects */ -#else - const Word16 n_ISms, /* i : number of objects */ -#endif + Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ + const Word16 n_ISms, /* i : number of separately coded objects */ Word32 element_brate_tmp[] /* o : element bitrate per object */ ) { @@ -848,61 +842,19 @@ ivas_error ivas_ism_metadata_dec_create_fx( ivas_error error; /* allocate ISM metadata handles */ -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE FOR( ch = 0; ch < n_ISms; ch++ ) -#else - FOR( ch = 0; ch < MAX_NUM_OBJECTS; ch++ ) -#endif { -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( st_ivas->hIsmMetaData[ch] == NULL ) /* note: the handle can be allocated in OMASA bitrate switching from ISM_MASA_MODE_xxx_ONE_OBJ to ISM_MASA_MODE_DISC mode for 'ch==0' */ { -#endif IF( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM MetaData\n" ) ); } -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE } -#endif -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[ch] ); -#else - st_ivas->hIsmMetaData[ch]->last_ism_metadata_flag = 0; - move16(); - st_ivas->hIsmMetaData[ch]->position_angle.last_angle1_idx = 0; - move16(); - st_ivas->hIsmMetaData[ch]->position_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); - move16(); - st_ivas->hIsmMetaData[ch]->orientation_angle.last_angle1_idx = 0; - move16(); - st_ivas->hIsmMetaData[ch]->orientation_angle.last_angle2_idx = 1 << ( ISM_ELEVATION_NBITS - 1 ); - move16(); - st_ivas->hIsmMetaData[ch]->last_radius_idx = 8; /* Init to radius 1.0 */ - move16(); - - st_ivas->hIsmMetaData[ch]->last_true_azimuth_fx = 0; - move32(); - st_ivas->hIsmMetaData[ch]->last_true_elevation_fx = 0; - move32(); - st_ivas->hIsmMetaData[ch]->last_azimuth_fx = 0; - move32(); - st_ivas->hIsmMetaData[ch]->last_elevation_fx = 0; - move32(); - - st_ivas->hIsmMetaData[ch]->ism_imp = -1; - move16(); - st_ivas->hIsmMetaData[ch]->ism_md_null_flag = 0; - move16(); - st_ivas->hIsmMetaData[ch]->ism_md_lowrate_flag = 0; - move16(); - - ivas_ism_reset_metadata( st_ivas->hIsmMetaData[ch] ); -#endif } -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE /* sanity freeing - it can happen only in reconfiguration when a smaller number of handles than before is requested */ FOR( ; ch < MAX_NUM_OBJECTS; ch++ ) { @@ -913,7 +865,6 @@ ivas_error ivas_ism_metadata_dec_create_fx( } } -#endif IF( element_brate_tmp != NULL ) { IF( NE_32( ( error = ivas_ism_config_fx( st_ivas->hDecoderConfig->ivas_total_brate, n_ISms, n_ISms, NULL, 0, NULL, NULL, element_brate_tmp, NULL, NULL, 0 ) ), IVAS_ERR_OK ) ) diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 67978cd0ce8bc437d193a4d92b14ea0f1506e013..1fcdbff848069ea789a52af1a7adf910bdfacf65 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -1436,15 +1436,7 @@ static ivas_error ivas_mc_dec_reconfig_fx( test(); IF( st_ivas->hBinRendererTd != NULL && ( NE_16( st_ivas->renderer_type, RENDERER_BINAURAL_OBJECTS_TD ) ) ) { -#ifdef NONBE_FIX_1045_ISM_BITRATE_SWITCHING ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); -#else - IF( EQ_16( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM, TRUE ) ) - { - ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); - st_ivas->hHrtfTD = NULL; - } -#endif } IF( st_ivas->hDiracDecBin[0] != NULL ) @@ -1476,7 +1468,6 @@ static ivas_error ivas_mc_dec_reconfig_fx( { return error; } -#ifdef NONBE_FIX_1075 IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) @@ -1484,7 +1475,6 @@ static ivas_error ivas_mc_dec_reconfig_fx( return error; } } -#endif IF( EQ_16( st_ivas->hIntSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { IF( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper, 1 ) ) != IVAS_ERR_OK ) diff --git a/lib_dec/ivas_omasa_dec_fx.c b/lib_dec/ivas_omasa_dec_fx.c index 7ed8aac108f715e7747c0dbb5463a3fcf3adc308..e0401b941d06a817a057d2fc6d9f70351acc3cb2 100644 --- a/lib_dec/ivas_omasa_dec_fx.c +++ b/lib_dec/ivas_omasa_dec_fx.c @@ -569,7 +569,6 @@ ivas_error ivas_omasa_dec_config_fx( IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_EXTERNAL ) ) { /* the full number of hIsmMetaData are needed for EXT output */ -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE IF( st_ivas->hIsmMetaData[0] == NULL ) { IF( ( error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ) ) != IVAS_ERR_OK ) @@ -584,20 +583,6 @@ ivas_error ivas_omasa_dec_config_fx( ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[k] ); } } -#else - move16(); - n_MD = st_ivas->nchan_ism; - ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); - - error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } - - ivas_ism_metadata_close( st_ivas->hIsmMetaData, n_MD ); -#endif } ELSE { @@ -616,21 +601,16 @@ ivas_error ivas_omasa_dec_config_fx( return error; } } -#ifdef NONBE_FIX_1065_ISM_MD_HANDLE ELSE { ivas_ism_reset_metadata_handle_dec_fx( st_ivas->hIsmMetaData[0] ); } -#endif } ELSE IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { n_MD = st_ivas->nchan_ism; move16(); -#ifndef NONBE_FIX_1065_ISM_MD_HANDLE - ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 ); -#endif error = ivas_ism_metadata_dec_create_fx( st_ivas, st_ivas->nchan_ism, NULL ); move32(); IF( NE_32( error, IVAS_ERR_OK ) ) @@ -717,149 +697,138 @@ ivas_error ivas_omasa_dec_config_fx( IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) { /* Allocate TD renderer for the objects in DISC mode */ - IF( st_ivas->hBinRendererTd == NULL ){ - IF( NE_32( ( error = ivas_td_binaural_open_fx( st_ivas, SrcInd, num_src ) ), IVAS_ERR_OK ) ){ + IF( st_ivas->hBinRendererTd == NULL ) + { + IF( NE_32( ( error = ivas_td_binaural_open_fx( st_ivas, SrcInd, num_src ) ), IVAS_ERR_OK ) ) + { return error; + } + IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + { + IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) + { + return error; + } + } + } + + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) + { + return error; + } } -#ifdef NONBE_FIX_1075 - IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + ELSE { - IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) + if ( st_ivas->hBinRendererTd != NULL ) { - return error; + /* TD renderer handle */ + ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); } + /* ISM renderer handle + ISM data handle */ + ivas_omasa_separate_object_renderer_close( st_ivas ); } -#endif } - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) + IF( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) ) { - return error; + IF( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ), IVAS_ERR_OK ) ) + { + return error; + } + + test(); + test(); + IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) + { + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) + { + return error; + } + } + ELSE + { + /* ISM renderer handle + ISM data handle */ + ivas_omasa_separate_object_renderer_close( st_ivas ); + } } - } - ELSE - { -#ifdef NONBE_FIX_1045_ISM_BITRATE_SWITCHING - if ( st_ivas->hBinRendererTd != NULL ) +#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT + IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) { - /* TD renderer handle */ - ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); + /* Allocate 'hIsmRendererData' handle */ + error = ivas_omasa_combine_separate_ism_with_masa_open_fx( st_ivas ); + move32(); + IF( NE_32( error, IVAS_ERR_OK ) ) + { + return error; + } } -#else - /* TD renderer handle */ - test(); - IF( st_ivas->hBinRendererTd != NULL && EQ_16( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM, TRUE ) ) + + IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) { - ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); + DIRAC_CONFIG_FLAG common_rend_config_flag; + IF( st_ivas->hSpatParamRendCom == NULL ) + { + common_rend_config_flag = DIRAC_OPEN; + } + ELSE + { + common_rend_config_flag = DIRAC_RECONFIGURE; + } + move32(); - st_ivas->hHrtfTD = NULL; + /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ + error = ivas_omasa_render_objects_from_mix_open_fx( st_ivas ); + move32(); + IF( NE_32( error, IVAS_ERR_OK ) ) + { + return error; + } + + error = ivas_spat_hSpatParamRendCom_config_fx( &st_ivas->hSpatParamRendCom, + common_rend_config_flag, 0, + st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs, 0, 0 ); + move32(); + IF( NE_32( error, IVAS_ERR_OK ) ) + { + return error; + } } #endif - /* ISM renderer handle + ISM data handle */ - ivas_omasa_separate_object_renderer_close( st_ivas ); - } -} - -IF( EQ_32( st_ivas->renderer_type, RENDERER_DIRAC ) ) -{ - IF( NE_32( ( error = ivas_dirac_dec_config_fx( st_ivas, DIRAC_RECONFIGURE ) ), IVAS_ERR_OK ) ) - { - return error; - } + /*-----------------------------------------------------------------* + * TD Decorrelator + *-----------------------------------------------------------------*/ - test(); - test(); - IF( EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_MASA_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_PARAM_ONE_OBJ ) || EQ_32( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) ) - { - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - IF( NE_32( ( error = ivas_omasa_separate_object_renderer_open( st_ivas ) ), IVAS_ERR_OK ) ) + IF( st_ivas->hDiracDecBin[0] != NULL ) { - return error; + IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ), IVAS_ERR_OK ) ) + { + return error; + } } - } - ELSE - { - /* ISM renderer handle + ISM data handle */ - ivas_omasa_separate_object_renderer_close( st_ivas ); - } -} -#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT -IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) ) -{ - /* Allocate 'hIsmRendererData' handle */ - error = ivas_omasa_combine_separate_ism_with_masa_open_fx( st_ivas ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } -} -IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) ) -{ - DIRAC_CONFIG_FLAG common_rend_config_flag; - IF( st_ivas->hSpatParamRendCom == NULL ) - { - common_rend_config_flag = DIRAC_OPEN; - } - ELSE - { - common_rend_config_flag = DIRAC_RECONFIGURE; - } - move32(); + /*-----------------------------------------------------------------* + * CLDFB instances + *-----------------------------------------------------------------*/ - /* Allocate 'hIsmRendererData' handle and memory for delay buffer within 'hMasaIsmData' */ - error = ivas_omasa_render_objects_from_mix_open_fx( st_ivas ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } + IF( NE_32( ( error = ivas_cldfb_dec_reconfig_fx( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ), IVAS_ERR_OK ) ) + { + return error; + } - error = ivas_spat_hSpatParamRendCom_config_fx( &st_ivas->hSpatParamRendCom, - common_rend_config_flag, 0, - st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs, 0, 0 ); - move32(); - IF( NE_32( error, IVAS_ERR_OK ) ) - { - return error; - } -} -#endif -/*-----------------------------------------------------------------* - * TD Decorrelator - *-----------------------------------------------------------------*/ + /*-----------------------------------------------------------------* + * floating-point output audio buffers + *-----------------------------------------------------------------*/ -IF( st_ivas->hDiracDecBin[0] != NULL ) -{ - IF( NE_32( ( error = ivas_td_decorr_reconfig_dec( st_ivas->ivas_format, st_ivas->hDecoderConfig->ivas_total_brate, st_ivas->nchan_transport, st_ivas->hDecoderConfig->output_Fs, &( st_ivas->hDiracDecBin[0]->hTdDecorr ), &( st_ivas->hDiracDecBin[0]->useTdDecorr ) ) ), IVAS_ERR_OK ) ) - { - return error; + nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) + { + return error; + } } -} -/*-----------------------------------------------------------------* - * CLDFB instances - *-----------------------------------------------------------------*/ - -IF( NE_32( ( error = ivas_cldfb_dec_reconfig_fx( st_ivas, 2, numCldfbAnalyses_old, numCldfbSyntheses_old ) ), IVAS_ERR_OK ) ) -{ - return error; -} - -/*-----------------------------------------------------------------* - * floating-point output audio buffers - *-----------------------------------------------------------------*/ - -nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); -IF( NE_32( ( error = ivas_output_buff_dec_fx( st_ivas->p_output_fx, nchan_out_buff_old, nchan_out_buff ) ), IVAS_ERR_OK ) ) -{ - return error; -} -} - -return IVAS_ERR_OK; + return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_sba_dec_fx.c b/lib_dec/ivas_sba_dec_fx.c index b817893f22954ab4f363ad03c0b4d0d3af3e3f92..59bc705b60cc534710af63fc2e4d99a1666f753e 100644 --- a/lib_dec/ivas_sba_dec_fx.c +++ b/lib_dec/ivas_sba_dec_fx.c @@ -564,7 +564,6 @@ ivas_error ivas_sba_dec_reconfigure_fx( { return error; } -#ifdef NONBE_FIX_1075 IF( EQ_32( st_ivas->hOutSetup.output_config, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { IF( NE_32( ( error = ivas_reverb_open_fx( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ), IVAS_ERR_OK ) ) @@ -572,7 +571,6 @@ ivas_error ivas_sba_dec_reconfigure_fx( return error; } } -#endif } } @@ -595,15 +593,7 @@ ivas_error ivas_sba_dec_reconfigure_fx( /* Time Domain binaural renderer handle */ IF( st_ivas->hBinRendererTd != NULL ) { -#ifdef NONBE_FIX_1045_ISM_BITRATE_SWITCHING ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); -#else - IF( st_ivas->hBinRendererTd->HrFiltSet_p->ModelParams.modelROM == TRUE ) - { - ivas_td_binaural_close_fx( &st_ivas->hBinRendererTd ); - st_ivas->hHrtfTD = NULL; - } -#endif } nchan_transport_old = add( nchan_transport_old, st_ivas->nchan_ism ); /*Q0*/ st_ivas->ism_mode = ISM_MODE_NONE; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index d8654af80d8d06938c815b4a791371733ddd4457..339d7f0347c83791e3282be3a5a058610eaef9e8 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -853,18 +853,10 @@ typedef struct ivas_lfe_dec_data_structure typedef struct renderer_struct { -#ifdef FIX_1044_ISM_REND_MEMORY Word32 prev_gains_fx[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; /*Q30*/ -#else - Word32 prev_gains_fx[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS]; /*Q30*/ -#endif - Word16 *interpolator_fx; /*Q15*/ + Word16 *interpolator_fx; /*Q15*/ Word16 interpolator_len; -#ifdef FIX_1044_ISM_REND_MEMORY Word32 gains_fx[MAX_NUM_OBJECTS][MAX_OUTPUT_CHANNELS]; /*Q30*/ -#else - Word32 gains_fx[MAX_CICP_CHANNELS - 1][MAX_OUTPUT_CHANNELS]; /*Q30*/ -#endif } ISM_RENDERER_DATA, *ISM_RENDERER_HANDLE; diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index 1b5b46d66e167a2729c068a6f16788938c4e82b8..f5155cacfee78d7f9d817a79c846e564104e34ea 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -930,7 +930,6 @@ void concealment_decode_fix( /* sign randomization */ FOR( i = 0; i < N; i++ ) { -#ifdef NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST Word16 rnd; rnd = own_random_fix( seed ); IF( GE_16( rnd, 0 ) ) @@ -941,9 +940,6 @@ void concealment_decode_fix( { sign = -1; } -#else - sign = add( shl( shr( own_random_fix( seed ), 15 ), 1 ), 1 ); -#endif if ( EQ_16( sign, -1 ) ) { invkoef[i] = L_negate( invkoef[i] ); diff --git a/lib_enc/ivas_stereo_dft_enc_itd_fx.c b/lib_enc/ivas_stereo_dft_enc_itd_fx.c index 373f4287ba0a60d36a6fe9615f63afe4970d228b..aee6e3a6b3d2365b45c45fd7b2b8994097cebacd 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_itd_fx.c @@ -973,10 +973,8 @@ void stereo_dft_enc_compute_itd_fx( Word32 cng_xcorr_filt; Word16 cng_xcorr_filt_e; -#ifdef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG Word32 sum_nrg_delta; Word16 sum_nrg_delta_e; -#endif Word16 prev_itd_max; Word16 itd_max_flip; @@ -1240,9 +1238,6 @@ void stereo_dft_enc_compute_itd_fx( move32(); xcorr_abs[i] = Sqrt32( xcorr_abs[i], &xcorr_abs_e[i] ); move32(); -#ifndef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG - /* VM: prod_LL tends to overflow, better to replace with sum(log(prod_L)) and retrain the classifier */ -#endif prod_LL = prod_L; move32(); prod_LL_e = prod_L_e; @@ -1390,7 +1385,6 @@ void stereo_dft_enc_compute_itd_fx( hStereoClassif->xtalk_fv_fx[E_gainIPD] = L_shr_r( g_IPD, 10 ); // Q15 move32(); -#ifdef NONBE_FIX_1063_DIV_BY_ZERO_SUMNRG sum_nrg_delta = BASOP_Util_Add_Mant32Exp( sum_nrg_L, sum_nrg_L_e, L_negate( sum_nrg_R ), sum_nrg_R_e, &sum_nrg_delta_e ); IF( GE_32( sum_nrg_delta, 0 ) ) { @@ -1404,15 +1398,6 @@ void stereo_dft_enc_compute_itd_fx( L_temp2 = BASOP_Util_Divide3232_Scale_newton( grand_dot_prod_real, sum_nrg_delta, &L_temp2_e ); L_temp2_e = add( L_temp2_e, sub( add( grand_dot_prod_real_e, 1 ), sum_nrg_delta_e ) ); angle_rot = L_abs( BASOP_util_atan( L_shr_r_sat( L_temp2, ( sub( 6, L_temp2_e ) ) ) ) ); // Q14 -#else - // angle_rot = fabsf( atanf( 2.0f * ( grand_dot_prod_real ) / ( sum_nrg_L - sum_nrg_R + 1.0f ) ) ); - L_temp = BASOP_Util_Add_Mant32Exp( sum_nrg_L, sum_nrg_L_e, L_negate( sum_nrg_R ), sum_nrg_R_e, &L_temp_e ); - L_temp = BASOP_Util_Add_Mant32Exp( L_temp, L_temp_e, MAX_32, 0, &L_temp_e ); - L_temp2 = BASOP_Util_Divide3232_Scale_newton( grand_dot_prod_real, L_temp, &L_temp2_e ); - L_temp2_e = add( L_temp2_e, sub( add( grand_dot_prod_real_e, 1 ), L_temp_e ) ); - angle_rot = L_abs( BASOP_util_atan( L_shr_r_sat( L_temp2, ( sub( 6, L_temp2_e ) ) ) ) ); // Q14 - // angle_rot = L_abs( BASOP_util_atan2( grand_dot_prod_real, L_temp, sub( add( grand_dot_prod_real_e, 1 ), L_temp_e ) ) ); // Q13 -#endif hStereoClassif->unclr_fv_fx[E_angle_rot] = L_shl( angle_rot, 1 ); // Q15 move32();