diff --git a/lib_com/fft_fx.c b/lib_com/fft_fx.c index 13417b8c449073f71ba6514343182626fe9fa463..c4237bcc9b2efce09f1c19e027f163bfcd63c2b0 100644 --- a/lib_com/fft_fx.c +++ b/lib_com/fft_fx.c @@ -7284,6 +7284,7 @@ Word16 L_norm_arr( Word32 *arr, Word16 size ) Word16 get_min_scalefactor( Word32 x, Word32 y ) { +#ifndef FIX_1104_OPT_GETMINSCALEFAC Word16 scf = Q31; move16(); test(); @@ -7300,8 +7301,34 @@ Word16 get_min_scalefactor( Word32 x, Word32 y ) scf = s_min( scf, norm_l( y ) ); } return scf; +#else + Word16 scf_y; + Word16 scf = Q31; + move16(); + + test(); + if ( x == 0 && y == 0 ) + { + scf = 0; + move16(); + } + + if ( x != 0 ) + { + scf = norm_l( x ); + } + + scf_y = norm_l( y ); + if ( y != 0 ) + { + scf = s_min( scf_y, scf ); + } + + return scf; +#endif } + Flag is_zero_arr( Word32 *arr, Word16 size ) { FOR( Word16 i = 0; i < size; i++ ) diff --git a/lib_com/options.h b/lib_com/options.h index c86bbfcfbc98ee40edd6cdad9c2a78838ff96709..686288b80b09f4fdbd9d0e601e28481015bede1e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -94,4 +94,5 @@ #define FIX_1049_SHR_RO_COMPLEXITY /* VA: fix for issue 1049: incorrect counting of complexity in the shr_ro() function */ #define FIX_1103_OPT_L_NORM_ARR /* FhG: Optimize L_norm_arr(), avoid IF */ #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 */ #endif