Loading lib_com/gs_gains_fx.c +14 −8 Original line number Diff line number Diff line Loading @@ -260,7 +260,8 @@ void Comp_and_apply_gain_ivas_fx( /* _ None */ /*========================================================================*/ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ /* o : Band gain Q12 */ static Word16 Comp_band_log_ener( const Word16 *pt_fx, /* i : Dct input Q_sc */ const Word16 Len, /* i : Lenght en energy accumulation */ const Word16 Q_sc, /* i : scaling of input */ Loading @@ -269,12 +270,14 @@ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ { Word32 L_tmp; Word16 e_tmp, f_tmp, tmp16, ener_exp; L_tmp = Calc_Energy_Autoscaled( pt_fx, Q_sc, Len, &ener_exp ); e_tmp = norm_l( L_tmp ); f_tmp = Log2_norm_lc( L_shl( L_tmp, e_tmp ) ); e_tmp = sub( sub( add( 30, E_sc ), e_tmp ), ener_exp ); L_tmp = Mpy_32_16( e_tmp, f_tmp, 19728 ); /* Q16 */ /*log10(2) in Q17 */ tmp16 = round_fx( L_shl( L_tmp, 12 - 2 ) ); /* Q12 -1 is to compensate Q17 */ return tmp16; } Loading @@ -283,10 +286,11 @@ void Ener_per_band_comp_fx( Word16 y_gain4_fx[], /* o : Energy per band to quantize Q12 */ const Word16 Q_exc, /* i : frame length */ const Word16 Mband, /* i : Max band */ const Word16 Eflag /* i : flag of highest band */ #ifdef FIX_1904_HARM_GSC_ENC , const Word16 Eflag, /* i : flag of highest band */ const Word16 L_frame /* i : frame length */ #else const Word16 Eflag /* i : flag of highest band */ #endif ) { Loading Loading @@ -314,6 +318,7 @@ void Ener_per_band_comp_fx( move16(); pt_fx += 32; } #ifdef FIX_1904_HARM_GSC_ENC IF( EQ_16( L_frame, L_FRAME16k ) ) { Loading @@ -323,6 +328,7 @@ void Ener_per_band_comp_fx( move16(); } #endif return; } #ifndef FIX_1904_HARM_GSC_ENC Loading lib_com/gs_inact_switching_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ void Inac_switch_ematch_fx( #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) { Loading @@ -99,6 +100,7 @@ void Inac_switch_ematch_fx( #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) { Loading @@ -110,11 +112,13 @@ void Inac_switch_ematch_fx( { /* Find spectrum and energy per band for inactive frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* More agressive smoothing in the first 50 frames */ pt_exc = dct_exc_tmp; move16(); Loading lib_com/gs_noisefill_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -1018,6 +1018,8 @@ void highband_exc_dct_in_fx( return; } #endif void highband_exc_dct_in_ivas_fx( const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Loading Loading @@ -1175,11 +1177,13 @@ void highband_exc_dct_in_ivas_fx( { Apply_NoiseFill_fx( exc_diffQ, seed_tcx, noisepb, Diff_len, last_bin, coder_type, mfreq_bindiv, Qexc_diffQ ); } /*--------------------------------------------------------------------------------------* * Quantize average gain * Subtract Q averaged gain * VQ of remaining gain per band *--------------------------------------------------------------------------------------*/ test(); IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) ) { Loading @@ -1196,6 +1200,7 @@ void highband_exc_dct_in_ivas_fx( #else Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #endif test(); IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) ) { Loading @@ -1209,9 +1214,11 @@ void highband_exc_dct_in_ivas_fx( } } } /*--------------------------------------------------------------------------------------* * Check potential energy excitation overshoot *--------------------------------------------------------------------------------------*/ IF( bfi ) { test(); Loading lib_com/gs_preech_fx.c +4 −2 Original line number Diff line number Diff line Loading @@ -56,10 +56,11 @@ void pre_echo_att_fx( const Word16 gsc_attack_flag_fx, /* i : flag signalling attack encoded by AC mode (GSC) Q0*/ const Word16 Q_new, const Word16 last_coder_type, /* i : Last coding mode Q0*/ const Word16 L_frame /* i : Frame length Q0*/ #ifdef FIX_1904_HARM_GSC_ENC , const Word16 L_frame, /* i : Frame length Q0*/ const Word16 element_mode /* i : Current IVAS element mode*/ #else const Word16 L_frame /* i : Frame length Q0*/ #endif ) { Loading Loading @@ -177,6 +178,7 @@ void pre_echo_att_fx( /*-------------------------------------------------------* * In normal cases, just compute the energy of the frame *-------------------------------------------------------*/ #ifdef FIX_1904_HARM_GSC_ENC IF( NE_16( element_mode, EVS_MONO ) ) /* This could be harmonized with EVS, but won't be BE */ { Loading lib_com/prot_fx.h +8 −4 Original line number Diff line number Diff line Loading @@ -1758,10 +1758,11 @@ void Ener_per_band_comp_fx( Word16 y_gain4[], /* o : Energy per band to quantize Q12 */ const Word16 Q_exc_diff, const Word16 Mband, /* i : Max band */ const Word16 Eflag #ifdef FIX_1904_HARM_GSC_ENC , const Word16 Eflag, const Word16 L_frame /* i : frame length */ #else const Word16 Eflag #endif ); Loading Loading @@ -1798,10 +1799,11 @@ void pre_echo_att_fx( const Word16 gsc_attack_flag_fx, /* i : flag signalling attack encoded by AC mode (GSC) Q0*/ const Word16 Q_new, const Word16 last_coder_type, /* i : Last coding mode Q0*/ const Word16 L_frame /* i : Frame length Q0*/ #ifdef FIX_1904_HARM_GSC_ENC , const Word16 L_frame /* i : Frame length Q0*/, const Word16 element_mode /* i : Current IVAS element mode*/ #else const Word16 L_frame /* i : Frame length Q0*/ #endif ); #ifndef FIX_1904_HARM_GSC_ENC Loading @@ -1814,6 +1816,7 @@ void pre_echo_att_ivas_fx( const Word16 L_frame /* i : Frame length Q0*/ ); #endif void tcx_get_windows_mode1( const Word16 left_mode, /* i: overlap mode of left window half */ const Word16 right_mode, /* i: overlap mode of right window half */ Loading Loading @@ -5075,6 +5078,7 @@ void highband_exc_dct_in_fx( const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); #endif void highband_exc_dct_in_ivas_fx( const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Loading Loading
lib_com/gs_gains_fx.c +14 −8 Original line number Diff line number Diff line Loading @@ -260,7 +260,8 @@ void Comp_and_apply_gain_ivas_fx( /* _ None */ /*========================================================================*/ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ /* o : Band gain Q12 */ static Word16 Comp_band_log_ener( const Word16 *pt_fx, /* i : Dct input Q_sc */ const Word16 Len, /* i : Lenght en energy accumulation */ const Word16 Q_sc, /* i : scaling of input */ Loading @@ -269,12 +270,14 @@ static Word16 Comp_band_log_ener( /* o : Band gain Q12 */ { Word32 L_tmp; Word16 e_tmp, f_tmp, tmp16, ener_exp; L_tmp = Calc_Energy_Autoscaled( pt_fx, Q_sc, Len, &ener_exp ); e_tmp = norm_l( L_tmp ); f_tmp = Log2_norm_lc( L_shl( L_tmp, e_tmp ) ); e_tmp = sub( sub( add( 30, E_sc ), e_tmp ), ener_exp ); L_tmp = Mpy_32_16( e_tmp, f_tmp, 19728 ); /* Q16 */ /*log10(2) in Q17 */ tmp16 = round_fx( L_shl( L_tmp, 12 - 2 ) ); /* Q12 -1 is to compensate Q17 */ return tmp16; } Loading @@ -283,10 +286,11 @@ void Ener_per_band_comp_fx( Word16 y_gain4_fx[], /* o : Energy per band to quantize Q12 */ const Word16 Q_exc, /* i : frame length */ const Word16 Mband, /* i : Max band */ const Word16 Eflag /* i : flag of highest band */ #ifdef FIX_1904_HARM_GSC_ENC , const Word16 Eflag, /* i : flag of highest band */ const Word16 L_frame /* i : frame length */ #else const Word16 Eflag /* i : flag of highest band */ #endif ) { Loading Loading @@ -314,6 +318,7 @@ void Ener_per_band_comp_fx( move16(); pt_fx += 32; } #ifdef FIX_1904_HARM_GSC_ENC IF( EQ_16( L_frame, L_FRAME16k ) ) { Loading @@ -323,6 +328,7 @@ void Ener_per_band_comp_fx( move16(); } #endif return; } #ifndef FIX_1904_HARM_GSC_ENC Loading
lib_com/gs_inact_switching_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ void Inac_switch_ematch_fx( #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) { Loading @@ -99,6 +100,7 @@ void Inac_switch_ematch_fx( #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* reset long-term energy per band */ FOR( i = 0; i < MBANDS_GN; i++ ) { Loading @@ -110,11 +112,13 @@ void Inac_switch_ematch_fx( { /* Find spectrum and energy per band for inactive frames */ edct_16fx( exc2, dct_exc_tmp, L_frame, 5, element_mode ); #ifdef FIX_1904_HARM_GSC_ENC Ener_per_band_comp_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #else Ener_per_band_comp_ivas_fx( dct_exc_tmp, Ener_per_bd, Q_exc, MBANDS_GN, 1, L_frame ); #endif /* More agressive smoothing in the first 50 frames */ pt_exc = dct_exc_tmp; move16(); Loading
lib_com/gs_noisefill_fx.c +7 −0 Original line number Diff line number Diff line Loading @@ -1018,6 +1018,8 @@ void highband_exc_dct_in_fx( return; } #endif void highband_exc_dct_in_ivas_fx( const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Loading Loading @@ -1175,11 +1177,13 @@ void highband_exc_dct_in_ivas_fx( { Apply_NoiseFill_fx( exc_diffQ, seed_tcx, noisepb, Diff_len, last_bin, coder_type, mfreq_bindiv, Qexc_diffQ ); } /*--------------------------------------------------------------------------------------* * Quantize average gain * Subtract Q averaged gain * VQ of remaining gain per band *--------------------------------------------------------------------------------------*/ test(); IF( EQ_32( core_brate, ACELP_8k00 ) && NE_16( bwidth, NB ) ) { Loading @@ -1196,6 +1200,7 @@ void highband_exc_dct_in_ivas_fx( #else Ener_per_band_comp_ivas_fx( exc_diffQ, Ener_per_bd_yQ, Qexc_diffQ, MBANDS_GN, 1, L_frame ); #endif test(); IF( LT_16( nb_subfr, 4 ) && LT_16( L_frame, L_FRAME16k ) ) { Loading @@ -1209,9 +1214,11 @@ void highband_exc_dct_in_ivas_fx( } } } /*--------------------------------------------------------------------------------------* * Check potential energy excitation overshoot *--------------------------------------------------------------------------------------*/ IF( bfi ) { test(); Loading
lib_com/gs_preech_fx.c +4 −2 Original line number Diff line number Diff line Loading @@ -56,10 +56,11 @@ void pre_echo_att_fx( const Word16 gsc_attack_flag_fx, /* i : flag signalling attack encoded by AC mode (GSC) Q0*/ const Word16 Q_new, const Word16 last_coder_type, /* i : Last coding mode Q0*/ const Word16 L_frame /* i : Frame length Q0*/ #ifdef FIX_1904_HARM_GSC_ENC , const Word16 L_frame, /* i : Frame length Q0*/ const Word16 element_mode /* i : Current IVAS element mode*/ #else const Word16 L_frame /* i : Frame length Q0*/ #endif ) { Loading Loading @@ -177,6 +178,7 @@ void pre_echo_att_fx( /*-------------------------------------------------------* * In normal cases, just compute the energy of the frame *-------------------------------------------------------*/ #ifdef FIX_1904_HARM_GSC_ENC IF( NE_16( element_mode, EVS_MONO ) ) /* This could be harmonized with EVS, but won't be BE */ { Loading
lib_com/prot_fx.h +8 −4 Original line number Diff line number Diff line Loading @@ -1758,10 +1758,11 @@ void Ener_per_band_comp_fx( Word16 y_gain4[], /* o : Energy per band to quantize Q12 */ const Word16 Q_exc_diff, const Word16 Mband, /* i : Max band */ const Word16 Eflag #ifdef FIX_1904_HARM_GSC_ENC , const Word16 Eflag, const Word16 L_frame /* i : frame length */ #else const Word16 Eflag #endif ); Loading Loading @@ -1798,10 +1799,11 @@ void pre_echo_att_fx( const Word16 gsc_attack_flag_fx, /* i : flag signalling attack encoded by AC mode (GSC) Q0*/ const Word16 Q_new, const Word16 last_coder_type, /* i : Last coding mode Q0*/ const Word16 L_frame /* i : Frame length Q0*/ #ifdef FIX_1904_HARM_GSC_ENC , const Word16 L_frame /* i : Frame length Q0*/, const Word16 element_mode /* i : Current IVAS element mode*/ #else const Word16 L_frame /* i : Frame length Q0*/ #endif ); #ifndef FIX_1904_HARM_GSC_ENC Loading @@ -1814,6 +1816,7 @@ void pre_echo_att_ivas_fx( const Word16 L_frame /* i : Frame length Q0*/ ); #endif void tcx_get_windows_mode1( const Word16 left_mode, /* i: overlap mode of left window half */ const Word16 right_mode, /* i: overlap mode of right window half */ Loading Loading @@ -5075,6 +5078,7 @@ void highband_exc_dct_in_fx( const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); #endif void highband_exc_dct_in_ivas_fx( const Word32 core_brate, /* i : core bitrate */ const Word16 *mfreq_bindiv, /* i : bin per bands tables */ Loading