Commit 5eeee2c0 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

BASOP optimizations

[x] sum_32_fx 64-bit operator usage
[x] MAC basop usage in TNSAnalysisStereo
parent c7b43a06
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -543,7 +543,7 @@ void calc_normal_length_fx(
            pit++;
        }

        L_tmp = L_mult0( peak, add( 15, THRES ) ); /*Q_syn */
        L_tmp = L_mult0( peak, 15 + THRES ); /*Q_syn */
        IF( EQ_16( THRES, 8 ) )
        {
            L_tmp1 = L_shl( Mpy_32_16_1( L_mean, 32767 ), 3 );
@@ -877,7 +877,7 @@ void calc_norm_envelop_fx(
        }
        envelope[env_index] = L_tmp;
        move32();
        env_index = add( env_index, 1 );
        env_index++;
    }

    i = 0;
@@ -896,7 +896,7 @@ void calc_norm_envelop_fx(
        }
        envelope[env_index] = L_tmp;
        move32();
        env_index = add( env_index, 1 );
        env_index++;
        i = add( i, 1 );
    }

+10 −10
Original line number Diff line number Diff line
@@ -423,22 +423,22 @@ Word32 sum_32_fx(
    const Word16 lvec, /* i  : length of input vector                */
    Word16 *e )
{
    Word16 i;
    Word32 tmp;
    Word16 i, shift;
    Word64 tmp = 0;
    move64();
    Word32 ans;

    tmp = 0;
    Word16 exp = 0;
    move32();
    move16();
    FOR( i = 0; i < lvec; i++ )
    {
        tmp = BASOP_Util_Add_Mant32Exp( tmp, exp, vec[i], *e, &exp );
        tmp = W_add( tmp, vec[i] ); // e
    }

    *e = exp;
    shift = W_norm( tmp );
    tmp = W_shl( tmp, shift ); // shift + (31 - e)
    ans = W_extract_h( tmp );  // shift + (31 - e) - 32
    *e = add( sub( *e, shift ), 32 );
    move16();

    return tmp;
    return ans;
}

Word32 sum2_fx_mod(                    /* o  : sum of all squared vector elements    Q(2x+1 -5)*/
+2 −2
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@ void TNSAnalysisStereo_fx(
                         * both filters for the decision
                         */

                        meanPredictionGain_fx = add( shr( pFilter[0]->predictionGain, 1 ), shr( pFilter[1]->predictionGain, 1 ) ); // Q7
                        meanPredictionGain_fx = mac_r( L_mult( pFilter[0]->predictionGain, 16384 ), pFilter[1]->predictionGain, 16384 ); // Q7
                        maxPredictionGain_fx = s_max( maxPredictionGain_fx, meanPredictionGain_fx );                                     // Q7

                        test();
+1 −1
Original line number Diff line number Diff line
@@ -2073,7 +2073,7 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 stab_fac_fx;
    Word16 Q_new_loc;
    Word16 Q_r[2] = { 0 };
    Word16 A_loc_fx[NB_SUBFR16k * ( M + 1 )];
    Word16 A_loc_fx[NB_SUBFR16k * ( M + 1 )] = { 0 };
    Word16 epsP_l_loc[M + 1];
    Word16 epsP_h_loc[M + 1];
    Word32 ener_fx;