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

integrate loops into speedup if and else branch part 2

parent ada8a986
Loading
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -6741,6 +6741,8 @@ void elliptic_bpf_48k_generic_fx(
    }

#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    int i = 0;

    L_tmpX = L_shr( L_mult( input_fx[0 - 4], full_band_bpf_fx[0][4] ), 3 );                             /*Q_input_fx + 13 + 1 - 3*/
    L_tmpX = L_add( L_shr( L_mult( input_fx[1 - 4], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );            /*Q_input_fx + 13 + 1 - 3*/
    L_tmpX = L_add( L_shr( L_mult( input_fx[2 - 4], full_band_bpf_fx[0][2] ), 3 ), L_tmpX );            /*Q_input_fx + 13 + 1 - 3*/
@@ -6751,6 +6753,7 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1 - 4], full_band_bpf_fx[3][3] ), 2 ) );   /*Q_input_fx + 11 + 13  -15 +2*/
    L_tmp[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0 - 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[1 - 4], full_band_bpf_fx[0][4] ), 3 );                             /*Q_input_fx + 13 + 1 - 3*/
    L_tmpX = L_add( L_shr( L_mult( input_fx[2 - 4], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );            /*Q_input_fx + 13 + 1 - 3*/
@@ -6762,6 +6765,7 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[2 - 4], full_band_bpf_fx[3][3] ), 2 ) );   /*Q_input_fx + 11 + 13  -15 +2*/
    L_tmp[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[1 - 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[2 - 4], full_band_bpf_fx[0][4] ), 3 );                             /*Q_input_fx + 13 + 1 - 3*/
    L_tmpX = L_add( L_shr( L_mult( input_fx[3 - 4], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );            /*Q_input_fx + 13 + 1 - 3*/
@@ -6773,6 +6777,7 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[3 - 4], full_band_bpf_fx[3][3] ), 2 ) );   /*Q_input_fx + 11 + 13  -15 +2*/
    L_tmp[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[2 - 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[3 - 4], full_band_bpf_fx[0][4] ), 3 );                             /*Q_input_fx + 13 + 1 - 3*/
    L_tmpX = L_add( L_shr( L_mult( input_fx[0], full_band_bpf_fx[0][3] ), 3 ), L_tmpX );                /*Q_input_fx + 13 + 1 - 3*/
@@ -6784,8 +6789,9 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[0], full_band_bpf_fx[3][3] ), 2 ) );       /*Q_input_fx + 11 + 13  -15 +2*/
    L_tmp[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp[3 - 4], full_band_bpf_fx[3][4] ), 2 ) ); /*Q_input_fx + 11 + 13  -15 +2*/
    move32();
    i++;

    FOR( i = 4; i < L_FRAME48k; i++ )
    FOR( ; 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*/
@@ -6870,6 +6876,8 @@ void elliptic_bpf_48k_generic_fx(
    move32();

#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    int i = 0;

    L_tmpX = L_shr( Mult_32_16( L_tmp[0 - 4], full_band_bpf_fx[1][4] ), 3 );                              /*Q_input_fx + 11 + 13 - 15 -3*/
    L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[1 - 4], 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( L_tmp[2 - 4], full_band_bpf_fx[1][2] ), 3 ), L_tmpX );             /*Q_input_fx + 11 + 13 - 15 -3*/
@@ -6880,7 +6888,9 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1 - 4], full_band_bpf_fx[4][3] ), 2 ) );    /*Q_input_fx + 6 +13 -15 +2*/
    L_tmp2[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0 - 4], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2*/
    move32();
    i++;
    L_tmpMax = L_abs( L_tmp2[0] );

    L_tmpX = L_shr( Mult_32_16( L_tmp[1 - 4], full_band_bpf_fx[1][4] ), 3 );                              /*Q_input_fx + 11 + 13 - 15 -3*/
    L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[2 - 4], 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( L_tmp[3 - 4], full_band_bpf_fx[1][2] ), 3 ), L_tmpX );             /*Q_input_fx + 11 + 13 - 15 -3*/
@@ -6891,7 +6901,9 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[2 - 4], full_band_bpf_fx[4][3] ), 2 ) );    /*Q_input_fx + 6 +13 -15 +2 */
    L_tmp2[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[1 - 4], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */
    move32();
    i++;
    L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[1] ) );

    L_tmpX = L_shr( Mult_32_16( L_tmp[2 - 4], full_band_bpf_fx[1][4] ), 3 );                              /*Q_input_fx + 11 + 13 - 15 -3*/
    L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[3 - 4], 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( L_tmp[0], full_band_bpf_fx[1][2] ), 3 ), L_tmpX );                 /*Q_input_fx + 11 + 13 - 15 -3*/
