Commit 44ade344 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

introduce FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig and...

introduce FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig and FIX_1439_SPEEDUP_sum2_fx_mod , delete FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32 - activate FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig which should be BE
parent e3f013ae
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
@@ -62,7 +62,13 @@
//#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE1
//#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE2
//#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE3
//#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig  // be       // 2    WMOPS
//#define FIX_1439_SPEEDUP_sum2_fx_mod                              // 3liner   // 0.25 WMOPS
// Numbers ALL:     83,2
// Numbers beOnly:  86,162
// NUmbers none:    88,183
/*----------------------------------------------------------------------------------*
 * Prototypes of global macros
@@ -3262,17 +3268,6 @@ void interp_code_4over2_fx(
void wb_tbe_extras_reset_synth_fx( Word16 state_lsyn_filt_shb[], Word16 state_lsyn_filt_dwn_shb[], Word16 state_32and48k_WB_upsample[], Word16 state_resamp_HB[] );
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
void elliptic_bpf_48k_generic_fx(
    const Word16* input_fx, /* i  : i   signal                              Q_input_fx  */
    Word16 *Q_input_fx,
    Word16 output_fx[],    /* o  : output signal                               */
    Word32 memory_fx[][4], /* i/o: 4 arrays of 4 for memory                   memory_fx_Q */
    Word16 memory_fx_Q[],
    const Word16 full_band_bpf[][5], /* i  : filter coefficients b0,b1,b2,a0,a1,a2  Q13  */
    const Word32 *output32_fx,
    const Word16 *scale_output32_fx);
