Loading lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ #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 */ /* #################### End BASOP porting switches ############################ */ #endif lib_dec/waveadjust_fec_dec_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -916,7 +916,7 @@ void concealment_decode_fix( Word16 i; Word16 N = hPlcInfo->L_frameTCX; Word16 *seed = &( hPlcInfo->seed ); Word16 sign; Word16 sign = 0; move16(); IF( hPlcInfo->concealment_method == TCX_NONTONAL ) /* #define TCX_NONTONAL 0 */ Loading lib_enc/ivas_stereo_dft_enc_itd_fx.c +23 −2 Original line number Diff line number Diff line Loading @@ -973,7 +973,10 @@ 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; Loading Loading @@ -1237,7 +1240,9 @@ 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; Loading Loading @@ -1385,6 +1390,21 @@ 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 ) ) { sum_nrg_delta = L_max( sum_nrg_delta, L_shl_sat( 1, sum_nrg_delta_e ) ); } ELSE { sum_nrg_delta = L_min( sum_nrg_delta, L_negate( L_shl_sat( 1, sum_nrg_delta_e ) ) ); } // angle_rot = fabsf( atanf( 2.0f * ( grand_dot_prod_real ) / sum_nrg_delta ) ); 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 ); Loading @@ -1392,6 +1412,7 @@ void stereo_dft_enc_compute_itd_fx( 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(); Loading Loading
lib_com/options.h +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ #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 */ /* #################### End BASOP porting switches ############################ */ #endif
lib_dec/waveadjust_fec_dec_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -916,7 +916,7 @@ void concealment_decode_fix( Word16 i; Word16 N = hPlcInfo->L_frameTCX; Word16 *seed = &( hPlcInfo->seed ); Word16 sign; Word16 sign = 0; move16(); IF( hPlcInfo->concealment_method == TCX_NONTONAL ) /* #define TCX_NONTONAL 0 */ Loading
lib_enc/ivas_stereo_dft_enc_itd_fx.c +23 −2 Original line number Diff line number Diff line Loading @@ -973,7 +973,10 @@ 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; Loading Loading @@ -1237,7 +1240,9 @@ 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; Loading Loading @@ -1385,6 +1390,21 @@ 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 ) ) { sum_nrg_delta = L_max( sum_nrg_delta, L_shl_sat( 1, sum_nrg_delta_e ) ); } ELSE { sum_nrg_delta = L_min( sum_nrg_delta, L_negate( L_shl_sat( 1, sum_nrg_delta_e ) ) ); } // angle_rot = fabsf( atanf( 2.0f * ( grand_dot_prod_real ) / sum_nrg_delta ) ); 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 ); Loading @@ -1392,6 +1412,7 @@ void stereo_dft_enc_compute_itd_fx( 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(); Loading