@@ -6902,7 +6914,9 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[3 - 4], full_band_bpf_fx[4][3] ), 2 ) );    /*Q_input_fx + 6 +13 -15 +2 */
    L_tmp2[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[2 - 4], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */
    move32();
    i++;
    L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[2] ) );

    L_tmpX = L_shr( Mult_32_16( L_tmp[3 - 4], full_band_bpf_fx[1][4] ), 3 );                                                             /*Q_input_fx + 11 + 13 - 15 -3*/
    L_tmpX = L_add( L_shr( Mult_32_16( L_tmp[0], 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( L_tmp[1], full_band_bpf_fx[1][2] ), 3 ), L_tmpX );                                                /*Q_input_fx + 11 + 13 - 15 -3*/
@@ -6913,9 +6927,10 @@ void elliptic_bpf_48k_generic_fx(
    L_tmpX = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[0], full_band_bpf_fx[4][3] ), 2 ) );                                       /*Q_input_fx + 6 +13 -15 +2 */
    L_tmp2[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_tmp2[3 - 4], full_band_bpf_fx[4][4] ), 2 ) ); /*Q_input_fx + 6 +13 -15 +2 */ /*14 + Q_input_fx - shift_flag*/
    move32();
    i++;
    L_tmpMax = L_max( L_tmpMax, L_abs( L_tmp2[3] ) );

    FOR( i = 4; i < L_FRAME48k; i++ )
    FOR( ; 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*/
        L_tmpX = L_add_sat( L_shr( Mult_32_16( L_tmp[i - 3], full_band_bpf_fx[1][3] ), 3 ), L_tmpX );         /*Q_input_fx + 11 + 13 - 15 -3*/
@@ -7013,6 +7028,8 @@ void elliptic_bpf_48k_generic_fx(
        move32();
    }
#ifdef FIX_1439_SPEEDUP_SIMPLIFY_elliptic_bpf_48k_generic
    int i = 0;

    L_tmpX = L_shr( Mult_32_16( L_tmp2[0 - 4], 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( L_tmp2[1 - 4], 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( L_tmp2[2 - 4], full_band_bpf_fx[2][2] ), 3 ), L_tmpX );            /*Q_input_fx + 6 +Q_temp+13 -15 -3*/
@@ -7024,6 +7041,7 @@ void elliptic_bpf_48k_generic_fx(
    L_output[0] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[0 - 4], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2 */
    move32();
    L_tmpMax = L_abs( L_output[0] );
    i++;

    L_tmpX = L_shr( Mult_32_16( L_tmp2[1 - 4], 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( L_tmp2[2 - 4], full_band_bpf_fx[2][3] ), 3 ), L_tmpX );            /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/
@@ -7036,6 +7054,7 @@ void elliptic_bpf_48k_generic_fx(
    L_output[1] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[1 - 4], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +13 -15 + 2+Q_temp*/
    move32();
    L_tmpMax = L_max( L_tmpMax, L_abs( L_output[1] ) );
    i++;

    L_tmpX = L_shr( Mult_32_16( L_tmp2[2 - 4], 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( L_tmp2[3 - 4], full_band_bpf_fx[2][3] ), 3 ), L_tmpX );            /*Q_input_fx +Q_temp+ 6 +13 -15 -3*/
@@ -7048,6 +7067,7 @@ void elliptic_bpf_48k_generic_fx(
    L_output[2] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[2 - 4], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/
    move32();
    L_tmpMax = L_max( L_tmpMax, L_abs( L_output[2] ) );
    i++;

    L_tmpX = L_shr( Mult_32_16( L_tmp2[3 - 4], 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( L_tmp2[0], full_band_bpf_fx[2][3] ), 3 ), L_tmpX );                /*Q_input_fx + 6 +Q_temp+13 -15 -3*/
@@ -7060,8 +7080,9 @@ void elliptic_bpf_48k_generic_fx(
    L_output[3] = L_sub_sat( L_tmpX, L_shl_sat( Mult_32_16( L_output[3 - 4], full_band_bpf_fx[5][4] ), 2 ) ); /*Q_input_fx + 1 +Q_temp+13 -15 + 2*/
    move32();
    L_tmpMax = L_max( L_tmpMax, L_abs( L_output[3] ) );
    i++;

    FOR( i = 4; i < L_FRAME48k; i++ )
    FOR(; i < L_FRAME48k; i++ )
    {
        L_tmpX = L_shr( Mult_32_16( L_tmp2[i - 4], 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( L_tmp2[i - 3], full_band_bpf_fx[2][3] ), 3 ), L_tmpX );       /*Q_input_fx + 6 +Q_temp +13 -15 -3*/