Commit 67305ecc authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '1107-complexity-optimize-v_add_inc_fx' into 'main'

Resolve "[Complexity] Optimize v_add_inc_fx()"

Closes #1107

See merge request !878
parents 3187b18a 71e73340
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -308,10 +308,35 @@ void v_add_inc_fx(
    const Word16 N       /* i  : Vector length                         Q0*/
)
{
#ifndef FIX_1107_VADDINC
    Word16 i;
    Word16 ix1 = 0;
    Word16 ix2 = 0;
    Word16 iy = 0;
#else
    Word16 i, ix1, ix2, iy;

    /* The use of this function is currently always for the interleaved input format, */
    /* that means, the following conditions are always true and thus obsolete.        */
    test();
    test();
    test();
    test();
    IF( ( sub( x_inc, 2 ) == 0 ) && ( sub( x2_inc, 2 ) == 0 ) && ( sub( y_inc, 1 ) == 0 ) && ( &x1[1] == &x2[0] ) )
    {
        /* Interleaved input case, linear output */
        FOR( i = 0; i < N; i++ )
        {
            y[i] = L_add( x1[2 * i + 0], x1[2 * i + 1] ); /*Qx*/
            move32();
        }
        return;
    }

    ix1 = 0;
    ix2 = 0;
    iy = 0;
#endif
    move16();
    move16();
    move16();
+1 −0
Original line number Diff line number Diff line
@@ -96,4 +96,5 @@
#define FIX_1105_OPT_MINIMUM_SL                 /* FhG: Optimize minimum_s(), minimum_l(), avoid IF */
#define FIX_1104_OPT_GETMINSCALEFAC             /* FhG: Optimize get_min_scalefactor(), avoid IF */
#define FIX_1106_SIMPLIFY_SET32FX               /* FhG: simplify set32_fx() */
#define FIX_1107_VADDINC                        /* FhG: Optimize v_add_inc_fx() for most frequent case */
#endif