Commit 98b25ef6 authored by thomas dettbarn's avatar thomas dettbarn
Browse files

closer to the svd-optimizations-float

parent b014ae4a
Loading
Loading
Loading
Loading
+11 −21
Original line number Diff line number Diff line
@@ -69,15 +69,11 @@ static void HouseholderReduction_fx(
static void biDiagonalReductionLeft_fx(
    Word32 singularVectors[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) */
    Word32 singularValues[MAX_OUTPUT_CHANNELS],    /* exp(singularValues_e) */
    Word32 secDiag[MAX_OUTPUT_CHANNELS],           /* exp(secDiag_e) */
    Word16 singularVectors2_e[][MAX_OUTPUT_CHANNELS],
    Word16 singularValues_e[MAX_OUTPUT_CHANNELS],
    Word16 *secDiag_e,
    const Word16 nChannelsL,  /* Q0 */
    const Word16 nChannelsC,  /* Q0 */
    const Word16 currChannel, /* Q0 */
    Word32 g, /* Q31 */
    Word16 g_e
    const Word16 currChannel /* Q0 */
);

static void biDiagonalReductionRight_fx(
@@ -878,7 +874,7 @@ static void HouseholderReduction_fx(
    FOR( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */
    {
#ifdef	MYCHANGES
        biDiagonalReductionLeft_fx( singularVectors_Left_fx, singularValues_fx, secDiag_fx, singularVectors_Left_fx_e, singularValues_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, g_fx, g_e );
        biDiagonalReductionLeft_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Left_fx_e, singularValues_fx_e, nChannelsL, nChannelsC, nCh );
        biDiagonalReductionRight_fx( singularVectors_Left_fx, secDiag_fx, singularVectors_Left_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &g_fx, &g_e );
#else
        biDiagonalReductionLeft_fx( singularVectors_Left_fx, singularValues_fx, secDiag_fx, singularVectors_Left_fx_e, singularValues_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &sig_x_fx, &sig_x_fx_e, &g_fx );
@@ -914,28 +910,19 @@ static void HouseholderReduction_fx(
static void biDiagonalReductionLeft_fx(
    Word32 singularVectors[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) */
    Word32 singularValues[MAX_OUTPUT_CHANNELS],    /* exp(singularValues_e) */
    Word32 secDiag[MAX_OUTPUT_CHANNELS],           /* exp(secDiag_e) */
    Word16 singularVectors2_e[][MAX_OUTPUT_CHANNELS],
    Word16 singularValues_e[MAX_OUTPUT_CHANNELS],
    Word16 *secDiag_e,
    const Word16 nChannelsL,  /* Q0 */
    const Word16 nChannelsC,  /* Q0 */
    const Word16 currChannel, /* Q0 */
    Word32 g, /* Q31 */
    Word16 g_e
    const Word16 currChannel  /* Q0 */
)
{
    Word16 iCh, jCh, idx;
    Word32 norm_x, f, r;
    Word16 norm_x_e, f_e, r_e;
	Word64 norm_64;
    Word32 norm_x, f, r, g;
    Word16 norm_x_e, f_e, r_e, g_e;
    Word32 L_temp;
    Word16 L_temp_e;

    secDiag[currChannel] = g ; /* exp(sig_x_e) */
    move32();
    secDiag_e[currChannel] = g_e;
    move16();

    g = 0;
    move32();
@@ -951,12 +938,9 @@ static void biDiagonalReductionLeft_fx(
        move32();
        norm_x_e = 0;
        move16();
	norm_64 = 0;
	move64();
        FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */
        {
            norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[jCh][currChannel], singularVectors[jCh][currChannel] ), shl( singularVectors2_e[jCh][currChannel], 1 ), &norm_x_e ); /* exp(norm_x_e) */
		norm_64 = W_add(norm_64, W_mult0_32_32(singularVectors[jCh][currChannel], singularVectors[jCh][currChannel]));
        }

        IF( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */
@@ -1172,6 +1156,12 @@ static void biDiagonalReductionRight_fx(
    Word32 L_temp;
    Word16 L_temp_e;


    secDiag[currChannel] = ( *g ) ; /* exp(sig_x_e) */
    move32();
    secDiag_exp[currChannel] = ( *g_e );
    move16();

    ( *g ) = 0;
    move32();
    ( *g_e ) = 0;