#else
void elliptic_bpf_48k_generic_fx(
    const Word16 input_fx[], /* i  : i   signal                              Q_input_fx  */
    Word16 *Q_input_fx,
@@ -3281,7 +3276,6 @@ void elliptic_bpf_48k_generic_fx(
    Word16 memory_fx_Q[],
    const Word16 full_band_bpf[][5] /* i  : filter coefficients b0,b1,b2,a0,a1,a2  Q13  */
);
#endif
void synthesise_fb_high_band_fx(
    const Word16 excitation_in[], /* i  : full band excitation                                */
+181 −33
Original line number Diff line number Diff line
@@ -6694,8 +6694,6 @@ void wb_tbe_extras_reset_synth_fx(
 * 18th-order elliptic bandpass filter at 14.0 to 20 kHz sampled at 48 kHz
 * Implemented as 3 fourth order sections cascaded.
 *-------------------------------------------------------------------*/
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
#else
void elliptic_bpf_48k_generic_fx(
    const Word16 input_fx[], /* i  : input signal                             Q_input_fx*/
    Word16 *Q_input_fx,
@@ -6704,12 +6702,12 @@ void elliptic_bpf_48k_generic_fx(
    Word16 memory_fx_Q[],
    const Word16 full_band_bpf_fx[][5] /* i  : filter coefficients b0,b1,b2,a0,a1,a2  Q13  */
)
#endif
{
    Word16 i, j;
    Word16 memory_fx0[4][4], memory_fx[4][4], Q_temp, Q_temp2;
    Word32 L_tmp[L_FRAME48k], L_tmp2[L_FRAME48k], L_output[L_FRAME48k], L_tmpX, memory2_fx[4][4], L_tmpMax;
    Word32 L_tmp[L_FRAME48k], L_tmp2[L_FRAME48k], L_tmpX, memory2_fx[4][4], L_tmpMax;
    Word32 memory2_fx_2[4], memory2_fx_3[4];
    Word32 L_output[L_FRAME48k];

    FOR( i = 0; i < 4; i++ )
    {
@@ -6769,6 +6767,85 @@ void elliptic_bpf_48k_generic_fx(
    L_tmp[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( memory2_fx[1][3], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
    move32();
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE1
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig
    test();
    IF( full_band_bpf_fx == full_band_bpf_3_fx || full_band_bpf_fx == full_band_bpf_1_fx )
    {
        Word64 W_tmpX;
        Word64 W_tmpY;
        i = 4;

        W_tmpX = W_mac_16_16( 0, input_fx[i - 4], full_band_bpf_fx[0][4] );
        // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 3], full_band_bpf_fx[0][3] );
        W_tmpY = W_msu_32_16( 0, L_tmp[i - 1], full_band_bpf_fx[3][1] );
        // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 2], full_band_bpf_fx[0][2] );
        W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 2], full_band_bpf_fx[3][2] );
        W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 1], full_band_bpf_fx[0][1] );
        W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 3], full_band_bpf_fx[3][3] );
        // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i], full_band_bpf_fx[0][0] );
        W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 4], full_band_bpf_fx[3][4] );
        L_tmp[i] = W_sat_l( W_add( W_shr( W_tmpX, 3 ), W_shl( W_tmpY, 2 - 16 ) ) ); /*Q_input_fx + 11*/
        move32();
        i++;

        // W_tmpX = W_mac_16_16( 0, input_fx[i - 4], full_band_bpf_fx[0][4] );
        // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 3], full_band_bpf_fx[0][3] );
        W_tmpY = W_msu_32_16( 0, L_tmp[i - 1], full_band_bpf_fx[3][1] );
        W_tmpX = W_mac_16_16( 0, input_fx[i - 2], full_band_bpf_fx[0][2] );
        W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 2], full_band_bpf_fx[3][2] );
        // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 1], full_band_bpf_fx[0][1] );
        W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 3], full_band_bpf_fx[3][3] );
        // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i], full_band_bpf_fx[0][0] );
        W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 4], full_band_bpf_fx[3][4] );
        L_tmp[i] = W_sat_l( W_add( W_shr( W_tmpX, 3 ), W_shl( W_tmpY, 2 - 16 ) ) ); /*Q_input_fx + 11*/
        move32();
        i++;

        FOR( ; i < L_FRAME48k / 3; )
        {
            // W_tmpX = W_mac_16_16( 0, input_fx[i - 4], full_band_bpf_fx[0][4] );         //2
            W_tmpX = W_mac_16_16( 0, input_fx[i - 3], full_band_bpf_fx[0][3] ); // 3
            W_tmpY = W_msu_32_16( 0, L_tmp[i - 1], full_band_bpf_fx[3][1] );
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 2], full_band_bpf_fx[0][2] );    //4
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 2], full_band_bpf_fx[3][2] );
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 1], full_band_bpf_fx[0][1] );    //5
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 3], full_band_bpf_fx[3][3] );
            W_tmpX = W_mac_16_16( W_tmpX, input_fx[i], full_band_bpf_fx[0][0] ); // 6
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 4], full_band_bpf_fx[3][4] );
            L_tmp[i] = W_sat_l( W_add( W_shr( W_tmpX, 3 ), W_shl( W_tmpY, 2 - 16 ) ) ); /*Q_input_fx + 11*/
            move32();
            i++;

            W_tmpX = W_mac_16_16( 0, input_fx[i - 4], full_band_bpf_fx[0][4] ); // 3
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 3], full_band_bpf_fx[0][3] );      //4
            W_tmpY = W_msu_32_16( 0, L_tmp[i - 1], full_band_bpf_fx[3][1] );
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 2], full_band_bpf_fx[0][2] );      //5
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 2], full_band_bpf_fx[3][2] );
            W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 1], full_band_bpf_fx[0][1] ); // 6
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 3], full_band_bpf_fx[3][3] );
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i], full_band_bpf_fx[0][0] );          //7
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 4], full_band_bpf_fx[3][4] );
            L_tmp[i] = W_sat_l( W_add( W_shr( W_tmpX, 3 ), W_shl( W_tmpY, 2 - 16 ) ) ); /*Q_input_fx + 11*/
            move32();
            i++;

            // W_tmpX = W_mac_16_16( 0, input_fx[i - 4], full_band_bpf_fx[0][4] );         //4
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 3], full_band_bpf_fx[0][3] );    //5
            W_tmpY = W_msu_32_16( 0, L_tmp[i - 1], full_band_bpf_fx[3][1] );
            W_tmpX = W_mac_16_16( 0, input_fx[i - 2], full_band_bpf_fx[0][2] ); // 6
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 2], full_band_bpf_fx[3][2] );
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i - 1], full_band_bpf_fx[0][1] );    //7
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 3], full_band_bpf_fx[3][3] );
            // W_tmpX = W_mac_16_16( W_tmpX, input_fx[i], full_band_bpf_fx[0][0] );        //8
            W_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 4], full_band_bpf_fx[3][4] );
            L_tmp[i] = W_sat_l( W_add( W_shr( W_tmpX, 3 ), W_shl( W_tmpY, 2 - 16 ) ) ); /*Q_input_fx + 11*/
            move32();
            i++;
        }
    }
    ELSE
