Commit b324bfbc authored by Manuel Jander's avatar Manuel Jander
Browse files

Fix missing include and second Givens Rotation case.

parent 578055a5
Loading
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -2491,6 +2491,7 @@ static void singularVectorsAccumulationRight(
#ifdef IVAS_FLOAT_FIXED

#ifdef FIX_1010_OPT_GIVENS_AMAX_BMIN
#include <math.h> /* for M_PI */
#define NUM_REGIONS 1024
static Word32 alphaBeta[NUM_REGIONS][2];
static void get_alpha_beta(Word32 p, Word16 p_e, Word32 q, Word16 q_e, Word32 *alpha, Word32 *beta)
@@ -2600,8 +2601,22 @@ static Word32 GivensRotation_fx(
#endif

#ifdef FIX_1010_OPT_GIVENS
#ifdef FIX_1010_OPT_GIVENS_AMAX_BMIN
    Word32 az, ax, a, b;

    ax = L_abs(x);
    az = L_abs(z);
    IF (BASOP_Util_Cmp_Mant32Exp(ax, x_e, az, z_e) > 0) {
        get_alpha_beta(ax, x_e, az, z_e, &a, &b);
        r = BASOP_Util_Add_Mant32Exp(Mpy_32_32(ax, a), x_e, Mpy_32_32(az, b), z_e, out_e);
    } ELSE {
        get_alpha_beta(az, z_e, ax, x_e, &a, &b);
        r = BASOP_Util_Add_Mant32Exp(Mpy_32_32(az, a), z_e, Mpy_32_32(ax, b), x_e, out_e);
    }
#else
    r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( z, z ), shl( z_e, 1 ), Mpy_32_32( x, x ), shl( x_e, 1 ), out_e );
    r = Sqrt32( r, out_e );
#endif
#else
    x_abs = L_abs( x );
    z_abs = L_abs( z );