Commit 8d4ec1c3 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Optimize get_min_scalefactor(), avoid IF

parent cbf1b464
Loading
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -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++ )
+1 −0
Original line number Diff line number Diff line
@@ -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