Commit 74e70783 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

add FIX_1439_SPEEDUP_elliptic_bpf_48k_generic STAGE1

parent 3a315e7b
Loading
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -6693,6 +6693,8 @@ void wb_tbe_extras_reset_synth_fx(
 * Implemented as 3 fourth order sections cascaded.
 *-------------------------------------------------------------------*/

#define FIX_1439_SPEEDUP_elliptic_bpf_48k_generic

void elliptic_bpf_48k_generic_fx(
    const Word16 input_fx[], /* i  : input signal                             Q_input_fx*/
    Word16 *Q_input_fx,
@@ -6721,6 +6723,7 @@ void elliptic_bpf_48k_generic_fx(
        move32();
    }


    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*/
    L_tmpX = L_add( L_shr( L_mult( memory_fx[0][2], full_band_bpf_fx[0][2] ), 3 ), L_tmpX );                /*Q_input_fx + 13 + 1 - 3*/
@@ -6763,6 +6766,24 @@ 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( 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
    FOR( i = 4; i < L_FRAME48k; i++ )
    {
        Word64 W_tmpX;
        Word64 W_tmpY = W_add( 0, 0 );
        W_tmpX = W_deposit32_l( L_mult( 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( W_tmpY, 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_sub( W_shr( W_tmpX, 3 ), W_shl( W_tmpY, 2 ) ) ); /*Q_input_fx + 11*/
        move32();
    }
#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*/
@@ -6776,6 +6797,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 


    memory_fx2[0][0] = input_fx[L_FRAME48k - 4];
    memory_fx2[0][1] = input_fx[L_FRAME48k - 3];
@@ -7004,6 +7027,7 @@ void synthesise_fb_high_band_fx(
    Word32 L_tmp;
    Word16 tmp3, tmp1, tmp2, exp, exp2, exp_tmp;

    push_wmops( "SYNTHESISE_FB_HIGH_BAND PART A" );
    /* Interpolate the white energy shaped gaussian excitation from 16 kHz to 48 kHz with zeros */
    j = 0;
    /* white excitation from DC to 8 kHz resampled to produce DC to 24 kHz excitation.          */
@@ -7019,6 +7043,7 @@ void synthesise_fb_high_band_fx(
    }
    exp_tmp = sub( Q_fb_exc, 2 );

    push_wmops( "SYNTHESISE_FB_HIGH_BAND PART A.1" );
    IF( EQ_16( L_frame, L_FRAME16k ) )
    {
        /* for 16kHz ACELP core */
@@ -7029,6 +7054,10 @@ void synthesise_fb_high_band_fx(
        /* for 12.8kHz ACELP core */
        elliptic_bpf_48k_generic_fx( excitation_in_interp3, &exp_tmp, tmp, bpf_memory, bpf_memory_Q, full_band_bpf_1_fx );
    }
      pop_wmops(); /*push_wmops( "SYNTHESISE_FB_HIGH_BAND PART A.1" );*/
      pop_wmops(); /*push_wmops( "SYNTHESISE_FB_HIGH_BAND PART A" )*/

      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)*/
@@ -7085,6 +7114,7 @@ void synthesise_fb_high_band_fx(
            move16();
        }
    }
    pop_wmops(); /*push_wmops( "SYNTHESISE_FB_HIGH_BAND PART B" );*/
    return;
}