Commit ca6879b8 authored by Fabian Bauer's avatar Fabian Bauer Committed by Manuel Jander
Browse files

added FIX_1326_SPEEDUP_08

parent 9100fa6d
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@
#define FIX_1326_SPEEDUP_05 // div->sqrt =>isqrt // 3.5 WMOPS
#define FIX_1326_SPEEDUP_06 // div->sqrt =>isqrt // 3.0 WMOPS
#define FIX_1326_SPEEDUP_07 // div->sqrt =>isqrt // 2.8 WMOPS
#define FIX_1326_SPEEDUP_08 // "-"               // 3.0 WMOPS
Word16 slot_fx[4] = { 32767, 16384, 10922, 8192 };

/*-------------------------------------------------------------------------
@@ -4435,6 +4436,20 @@ static void formulate2x2MixingMatrix_fx(
    move32();
#endif

#ifdef FIX_1326_SPEEDUP_08
    // This is just a shortcut to already existing optimizations  (FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC) - but makes everything even faster
    {
        div_fx[1] = L_add( 0, 2047986068 ); // Q = 31 - exp1
        exp1 = add( 0, 20 );                // move32();
    }

    IF( D_fx[1] != 0 ) // This is the new code: replace div sqrt by isqrt
    {
        exp1 = sub( 31, q_D );
        div_fx[1] = ISqrt32( D_fx[1], &exp1 );
        move32();
    }
#else
    IF( D_fx[1] == 0 )
    {
#ifndef FIX_1009_REPLACE_DIV_SQRT_BY_ISQRT_LC
@@ -4454,13 +4469,7 @@ static void formulate2x2MixingMatrix_fx(
    }
    div_fx[1] = Sqrt32( temp, &exp1 ); // Q = 31 - exp1
    move32();

    IF( D_fx[1] != 0 ) // This is the new code: replace div sqrt by isqrt
    {
        exp1 = sub( 31, q_D );
        div_fx[1] = ISqrt32( D_fx[1], &exp1 );
        move32();
    }
#endif
    q_div = sub( 31, s_max( exp, exp1 ) );

    div_fx[0] = L_shr( div_fx[0], sub( sub( 31, exp ), q_div ) ); // q_div