diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index 5f5bd26d5355d38f0f4ab7f8a7f1eb6667a136c5..5738b6feb7715c9474c06907d2ae9b6e3e46186a 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -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(); diff --git a/lib_com/options.h b/lib_com/options.h index c644d36d0bf7f788269e2303a4363aba84430c76..cb8918eed76624e373c2b065ad24bf551b2aa32e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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