diff --git a/lib_com/options.h b/lib_com/options.h index 6f0d8e55eecabd7851829ca66e771ef0e0d4ba91..8af7e847fd7d4f7af581a1ea5c14cc6cdfb942c4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -99,6 +99,8 @@ /* any switch which is non-be wrt. TS 26.251 V3.0 */ +#define NONBE_MR2809 + /* ##################### End NON-BE switches ########################### */ /* ################## End MAINTENANCE switches ######################### */ diff --git a/lib_enc/ivas_rom_enc.h b/lib_enc/ivas_rom_enc.h index cd296fa140467f90180a9b65c1ce700f5faa8e5c..fef07112675b0e448de31c2a675e52f11e92211a 100644 --- a/lib_enc/ivas_rom_enc.h +++ b/lib_enc/ivas_rom_enc.h @@ -50,8 +50,13 @@ extern const Word32 unclr_coef_td[]; extern const Word16 xtalk_isel_td[]; extern const Word32 xtalk_mean_td[]; +#ifdef NONBE_MR2809 +extern const Word32 xtalk_factor_td_m[]; +extern const Word16 xtalk_factor_td_e[]; +#else extern const Word32 xtalk_scale_td[]; extern const Word32 xtalk_coef_td[]; +#endif extern const Word16 xtalk_isel_dft[]; extern const Word32 xtalk_mean_dft_q15[]; extern const Word32 xtalk_scale_dft_q15[]; diff --git a/lib_enc/ivas_rom_enc_fx.c b/lib_enc/ivas_rom_enc_fx.c index 6829a16ce35006c46f3b578b8eab47c815d25f9f..7b1c8889509484d386fb54e5de301e38ab14e8e0 100644 --- a/lib_enc/ivas_rom_enc_fx.c +++ b/lib_enc/ivas_rom_enc_fx.c @@ -98,6 +98,18 @@ const Word32 xtalk_mean_td[SIZE_XTALK_ISEL_TD] = /*Q15*/ 19572, 4323, 44674958, 20928, 248554, 5077, 123099, 19205, 217973, 57391, 22648, 21, 23142, 342411, 59, 612, -71224 }; +#ifdef NONBE_MR2809 +const Word32 xtalk_factor_td_m[SIZE_XTALK_ISEL_TD] = +{ + 1699245373, 1831181873, 1809297797, -1237097441, 1524499779, 1779553202, -1210195954, 1749773419, + 2137615296, -1823588164, -1184548129, -1761774848, 2065624539, -1152440556, -1625161800, 1263996665, + 1129562195 +}; +const Word16 xtalk_factor_td_e[SIZE_XTALK_ISEL_TD] = +{ + -4, 1, -12, -1, -7, -2, -5, -4, 0, 0, -2, 6, -2, -11, 11, -7, -1 +}; +#else const Word32 xtalk_scale_td[SIZE_XTALK_ISEL_TD] = /*Q15*/ { 37220, 2553, 16147962, 18786, 191263, 13110, 139310, 20547, 45408, 60617, 17627, 43, 9123, 2070239, 88, 21549, 68968 @@ -107,6 +119,7 @@ const Word32 xtalk_coef_td[SIZE_XTALK_ISEL_TD] = /*Q15*/ { 1841, 4353, 3322, -5411, 1061, 2716, -2453, 1046, 45199, -51474, -2431, -2245, 2194, -542, -135853, 99, 18138 }; +#endif const Word16 xtalk_isel_dft[SIZE_XTALK_ISEL_DFT] = { E_clas, E_gainILD, E_gainIPD, E_angle_rot, E_g_pred, E_d_prodL_prodR, E_sum_xcorr, E_xcorr_itd_value, E_gphat_d_itd2, E_gphat_ratio_m1_m2, E_gphat_m2_m2 diff --git a/lib_enc/ivas_stereo_classifier_fx.c b/lib_enc/ivas_stereo_classifier_fx.c index 9538302fab4ef171ab7b8c3aad90a2437f8a7733..d7e822f0fd76fc0c767e1e344d5d3e7a4216e3c0 100644 --- a/lib_enc/ivas_stereo_classifier_fx.c +++ b/lib_enc/ivas_stereo_classifier_fx.c @@ -842,7 +842,11 @@ void stereo_classifier_features_ivas_fx( ELSE { hStereoClassif->xtalk_fv_fx[E_d_ps_diff] = L_abs( L_sub( L_shr( hStereoClassif->ps_diff_ch1_fx, sub( 16, hStereoClassif->ps_diff_ch1_e ) ) /*q15*/, L_shr( hStereoClassif->ps_diff_ch2_fx, sub( 16, hStereoClassif->ps_diff_ch2_e ) ) /*q15*/ ) ); /*q15*/ - hStereoClassif->xtalk_fv_fx[E_d_ps_sta] = L_abs( L_sub( L_shr( hStereoClassif->ps_sta_ch1_fx, sub( 16, hStereoClassif->ps_sta_ch1_e ) ) /*q15*/, L_shr( hStereoClassif->ps_sta_ch2_fx, sub( 16, hStereoClassif->ps_sta_ch1_e ) ) /*q15*/ ) ); /*q15*/ +#ifdef NONBE_MR2809 + hStereoClassif->xtalk_fv_fx[E_d_ps_sta] = L_abs( L_sub( L_shr( hStereoClassif->ps_sta_ch1_fx, sub( 16, hStereoClassif->ps_sta_ch1_e ) ) /*q15*/, L_shr( hStereoClassif->ps_sta_ch2_fx, sub( 16, hStereoClassif->ps_sta_ch2_e ) ) /*q15*/ ) ); /*q15*/ +#else + hStereoClassif->xtalk_fv_fx[E_d_ps_sta] = L_abs( L_sub( L_shr( hStereoClassif->ps_sta_ch1_fx, sub( 16, hStereoClassif->ps_sta_ch1_e ) ) /*q15*/, L_shr( hStereoClassif->ps_sta_ch2_fx, sub( 16, hStereoClassif->ps_sta_ch1_e ) ) /*q15*/ ) ); /*q15*/ +#endif } move32(); move32(); @@ -1146,12 +1150,21 @@ void xtalk_classifier_td_fx( move16(); /* mean & std removal */ +#ifdef NONBE_MR2809 + fvn = L_sub( hStereoClassif->xtalk_fv_fx[ind], xtalk_mean_td[i] ); + fvn = Mpy_32_32( fvn, xtalk_factor_td_m[i] ); // exp = 16 + 20 = 36 + exp = add( 16, xtalk_factor_td_e[i] ); + + /* LR */ + score = BASOP_Util_Add_Mant32Exp( score, score_exp, fvn, exp, &score_exp ); +#else fvn = BASOP_Util_Divide3232_Scale_newton( L_sub( hStereoClassif->xtalk_fv_fx[ind], xtalk_mean_td[i] ), xtalk_scale_td[i], &exp ); fvn = Mpy_32_32( fvn, xtalk_coef_td[i] ); // Q = 31-exp+15-31 = 15-exp exp = add( exp, 16 ); // exp = 31-(15-exp) = 16+exp /* LR */ score = BASOP_Util_Add_Mant32Exp( score, score_exp, fvn, exp, &score_exp ); +#endif } score = L_shl_sat( score, sub( score_exp, 3 ) ); // Q28 diff --git a/lib_enc/ivas_stereo_ica_enc_fx.c b/lib_enc/ivas_stereo_ica_enc_fx.c index c50ea4c0c8c457f8d6d660994b03571ac2e46da2..feb5ad596f7ec4b01fe4bc2bad8760dbc35da72f 100644 --- a/lib_enc/ivas_stereo_ica_enc_fx.c +++ b/lib_enc/ivas_stereo_ica_enc_fx.c @@ -2040,6 +2040,12 @@ void stereo_tca_enc_fx( move16(); sts[1]->q_inp32 = input_mem_loc_q; move16(); +#ifdef NONBE_MR2809 + sts[0]->q_old_inp32 = input_mem_loc_q; + move16(); + sts[1]->q_old_inp32 = input_mem_loc_q; + move16(); +#endif icaMemUpdate_fx( sts, hCPE, input_mem_loc_fx[0], input_mem_loc_fx[1], input_mem_loc_q, lMemRecalc, lMemRecalc_SCh, input_frame );