Commit d41a00b7 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

deactivate STAGE2 and func1 - implement func1

parent a5767cc8
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -87,5 +87,6 @@

#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic              /*FhG: reduces maintenance complexity & reduces WMOPS & prepares STAGE2 patch*/
//#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2       /*FhG: reduces WMOPS* /
//#define FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1

#endif
+127 −6
Original line number Diff line number Diff line
@@ -6687,6 +6687,112 @@ void wb_tbe_extras_reset_synth_fx(
    return;
}

#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1
inline static void elliptic_bpf_48k_generic_func1( Word32 *input_fx, Word32 *L_tmp, const Word16 full_band_bpf_fx[][5], Word16 IsUpsampled3, Word32 L_tmpMax )
{
    Word32 L_tmpX;
    Word16 i;
    IF( !IsUpsampled3 )
    {
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
        FOR( i = 0; i < L_FRAME48k; 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( 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_shr( W_add( W_tmpX, W_shl( W_tmpY, 2 - 16 + 3 ) ), 3 ) ); /*Q_input_fx + 11*/
            move32();
        }
#else
        FOR( i = 0; 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*/
            L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );      /*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 );      /*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 );      /*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 );          /*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();
        }
#endif
        } /*IsUpsampled3*/
        ELSE
        { /*IsUpsampled3*/
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
            FOR( i = 0; i < L_FRAME48k; )
            {
                W_tmpX = W_mac_16_16( 0, 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_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 2], full_band_bpf_fx[3][2] );
                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_shr( W_add( W_tmpX, W_shl( W_tmpY, 2 - 16 + 3 ) ), 3 ) ); /*Q_input_fx + 11*/
                move32();
                i++;

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

                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_tmpY = W_msu_32_16( W_tmpY, L_tmp[i - 3], full_band_bpf_fx[3][3] );
                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_shr( W_add( W_tmpX, W_shl( W_tmpY, 2 - 16 + 3 ) ), 3 ) ); /*Q_input_fx + 11*/
                move32();
                i++;
            }
#else
            FOR( i = 0; i < L_FRAME48k; )
            {
                L_tmpX = L_add_sat( L_shr( L_mult( input_fx[i - 3], full_band_bpf_fx[0][3] ), 3 ), 0 );             /*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_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_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 );            /*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 );                             /*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_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 );        /*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_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_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 );        /*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_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_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++;
            }
#endif /*#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/
        } /*IsUpsampled3*/
}
#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1*/

/*-------------------------------------------------------------------*
 * elliptic_bpf_48k_generic()
 *
@@ -6715,7 +6821,7 @@ void elliptic_bpf_48k_generic_fx(
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    Word16 memory_fx0, Q_temp, Q_temp2;
    Word32 L_tmp_buffer[L_FRAME48k + 4], L_tmp2_buffer[L_FRAME48k + 4], L_output_buffer[L_FRAME48k + 4], L_tmpX;
    Word32 L_tmpMax = L_add( 0, 0 );
    Word32 L_tmpMax;
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
    Word64 W_tmpX;
    Word64 W_tmpY;
@@ -6750,6 +6856,10 @@ void elliptic_bpf_48k_generic_fx(
    }

#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    L_tmpMax = L_add( 0, 0 );
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1 /*use subfunc*/
    elliptic_bpf_48k_generic_func1( input_fx, L_tmp, &full_band_bpf_fx[0], IsUpsampled3, 0 );
#else
    IF( !IsUpsampled3 )
    {
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
@@ -6783,7 +6893,7 @@ void elliptic_bpf_48k_generic_fx(
            move32();
        }
#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/
    }
    } /*IsUpsampled3*/
    ELSE
    {
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
@@ -6848,7 +6958,9 @@ void elliptic_bpf_48k_generic_fx(
            i++;
        }
#endif /*#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/
    }
    } /*IsUpsampled3*/
#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1*/

#else  /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic*/
    L_tmpX = L_shr( L_mult( memory_fx[0][0], full_band_bpf_fx[0][4] ), 3 );                             /*Q_input_fx + 13 + 1 - 3*/
    L_tmpX = L_add( L_shr( L_mult( memory_fx[0][1], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );            /*Q_input_fx + 13 + 1 - 3*/
@@ -6921,6 +7033,10 @@ void elliptic_bpf_48k_generic_fx(
    move32();

#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    L_tmpMax = L_add( 0, 0 );
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1 /*use subfunc*/
    elliptic_bpf_48k_generic_func1( L_tmp, L_tmp2, &full_band_bpf_fx[1], 0, &L_tmpMax );
#else
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
    FOR( i = 0; i < L_FRAME48k; i++ )
    {
@@ -6953,8 +7069,8 @@ void elliptic_bpf_48k_generic_fx(
        L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[i] ) );
    }
#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/

#else
#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1*/
#else /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic*/
    L_tmpX = L_shr( Mult_32_16( memory2_fx[1][0], full_band_bpf_fx[1][4] ), 3 );                             /*Q_input_fx + 11 + 13 - 15 -3*/
    L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][1], full_band_bpf_fx[1][3] ), 3 ), L_tmpX );            /*Q_input_fx + 11 + 13 - 15 -3*/
    L_tmpX = L_add( L_shr( Mult_32_16( memory2_fx[1][2], full_band_bpf_fx[1][2] ), 3 ), L_tmpX );            /*Q_input_fx + 11 + 13 - 15 -3*/
@@ -7038,6 +7154,10 @@ void elliptic_bpf_48k_generic_fx(
        move32();
    }
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    L_tmpMax = L_add( 0, 0 );
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1 /*use subfunc*/
    elliptic_bpf_48k_generic_func1( L_tmp2, L_output, &full_band_bpf_fx[2], 0, &L_tmpMax );
#else
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2
    FOR( i = 0; i < L_FRAME48k; i++ )
    {
@@ -7073,7 +7193,8 @@ void elliptic_bpf_48k_generic_fx(
        L_tmpMax = L_max( L_tmpMax, L_abs( L_output[i] ) );
    }
#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_STAGE2*/
#else
#endif /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic_func1*/
#else /*FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic*/
    L_tmpX = L_shr( Mult_32_16( memory2_fx_2[0], full_band_bpf_fx[2][4] ), 3 );                               /* *Q_input_fx+6 +Q_temp +13 -15 -3 */
    L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[1], full_band_bpf_fx[2][3] ), 3 ), L_tmpX );          /*Q_input_fx + 6 +Q_temp+13 -15 -3*/
    L_tmpX = L_add_sat( L_shr( Mult_32_16( memory2_fx_2[2], full_band_bpf_fx[2][2] ), 3 ), L_tmpX );          /*Q_input_fx + 6 +Q_temp+13 -15 -3*/