Commit c481ec66 authored by Anjaneyulu Sana's avatar Anjaneyulu Sana
Browse files

Updates for multi_harm_ivas_fx to improve precision

parent d818c148
Loading
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -379,6 +379,7 @@ Word16 multi_harm_ivas_fx( /* o : frame multi-harmoni
{
    Word16 i, j, k, L, stemp, N_mins, ind_mins[L_FFT / 4], *pt_mins, harm;
    Word16 S[L_FFT / 2], flor, step, tmp16, tmp2, Expx2, Expy2;
    Word32 tmp2_32;
    Word16 corx2, cory2, corxy, cor, cor_map[L_FFT / 2], *pt1, *pt2, cor_strong;
    Word32 L_acc;
    Word32 Lcorx2, Lcory2, Lcorxy, Lcor_map_LT_sum;
@@ -621,7 +622,7 @@ Word16 multi_harm_ivas_fx( /* o : frame multi-harmoni
     *------------------------------------------------------------------*/

    Lcor_map_LT_sum = L_deposit_l( 0 );
    tmp2 = 0;
    tmp2_32 = 0;
    move16();

    cor_strong = 0;
@@ -633,7 +634,7 @@ Word16 multi_harm_ivas_fx( /* o : frame multi-harmoni
    FOR( i = 0; i < L; i++ )
    {
        /* tmp2 += S[i]; */
        tmp2 = add( tmp2, shl( S[i], 1 ) ); /* tmp2 in Q8; max value is 128) */
        tmp2_32 = L_add( tmp2_32, cor_map[i] ); /* tmp2_32 in Q15; max value is 128) */

        /* *pt1 = M_ALPHA_FX * *pt1 + (1-M_ALPHA_FX) * *pt2++ */
        *pt1 = mac_r( L_mult( ONE_MINUS_M_ALPHA, *pt2 ), M_ALPHA_FX, *pt1 );
@@ -651,6 +652,7 @@ Word16 multi_harm_ivas_fx( /* o : frame multi-harmoni
        pt1++;
        pt2++;
    }
    tmp2 = L_shr_sat( tmp2_32, 7 ); // q15-> q8

    IF( EQ_16( bwidth, NB ) )
    {