#else
    {
        FOR( i = 4; i < L_FRAME48k; i++ )
        {
            Word64 W_tmpX;
@@ -6785,7 +6862,80 @@ void elliptic_bpf_48k_generic_fx(
            L_tmp[i] = W_sat_l( W_add( W_shr( W_tmpX, 3 ), W_shl( W_tmpY, 2 - 16 ) ) ); /*Q_input_fx + 11*/
            move32();
        }
    }
#endif /*FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig*/
#else  /*FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE1*/
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig
    test();
    IF( full_band_bpf_fx == full_band_bpf_3_fx || full_band_bpf_fx == full_band_bpf_1_fx )
    {
        i = 4;
        L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 ); // 0 /*Q_input_fx + 13 + 1 - 3*/
        // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );        //1 /*Q_input_fx + 13 + 1 - 3*/
        L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
        // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX );        //2 /*Q_input_fx + 13 + 1 - 3*/
        L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
        L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX );      // 3 /*Q_input_fx + 13 + 1 - 3*/
        L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
        // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX );            //4 /*Q_input_fx + 13 + 1 - 3*/
        L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
        move32();
        i++;

        // L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 );                             //1 /*Q_input_fx + 13 + 1 - 3*/
        // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );        //2 /*Q_input_fx + 13 + 1 - 3*/
        L_tmpX = L_sub_sat( 0, L_shl_sat( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) );      /*Q_input_fx + 11 + 13  -15 +2*/
        L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX );      // 3 /*Q_input_fx + 13 + 1 - 3*/
        L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
        // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX );        //4 /*Q_input_fx + 13 + 1 - 3*/
        L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
        // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX );            //5 /*Q_input_fx + 13 + 1 - 3*/
        L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
        move32();
        i++;

        FOR( ; i < L_FRAME48k / 3; )
        {
            // L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 );                             //2 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), 0 );           // 3 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX );        //4 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX );        //5 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[3][3] ), 2 ) );   /*Q_input_fx + 11 + 13  -15 +2*/
            L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX );            // 6 /*Q_input_fx + 13 + 1 - 3*/
            L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            move32();
            i++;

            L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 ); // 3 /*Q_input_fx + 13 + 1 - 3*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );        //4 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX );        //5 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX );      // 6 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX );            //7 /*Q_input_fx + 13 + 1 - 3*/
            L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            move32();
            i++;

            // L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 );                             //4 /*Q_input_fx + 13 + 1 - 3*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );        //5 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( 0, L_shl_sat( Mult_32_16( L_tmp[i - 1], full_band_bpf_fx[3][1] ), 2 ) );      /*Q_input_fx + 11 + 13  -15 +2*/
            L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX );      // 6 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 2], full_band_bpf_fx[3][2] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 1], full_band_bpf_fx[0][1] ), 3 ), L_tmpX );        //7 /*Q_input_fx + 13 + 1 - 3*/
            L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[3][3] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            // L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i], full_band_bpf_fx[0][0] ), 3 ), L_tmpX );            //8 /*Q_input_fx + 13 + 1 - 3*/
            L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            move32();
            i++;
        }
    }
    ELSE
#else
    {
        FOR( i = 4; i < L_FRAME48k; i++ )
        {
            L_tmpX = L_shr( L_mult( input_fx[i - 4], full_band_bpf_fx[0][4] ), 3 );                             /*Q_input_fx + 13 + 1 - 3*/
@@ -6799,6 +6949,8 @@ void elliptic_bpf_48k_generic_fx(
            L_tmp[i] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
            move32();
        }
    }
#endif /*FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_upsampledsig*/
#endif


@@ -6857,6 +7009,7 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[3] ) );

#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE2

    FOR( i = 4; i < L_FRAME48k; i++ )
    {
        Word64 W_tmpX;
@@ -6874,7 +7027,8 @@ void elliptic_bpf_48k_generic_fx(
        move32();
        L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[i] ) );
    }
#else

#else /*FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE2*/
    FOR( i = 4; i < L_FRAME48k; i++ )
    {
        L_tmpX = L_shr( Mult_32_16( L_tmp[i - 4], full_band_bpf_fx[1][4] ), 3 );                              /*Q_input_fx + 11 + 13 - 15 -3*/
@@ -6889,7 +7043,7 @@ void elliptic_bpf_48k_generic_fx(
        move32();
        L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[i] ) );
    }
#endif
#endif /*FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_STAGE2*/
    Q_temp = norm_l( L_tmpMax );
    Q_temp = sub( Q_temp, 4 );
    Scale_sig32( L_tmp2, 960, Q_temp );
