Commit 2df7ea72 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

change to easy-readable changes

parent 101a3cb1
Loading
Loading
Loading
Loading
Loading
+6 −17
Original line number Diff line number Diff line
@@ -1221,52 +1221,41 @@ Word16 maximum_exp_fx( /* o : index of the maximum value
)
{
    Word16 j, ind;
#ifndef FIX_1981_MAXIMUM_EXP_FX
    Word16 tmp, exp;
    ind = 0;
    move16();
#ifndef FIX_1981_MAXIMUM_EXP_FX
    tmp = vec_fx[0];
    move16();
    exp = exp_vec[0];
    move16();
#else
    Word16 tmp, exp, scale;
    ind = 0;
    move16();
#endif
    Word16 scale;

#ifdef FIX_1981_MAXIMUM_EXP_FX
    scale = sub( norm_s( vec_fx[ind] ), 1 );
    tmp = shl( vec_fx[ind], scale );
    exp = sub( exp_vec[ind], scale );
#endif

    FOR( j = 1; j < lvec_fx; j++ )
    {

        IF( LT_16( tmp, shr_sat( vec_fx[j], sub( exp, exp_vec[j] ) ) ) )
        {
            ind = j;
            move16();

#ifdef FIX_1981_MAXIMUM_EXP_FX
            scale = sub( norm_s( vec_fx[ind] ), 1 );
            tmp = shl( vec_fx[ind], scale );
            exp = sub( exp_vec[ind], scale );
        }
    }
#else
    FOR( j = 1; j < lvec_fx; j++ )
    {
        IF( LT_16( tmp, shr_sat( vec_fx[j], sub( exp, exp_vec[j] ) ) ) )
        {
            ind = j;
            move16();
            tmp = vec_fx[j];
            move16();
            exp = exp_vec[j];
            move16();
#endif
        }
    }
#endif


    return ind;
}