Loading lib_com/gs_gains_fx.c +27 −9 Original line number Diff line number Diff line Loading @@ -405,6 +405,7 @@ static void GSC_gain_adj( Fac_div = 102; move16(); #endif #ifdef OPT_NBE_2311_HARM_GSC_GAIN test(); IF( coder_type != INACTIVE && NE_16( coder_type, UNVOICED ) ) Loading @@ -428,6 +429,7 @@ static void GSC_gain_adj( { Gain_off = 0; move16(); #ifdef OPT_NBE_2311_HARM_GSC_GAIN test(); IF( LE_32( core_brate, ACELP_5k00 ) && EQ_16( coder_type, UNVOICED ) ) /* IVAS LR mode only */ Loading Loading @@ -1140,10 +1142,12 @@ Word16 gsc_gaindec_fx( /* o : average frequency gai /* RETURN ARGUMENTS : */ /* _ (Word16) : average frequency gain */ /*==========================================================================*/ #ifndef OPT_BE_2311_HARM_GSC_GAIN Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain */ #else Word16 gsc_gaindec_fx( /* o : average frequency gain */ /*! r: average frequency gain */ Word16 gsc_gaindec_fx( #endif Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 y_gainQ_fx[], /* o : quantized gain per band Q12 */ Loading @@ -1158,6 +1162,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ Word16 Mbands_gn = MBANDS_GN; move16(); Word16 y_gain_tmp3_fx[MBANDS_GN]; if ( EQ_16( st_fx->L_frame, L_FRAME16k ) ) { Mbands_gn = MBANDS_GN16k; Loading Loading @@ -1224,6 +1229,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ /*--------------------------------------------------------------------------------------* * UQ of the first 8 bands and half of the last 8 bands *--------------------------------------------------------------------------------------*/ idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 ); VDQ_vec_fx( y_gainQ_fx, YGain_mean_LR_fx, YGain_dic1_LR_fx, idx_g_fx, 3 ); Loading Loading @@ -1254,9 +1260,11 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ y_gainQ_fx[i] = round_fx( L_shl( L_mult( y_gainQ_fx[i], 23101 ), 1 ) ); /*Q12 */ move16(); } /*----------------------------------------------------------------------* * Copy the true Q values in the specific bands *----------------------------------------------------------------------*/ y_gainQ_fx[8] = y_gain_tmp3_fx[0]; /*Q12*/ move16(); y_gainQ_fx[10] = y_gain_tmp3_fx[1]; /*Q12*/ Loading Loading @@ -1301,6 +1309,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ } } } #ifndef OPT_NBE_2311_HARM_GSC_GAIN #ifdef OPT_BE_2311_HARM_GSC_GAIN IF( st_fx->element_mode == EVS_MONO ) Loading @@ -1316,6 +1325,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ #else GSC_gain_adj( coder_type, Mbands_gn, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx ); #endif return mean_4g_fx; } Loading @@ -1325,6 +1335,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ * * Quantization of the energy per band *-------------------------------------------------------------------*/ #ifdef OPT_NBE_2311_HARM_GSC_GAIN Word16 gsc_gainQ_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ Loading Loading @@ -1375,11 +1386,11 @@ Word16 gsc_gainQ_fx( /*Q12*/ move16(); } #endif test(); test(); IF( ( EQ_16( coder_type, AUDIO ) || ( coder_type == INACTIVE ) ) && ( bwidth == NB ) ) { /*ftmp1 = mean(y_gain4, 10)-0.6f;*/ L_tmp = L_deposit_l( 0 ); FOR( cnt = 0; cnt < 10; cnt++ ) Loading Loading @@ -1463,7 +1474,6 @@ Word16 gsc_gainQ_fx( /*Q12*/ ELSE { /*ftmp1 = mean(y_gain4, 16);*/ L_tmp = 0; move32(); FOR( cnt = 0; cnt < 16; cnt++ ) Loading Loading @@ -1528,7 +1538,11 @@ Word16 gsc_gainQ_fx( /*Q12*/ idx_g = vquant_fx( y_gain_tmp2, YGain_mean_LR_fx, y_gain_tmp2, YGain_dic1_LR_fx, 3, 32 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); #ifdef OPT_NBE_2311_HARM_GSC_GAIN test(); test(); test(); IF( !( coder_type == INACTIVE && tdm_LRTD_flag == 0 && EQ_16( idchan, 1 ) ) || GT_32( core_brate_inp, GSC_LRES_GAINQ_LIMIT ) ) { #endif Loading Loading @@ -1581,10 +1595,13 @@ Word16 gsc_gainQ_fx( /*Q12*/ #endif idx_g = vquant_fx( y_gain_tmp, YG_mean16_fx, y_gain_tmp, YG_dicMR_1_fx, 4, 64 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); idx_g = vquant_fx( y_gain_tmp + 4, YG_mean16_fx + 4, y_gain_tmp + 4, YG_dicMR_2_fx, 4, 32 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp + 8, YG_mean16_fx + 8, y_gain_tmp + 8, YG_dicMR_3_fx, 4, 32 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp + 12, YG_mean16_fx + 12, y_gain_tmp + 12, YG_dicMR_4_fx, 4, 16 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 4 ); } Loading Loading @@ -1616,6 +1633,7 @@ Word16 gsc_gainQ_fx( /*Q12*/ #else GSC_gain_adj( coder_type, core_brate, mean_4g[0], y_gain_tmp2 /* dummy buffer */, y_gain_tmp, y_gainQ ); #endif return mean_4g[0]; /*Q12*/ } Loading lib_com/gs_preech_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ void pre_echo_att_fx( #ifdef FIX_1904_HARM_GSC_ENC Word16 etmp_e, tmp_e; #endif test(); IF( gsc_attack_flag_fx > 0 && EQ_16( last_coder_type, AUDIO ) ) /*gsc_attack_flag_fx does not get set for all the test cases */ { Loading Loading @@ -203,7 +204,6 @@ void pre_echo_att_fx( return; } #ifndef FIX_1904_HARM_GSC_ENC void pre_echo_att_ivas_fx( Word32 *Last_frame_ener_fx, /* i/o: Energy of the last frame 2*Q_new+1*/ Loading lib_com/options.h +3 −2 Original line number Diff line number Diff line Loading @@ -148,8 +148,9 @@ #define NONBE_OPT_2239_IVAS_FILTER_PROCESS /* Dolby: Issue 2239, optimize ivas_filter_process_fx. */ #define NONBE_OPT_2193_EIG2X2 /* Dolby: Issue 2193, optimize eig2x2_fx. */ #define BE_FIX_2240_COMPUTE_COV_MTC_FX_FAST /* FhG: Speeds up covariance calculation e.g. 60 WMOPS for encoding -mc 7_1_4 24400 48 */ #define OPT_BE_2311_HARM_GSC_GAIN /* VA: BE part of the GSC gain harmonization pipeline #70380 shows the BE */ #define OPT_NBE_2311_HARM_GSC_GAIN /* VA: NBE part of the GSC gain harmonization */ #define OPT_BE_2311_HARM_GSC_GAIN /* VA: issue 2311: BE part of the GSC gain harmonization pipeline #70380 shows the BE */ #define OPT_NBE_2311_HARM_GSC_GAIN /* VA: issue 2311: non-BE part of the GSC gain harmonization */ /* #################### End BASOP optimization switches ############################ */ Loading lib_com/prot_fx.h +2 −0 Original line number Diff line number Diff line Loading @@ -1546,6 +1546,7 @@ Word16 gsc_gaindec_fx( const Word16 coder_type, /* i : coding type */ const Word16 bwidth_fx /* i : i signal bandwidth */ ); #ifndef OPT_BE_2311_HARM_GSC_GAIN /*! r: average frequency gain */ Word16 gsc_gaindec_ivas_fx( Loading Loading @@ -5077,6 +5078,7 @@ void freq_dnw_scaling_fx( Word16 Qx, /* Q format of fy_norm*/ const Word16 L_frame /* i : frame length */ ); #ifndef FIX_1904_HARM_GSC_ENC void highband_exc_dct_in_fx( const Word32 core_brate, /* i : core bitrate */ Loading lib_dec/gs_dec_fx.c +3 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,7 @@ void gsc_dec_fx( #else mean_gain = gsc_gaindec_fx( st_fx, Ener_per_bd_iQ, brate_intermed_tbl[i], hGSCDec->old_y_gain_fx, coder_type, st_fx->bwidth ); /* Q3 */ #endif st_fx->lp_gainc_fx = mult_r( 640, mean_gain ); /*10 in Q6 x Q12 -> lp_gainc in Q3 */ move16(); } Loading Loading @@ -863,6 +864,7 @@ void gsc_dec_fx( /*--------------------------------------------------------------------------------------* * Estimate noise level *--------------------------------------------------------------------------------------*/ #ifdef FIX_1904_HARM_GSC_ENC highband_exc_dct_in_fx( st_fx->core_brate, mfreq_bindiv_loc, *last_bin, Diff_len, hGSCDec->noise_lev, pit_band_idx, exc_diffQ, &hGSCDec->seed_tcx, Ener_per_bd_iQ, nb_subfr, exc_dct_in, st_fx->last_coder_type, bitallocation_band, lsf_new, Loading @@ -874,6 +876,7 @@ void gsc_dec_fx( hGSCDec->last_exc_dct_in_fx, &hGSCDec->last_ener_fx, hGSCDec->last_bitallocation_band, bitallocation_exc, st_fx->bfi, coder_type, st_fx->bwidth, exc_wo_nf, Qexc_diffQ, Q_exc, st_fx->GSC_noisy_speech, hGSCDec->lt_ener_per_band_fx, st_fx->L_frame, st_fx->element_mode, st_fx->GSC_IVAS_mode ); #endif exc_dct_in[0] = 0; move16(); Loading Loading
lib_com/gs_gains_fx.c +27 −9 Original line number Diff line number Diff line Loading @@ -405,6 +405,7 @@ static void GSC_gain_adj( Fac_div = 102; move16(); #endif #ifdef OPT_NBE_2311_HARM_GSC_GAIN test(); IF( coder_type != INACTIVE && NE_16( coder_type, UNVOICED ) ) Loading @@ -428,6 +429,7 @@ static void GSC_gain_adj( { Gain_off = 0; move16(); #ifdef OPT_NBE_2311_HARM_GSC_GAIN test(); IF( LE_32( core_brate, ACELP_5k00 ) && EQ_16( coder_type, UNVOICED ) ) /* IVAS LR mode only */ Loading Loading @@ -1140,10 +1142,12 @@ Word16 gsc_gaindec_fx( /* o : average frequency gai /* RETURN ARGUMENTS : */ /* _ (Word16) : average frequency gain */ /*==========================================================================*/ #ifndef OPT_BE_2311_HARM_GSC_GAIN Word16 gsc_gaindec_ivas_fx( /* o : average frequency gain */ #else Word16 gsc_gaindec_fx( /* o : average frequency gain */ /*! r: average frequency gain */ Word16 gsc_gaindec_fx( #endif Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 y_gainQ_fx[], /* o : quantized gain per band Q12 */ Loading @@ -1158,6 +1162,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ Word16 Mbands_gn = MBANDS_GN; move16(); Word16 y_gain_tmp3_fx[MBANDS_GN]; if ( EQ_16( st_fx->L_frame, L_FRAME16k ) ) { Mbands_gn = MBANDS_GN16k; Loading Loading @@ -1224,6 +1229,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ /*--------------------------------------------------------------------------------------* * UQ of the first 8 bands and half of the last 8 bands *--------------------------------------------------------------------------------------*/ idx_g_fx = (Word16) get_next_indice_fx( st_fx, 5 ); VDQ_vec_fx( y_gainQ_fx, YGain_mean_LR_fx, YGain_dic1_LR_fx, idx_g_fx, 3 ); Loading Loading @@ -1254,9 +1260,11 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ y_gainQ_fx[i] = round_fx( L_shl( L_mult( y_gainQ_fx[i], 23101 ), 1 ) ); /*Q12 */ move16(); } /*----------------------------------------------------------------------* * Copy the true Q values in the specific bands *----------------------------------------------------------------------*/ y_gainQ_fx[8] = y_gain_tmp3_fx[0]; /*Q12*/ move16(); y_gainQ_fx[10] = y_gain_tmp3_fx[1]; /*Q12*/ Loading Loading @@ -1301,6 +1309,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ } } } #ifndef OPT_NBE_2311_HARM_GSC_GAIN #ifdef OPT_BE_2311_HARM_GSC_GAIN IF( st_fx->element_mode == EVS_MONO ) Loading @@ -1316,6 +1325,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ #else GSC_gain_adj( coder_type, Mbands_gn, core_brate_fx, mean_4g_fx, old_y_gain_fx, y_gainQ_fx, y_gainQ_fx ); #endif return mean_4g_fx; } Loading @@ -1325,6 +1335,7 @@ Word16 gsc_gaindec_fx( /* o : average frequency gain */ * * Quantization of the energy per band *-------------------------------------------------------------------*/ #ifdef OPT_NBE_2311_HARM_GSC_GAIN Word16 gsc_gainQ_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ Loading Loading @@ -1375,11 +1386,11 @@ Word16 gsc_gainQ_fx( /*Q12*/ move16(); } #endif test(); test(); IF( ( EQ_16( coder_type, AUDIO ) || ( coder_type == INACTIVE ) ) && ( bwidth == NB ) ) { /*ftmp1 = mean(y_gain4, 10)-0.6f;*/ L_tmp = L_deposit_l( 0 ); FOR( cnt = 0; cnt < 10; cnt++ ) Loading Loading @@ -1463,7 +1474,6 @@ Word16 gsc_gainQ_fx( /*Q12*/ ELSE { /*ftmp1 = mean(y_gain4, 16);*/ L_tmp = 0; move32(); FOR( cnt = 0; cnt < 16; cnt++ ) Loading Loading @@ -1528,7 +1538,11 @@ Word16 gsc_gainQ_fx( /*Q12*/ idx_g = vquant_fx( y_gain_tmp2, YGain_mean_LR_fx, y_gain_tmp2, YGain_dic1_LR_fx, 3, 32 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); #ifdef OPT_NBE_2311_HARM_GSC_GAIN test(); test(); test(); IF( !( coder_type == INACTIVE && tdm_LRTD_flag == 0 && EQ_16( idchan, 1 ) ) || GT_32( core_brate_inp, GSC_LRES_GAINQ_LIMIT ) ) { #endif Loading Loading @@ -1581,10 +1595,13 @@ Word16 gsc_gainQ_fx( /*Q12*/ #endif idx_g = vquant_fx( y_gain_tmp, YG_mean16_fx, y_gain_tmp, YG_dicMR_1_fx, 4, 64 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 6 ); idx_g = vquant_fx( y_gain_tmp + 4, YG_mean16_fx + 4, y_gain_tmp + 4, YG_dicMR_2_fx, 4, 32 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp + 8, YG_mean16_fx + 8, y_gain_tmp + 8, YG_dicMR_3_fx, 4, 32 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 5 ); idx_g = vquant_fx( y_gain_tmp + 12, YG_mean16_fx + 12, y_gain_tmp + 12, YG_dicMR_4_fx, 4, 16 ); push_indice( hBstr, IND_Y_GAIN_TMP, idx_g, 4 ); } Loading Loading @@ -1616,6 +1633,7 @@ Word16 gsc_gainQ_fx( /*Q12*/ #else GSC_gain_adj( coder_type, core_brate, mean_4g[0], y_gain_tmp2 /* dummy buffer */, y_gain_tmp, y_gainQ ); #endif return mean_4g[0]; /*Q12*/ } Loading
lib_com/gs_preech_fx.c +1 −1 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ void pre_echo_att_fx( #ifdef FIX_1904_HARM_GSC_ENC Word16 etmp_e, tmp_e; #endif test(); IF( gsc_attack_flag_fx > 0 && EQ_16( last_coder_type, AUDIO ) ) /*gsc_attack_flag_fx does not get set for all the test cases */ { Loading Loading @@ -203,7 +204,6 @@ void pre_echo_att_fx( return; } #ifndef FIX_1904_HARM_GSC_ENC void pre_echo_att_ivas_fx( Word32 *Last_frame_ener_fx, /* i/o: Energy of the last frame 2*Q_new+1*/ Loading
lib_com/options.h +3 −2 Original line number Diff line number Diff line Loading @@ -148,8 +148,9 @@ #define NONBE_OPT_2239_IVAS_FILTER_PROCESS /* Dolby: Issue 2239, optimize ivas_filter_process_fx. */ #define NONBE_OPT_2193_EIG2X2 /* Dolby: Issue 2193, optimize eig2x2_fx. */ #define BE_FIX_2240_COMPUTE_COV_MTC_FX_FAST /* FhG: Speeds up covariance calculation e.g. 60 WMOPS for encoding -mc 7_1_4 24400 48 */ #define OPT_BE_2311_HARM_GSC_GAIN /* VA: BE part of the GSC gain harmonization pipeline #70380 shows the BE */ #define OPT_NBE_2311_HARM_GSC_GAIN /* VA: NBE part of the GSC gain harmonization */ #define OPT_BE_2311_HARM_GSC_GAIN /* VA: issue 2311: BE part of the GSC gain harmonization pipeline #70380 shows the BE */ #define OPT_NBE_2311_HARM_GSC_GAIN /* VA: issue 2311: non-BE part of the GSC gain harmonization */ /* #################### End BASOP optimization switches ############################ */ Loading
lib_com/prot_fx.h +2 −0 Original line number Diff line number Diff line Loading @@ -1546,6 +1546,7 @@ Word16 gsc_gaindec_fx( const Word16 coder_type, /* i : coding type */ const Word16 bwidth_fx /* i : i signal bandwidth */ ); #ifndef OPT_BE_2311_HARM_GSC_GAIN /*! r: average frequency gain */ Word16 gsc_gaindec_ivas_fx( Loading Loading @@ -5077,6 +5078,7 @@ void freq_dnw_scaling_fx( Word16 Qx, /* Q format of fy_norm*/ const Word16 L_frame /* i : frame length */ ); #ifndef FIX_1904_HARM_GSC_ENC void highband_exc_dct_in_fx( const Word32 core_brate, /* i : core bitrate */ Loading
lib_dec/gs_dec_fx.c +3 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,7 @@ void gsc_dec_fx( #else mean_gain = gsc_gaindec_fx( st_fx, Ener_per_bd_iQ, brate_intermed_tbl[i], hGSCDec->old_y_gain_fx, coder_type, st_fx->bwidth ); /* Q3 */ #endif st_fx->lp_gainc_fx = mult_r( 640, mean_gain ); /*10 in Q6 x Q12 -> lp_gainc in Q3 */ move16(); } Loading Loading @@ -863,6 +864,7 @@ void gsc_dec_fx( /*--------------------------------------------------------------------------------------* * Estimate noise level *--------------------------------------------------------------------------------------*/ #ifdef FIX_1904_HARM_GSC_ENC highband_exc_dct_in_fx( st_fx->core_brate, mfreq_bindiv_loc, *last_bin, Diff_len, hGSCDec->noise_lev, pit_band_idx, exc_diffQ, &hGSCDec->seed_tcx, Ener_per_bd_iQ, nb_subfr, exc_dct_in, st_fx->last_coder_type, bitallocation_band, lsf_new, Loading @@ -874,6 +876,7 @@ void gsc_dec_fx( hGSCDec->last_exc_dct_in_fx, &hGSCDec->last_ener_fx, hGSCDec->last_bitallocation_band, bitallocation_exc, st_fx->bfi, coder_type, st_fx->bwidth, exc_wo_nf, Qexc_diffQ, Q_exc, st_fx->GSC_noisy_speech, hGSCDec->lt_ener_per_band_fx, st_fx->L_frame, st_fx->element_mode, st_fx->GSC_IVAS_mode ); #endif exc_dct_in[0] = 0; move16(); Loading