@@ -7025,12 +7179,15 @@ void elliptic_bpf_48k_generic_fx(
    move16();
    move16();
    Q_temp2 = norm_l( L_tmpMax );

    {
        Scale_sig32( L_output, 960, Q_temp2 );
        FOR( i = 0; i < 960; i++ )
        {
            output_fx[i] = extract_h( L_output[i] );
            move16();
        }
    }
    *Q_input_fx = sub( add( add( *Q_input_fx, Q_temp ), Q_temp2 ), 15 );
    move16(); /* BASOP_NOGLOB */

@@ -7066,11 +7223,11 @@ void synthesise_fb_high_band_fx(
{
    Word16 i, j;
    Word16 excitation_in_interp3[L_FRAME48k];
    Word16 tmp[L_FRAME48k];
    Word32 temp1;
    Word32 ratio2;
    Word32 L_tmp;
    Word16 tmp3, tmp1, tmp2, exp, exp2, exp_tmp;
    Word16 tmp[L_FRAME48k];

    push_wmops( "SYNTHESISE_FB_HIGH_BAND PART A" );
    /* Interpolate the white energy shaped gaussian excitation from 16 kHz to 48 kHz with zeros */
@@ -7092,20 +7249,12 @@ void synthesise_fb_high_band_fx(
    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
        /* for 16kHz ACELP core */
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
        elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, NULL, bpf_memory, bpf_memory_Q, full_band_bpf_3_fx, tmp32, scale_tmp32 );
#else
        elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_3_fx );
#endif
    }
    ELSE
    {
        /* for 12.8kHz ACELP core */
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
        elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, NULL, bpf_memory, bpf_memory_Q, full_band_bpf_1_fx, tmp32, scale_tmp32 );
#else
        elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_1_fx );
#endif

    }
    pop_wmops(); /*push_wmops( "SYNTHESISE_FB_HIGH_BAND PART A.1" );*/
@@ -7113,7 +7262,6 @@ void synthesise_fb_high_band_fx(

    push_wmops( "SYNTHESISE_FB_HIGH_BAND PART B" );
    temp1 = sum2_fx_mod( tmp, L_FRAME48k );

    L_tmp = L_max( 1, fb_exc_energy ); /*Q(2*Q_fb_exc + 1)*/
    exp = norm_l( L_tmp );
    tmp3 = extract_h( L_shl( L_tmp, exp ) );
+17 −1
Original line number Diff line number Diff line
@@ -446,6 +446,21 @@ Word32 sum2_fx_mod( /* o : sum of all squared vector element
                    const Word16 lvec  /* i  : length of input vector                */
)
{
#ifdef FIX_1439_SPEEDUP_sum2_fx_mod
    Word16 i;
    Word64 W_tmp;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif

    W_tmp = W_add(0, 0 );
    FOR( i = 0; i < lvec; i++ )
    {
        W_tmp = W_mac_16_16( W_tmp, vec[i], vec[i] );
    }
    return W_sat_l(W_shr(W_tmp, 9));
#else
    Word16 i;
    Word32 L_tmp;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
@@ -458,8 +473,9 @@ Word32 sum2_fx_mod( /* o : sum of all squared vector element
    {
        L_tmp = L_add_o( L_tmp, L_shr( L_mult_o( vec[i], vec[i], &Overflow ), 9 ), &Overflow );
    }

    return L_tmp;
#endif

}
/*-------------------------------------------------------------------*
 * Copy:
+0 −12
Original line number Diff line number Diff line
@@ -7324,11 +7324,7 @@ void fb_tbe_enc_fx(
    exp_temp = sub( exp_temp, 1 );

    Copy_Scale_sig( new_input, input_fhb, L_FRAME48k, exp_temp );
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
    elliptic_bpf_48k_generic_fx( input_fhb, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx, NULL, NULL );
#else
    elliptic_bpf_48k_generic_fx( input_fhb, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
#endif
    Sample_Delay_HP = NS2SA( 48000, ACELP_LOOK_NS + DELAY_FD_BWE_ENC_12k8_NS + DELAY_FIR_RESAMPL_NS ) - L_FRAME48k / 2;

    IF( NE_16( st->last_extl, FB_TBE ) )
@@ -7452,19 +7448,11 @@ void fb_tbe_enc_ivas_fx(

    IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) )
    {
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
        elliptic_bpf_48k_generic_fx( input_fhb_new, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx, NULL, NULL );
#else
        elliptic_bpf_48k_generic_fx( input_fhb_new, &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
#endif
    }
    ELSE
    {
#ifdef FIX_1439_SPEEDUP_elliptic_bpf_48k_generic_OUT32
        elliptic_bpf_48k_generic_fx( input_fhb_new + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ), &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx, NULL, NULL );
#else
        elliptic_bpf_48k_generic_fx( input_fhb_new + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ), &exp_temp, tmp_vec, hBWE_TD->elliptic_bpf_2_48k_mem_fx, hBWE_TD->elliptic_bpf_2_48k_mem_fx_Q, full_band_bpf_2_fx );
#endif
    }

    test();