Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -134,4 +134,5 @@ #define FIX_1010_OPT_GIVENS_INV /* FhG: SVD complexity optimizations (non-be) */ #define FIX_1010_OPT_NORM_NOSAT /* FhG: SVD complexity optimizations (non-be) */ #define FIX_1010_OPT_SEC_SINGLE_RESCALE /* FhG: SVD complexity optimizations (non-be) */ #define FIX_ISSUE_1230 /* Ittiam: Fix for issue 1230: Basop Enc audible differences and distortion @16kbps */ #endif lib_dec/gain_dec_fx.c +27 −15 Original line number Diff line number Diff line Loading @@ -505,6 +505,18 @@ void gain_dec_mless_fx( L_tmp = Dot_product12( code_fx, code_fx, L_SUBFR, &expg ); /*Q31 - expg*/ expg = sub( expg, 18 + 6 ); /* exp: -18 (code in Q9), -6 (/L_SUBFR) */ // To avoid crash in case code value is 0 IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( L_tmp, expg, 21474836, 0 ), -1 ) ) { // setting values to avoid extra computation *gain_inov_fx = 32767; /*8(max value gain_inov can hold) in Q12*/ Ei_fx = -9743; /* -38 in Q8*/ move16(); move16(); } ELSE { expg2 = expg; move16(); L_tmp1 = L_tmp; /* sets to 'L_tmp' in 1 clock */ Loading @@ -520,7 +532,7 @@ void gain_dec_mless_fx( e_tmp = sub( expg2, add( 1, e_tmp ) ); L_tmp1 = Mpy_32_16( e_tmp, f_tmp, 12330 ); /* Q13 */ /* 10*log10(2) in Q12*/ Ei_fx = round_fx( L_shl( L_tmp1, 11 ) ); /* Q8 */ } /*-----------------------------------------------------------------* * calculate the predicted gain code *-----------------------------------------------------------------*/ Loading lib_enc/core_switching_enc.c +4 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,10 @@ void core_switching_pre_enc_ivas_fx( tmp = sub( L_LOOK_16k + L_SUBFR16k, Sample_Delay_HP ); Copy( &hBWE_TD->old_speech_shb_fx[tmp], hBWE_FD->new_input_hp_fx, Sample_Delay_HP ); #ifdef FIX_ISSUE_1230 hBWE_FD->Q_new_input_hp = 0; move16(); #endif IF( NE_16( st_fx->last_extl, WB_BWE ) ) { Loading lib_enc/gain_enc_fx.c +27 −24 Original line number Diff line number Diff line Loading @@ -603,15 +603,17 @@ void gain_enc_mless_ivas_fx( L_tmp = Dot_product12( code, code, L_SUBFR, &exp_code ); exp_inov = sub( exp_code, 18 + 6 ); // To avoid crash in case code value is 0 // To avoid crash in case code value is 0, IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( L_tmp, exp_inov, 21474836, 0 ), -1 ) ) { L_tmp = 21474836; exp_inov = 0; move32(); // setting values to avoid extra computation *gain_inov = 32767; /*8(max value gain_inov can hold) in Q12*/ Ei = -9743; /* -38 in Q8*/ move16(); move16(); } ELSE { exp_code = sub( exp_code, 30 ); /*Ei = 10 * log10((dot_product(code, code, L_SUBFR) + 0.01) / L_SUBFR) */ Loading @@ -625,9 +627,6 @@ void gain_enc_mless_ivas_fx( L_tmp1 = Mpy_32_16( tmp, frac, 12330 ); /* Q13 */ Ei = round_fx( L_shl( L_tmp1, 11 ) ); /* Q8 */ /* predicted codebook gain */ gcode0 = sub( Es_pred, Ei ); /* Q8 */ /*---------------------------------------------------------------* * Decode codebook gain and the adaptive excitation low-pass * filtering factor (Finalize computation ) Loading @@ -636,6 +635,10 @@ void gain_enc_mless_ivas_fx( L_tmp = Isqrt_lc( L_tmp, &exp_inov ); *gain_inov = extract_h( L_shl( L_tmp, sub( exp_inov, 3 ) ) ); /* gain_inov in Q12 */ move16(); } /* predicted codebook gain */ gcode0 = sub( Es_pred, Ei ); /* Q8 */ /* gcode0 = pow(10, 0.05 * (Es_pred - Ei)) */ /*----------------------------------------------------------------* Loading lib_enc/stat_enc.h +8 −5 Original line number Diff line number Diff line Loading @@ -1007,7 +1007,10 @@ typedef struct td_bwe_enc_structure typedef struct fd_bwe_enc_structure { Word16 new_input_hp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS - DELAY_CLDFB_NS )]; // q0 Word16 new_input_hp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS - DELAY_CLDFB_NS )]; // Q_new_input_hp #ifdef FIX_ISSUE_1230 Word16 Q_new_input_hp; #endif Word16 old_input_fx[NS2SA( 48000, DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS )]; // q0 Word16 old_input_wb_fx[NS2SA( 16000, DELAY_FD_BWE_ENC_NS )]; /* Q(-1) */ Word16 old_input_lp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS )]; // st->hBWE_FD->prev_Q_input_lp Loading Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -134,4 +134,5 @@ #define FIX_1010_OPT_GIVENS_INV /* FhG: SVD complexity optimizations (non-be) */ #define FIX_1010_OPT_NORM_NOSAT /* FhG: SVD complexity optimizations (non-be) */ #define FIX_1010_OPT_SEC_SINGLE_RESCALE /* FhG: SVD complexity optimizations (non-be) */ #define FIX_ISSUE_1230 /* Ittiam: Fix for issue 1230: Basop Enc audible differences and distortion @16kbps */ #endif
lib_dec/gain_dec_fx.c +27 −15 Original line number Diff line number Diff line Loading @@ -505,6 +505,18 @@ void gain_dec_mless_fx( L_tmp = Dot_product12( code_fx, code_fx, L_SUBFR, &expg ); /*Q31 - expg*/ expg = sub( expg, 18 + 6 ); /* exp: -18 (code in Q9), -6 (/L_SUBFR) */ // To avoid crash in case code value is 0 IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( L_tmp, expg, 21474836, 0 ), -1 ) ) { // setting values to avoid extra computation *gain_inov_fx = 32767; /*8(max value gain_inov can hold) in Q12*/ Ei_fx = -9743; /* -38 in Q8*/ move16(); move16(); } ELSE { expg2 = expg; move16(); L_tmp1 = L_tmp; /* sets to 'L_tmp' in 1 clock */ Loading @@ -520,7 +532,7 @@ void gain_dec_mless_fx( e_tmp = sub( expg2, add( 1, e_tmp ) ); L_tmp1 = Mpy_32_16( e_tmp, f_tmp, 12330 ); /* Q13 */ /* 10*log10(2) in Q12*/ Ei_fx = round_fx( L_shl( L_tmp1, 11 ) ); /* Q8 */ } /*-----------------------------------------------------------------* * calculate the predicted gain code *-----------------------------------------------------------------*/ Loading
lib_enc/core_switching_enc.c +4 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,10 @@ void core_switching_pre_enc_ivas_fx( tmp = sub( L_LOOK_16k + L_SUBFR16k, Sample_Delay_HP ); Copy( &hBWE_TD->old_speech_shb_fx[tmp], hBWE_FD->new_input_hp_fx, Sample_Delay_HP ); #ifdef FIX_ISSUE_1230 hBWE_FD->Q_new_input_hp = 0; move16(); #endif IF( NE_16( st_fx->last_extl, WB_BWE ) ) { Loading
lib_enc/gain_enc_fx.c +27 −24 Original line number Diff line number Diff line Loading @@ -603,15 +603,17 @@ void gain_enc_mless_ivas_fx( L_tmp = Dot_product12( code, code, L_SUBFR, &exp_code ); exp_inov = sub( exp_code, 18 + 6 ); // To avoid crash in case code value is 0 // To avoid crash in case code value is 0, IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( L_tmp, exp_inov, 21474836, 0 ), -1 ) ) { L_tmp = 21474836; exp_inov = 0; move32(); // setting values to avoid extra computation *gain_inov = 32767; /*8(max value gain_inov can hold) in Q12*/ Ei = -9743; /* -38 in Q8*/ move16(); move16(); } ELSE { exp_code = sub( exp_code, 30 ); /*Ei = 10 * log10((dot_product(code, code, L_SUBFR) + 0.01) / L_SUBFR) */ Loading @@ -625,9 +627,6 @@ void gain_enc_mless_ivas_fx( L_tmp1 = Mpy_32_16( tmp, frac, 12330 ); /* Q13 */ Ei = round_fx( L_shl( L_tmp1, 11 ) ); /* Q8 */ /* predicted codebook gain */ gcode0 = sub( Es_pred, Ei ); /* Q8 */ /*---------------------------------------------------------------* * Decode codebook gain and the adaptive excitation low-pass * filtering factor (Finalize computation ) Loading @@ -636,6 +635,10 @@ void gain_enc_mless_ivas_fx( L_tmp = Isqrt_lc( L_tmp, &exp_inov ); *gain_inov = extract_h( L_shl( L_tmp, sub( exp_inov, 3 ) ) ); /* gain_inov in Q12 */ move16(); } /* predicted codebook gain */ gcode0 = sub( Es_pred, Ei ); /* Q8 */ /* gcode0 = pow(10, 0.05 * (Es_pred - Ei)) */ /*----------------------------------------------------------------* Loading
lib_enc/stat_enc.h +8 −5 Original line number Diff line number Diff line Loading @@ -1007,7 +1007,10 @@ typedef struct td_bwe_enc_structure typedef struct fd_bwe_enc_structure { Word16 new_input_hp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS - DELAY_CLDFB_NS )]; // q0 Word16 new_input_hp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS - DELAY_CLDFB_NS )]; // Q_new_input_hp #ifdef FIX_ISSUE_1230 Word16 Q_new_input_hp; #endif Word16 old_input_fx[NS2SA( 48000, DELAY_FD_BWE_ENC_NS + DELAY_FIR_RESAMPL_NS )]; // q0 Word16 old_input_wb_fx[NS2SA( 16000, DELAY_FD_BWE_ENC_NS )]; /* Q(-1) */ Word16 old_input_lp_fx[NS2SA( 16000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_NS )]; // st->hBWE_FD->prev_Q_input_lp Loading