Commit bd5fe007 authored by thomas dettbarn's avatar thomas dettbarn
Browse files

removed the abs sum COMPLETELY.

parent 3d2f155a
Loading
Loading
Loading
Loading
+4 −33
Original line number Diff line number Diff line
@@ -79,8 +79,6 @@ static void biDiagonalReductionLeft_64(
static void biDiagonalReductionRight_64(
    Word64 singularVectors_Left_64[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS],
    Word16 bitwindow,
    Word32 secDiag[MAX_OUTPUT_CHANNELS],    /* exp(singularValues_e) */
    Word16 secDiag_e[MAX_OUTPUT_CHANNELS],
    const Word16 nChannelsL,  /* Q0 */
    const Word16 nChannelsC,  /* Q0 */
    const Word16 currChannel, /* Q0 */
@@ -917,10 +915,13 @@ static void HouseholderReduction_fx(
			printf("compare%d \x1b[1;32mend\x1b[0m\n",nCh);
		}

                secDiag_fx[nCh]=g_fx;
                secDiag_fx_e[nCh]=g_e;
                move32();
                move16();
                bitwindow=2;
		biDiagonalReductionRight_64(
			singularVectors_Left_64,bitwindow,
			secDiag_fx,secDiag_fx_e,
			nChannelsL,
			nChannelsC,
			nCh,
@@ -1204,8 +1205,6 @@ static void biDiagonalReductionLeft_64(
static void biDiagonalReductionRight_64(
    Word64 singularVectors_Left_64[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS],
    Word16 bitwindow,
    Word32 secDiag[MAX_OUTPUT_CHANNELS],    /* exp(singularValues_e) */
    Word16 secDiag_e[MAX_OUTPUT_CHANNELS],
    const Word16 nChannelsL,  /* Q0 */
    const Word16 nChannelsC,  /* Q0 */
    const Word16 currChannel, /* Q0 */
@@ -1217,18 +1216,11 @@ static void biDiagonalReductionRight_64(
    Word32 norm_x;
    Word16 norm_x_e;
    Word64 norm_64;
    Word32 abs_x;
    Word16 abs_x_e;
    Word64 abs_64;
    Word16 idx;
    Word16 bitwindow0;



    secDiag[currChannel] = ( *g );
    secDiag_e[currChannel] = ( *g_e );
    move32();
    move16();
    bitwindow0=bitwindow;

    ( *g ) =0;
@@ -1238,8 +1230,6 @@ static void biDiagonalReductionRight_64(
    IF ( LT_16( currChannel, nChannelsL ) && NE_16( currChannel, sub( nChannelsC, 1 ) ) ) /* i <=m && i !=n */
    {
        norm_64=0;
        abs_64=0;
        move64();
        move64();
        idx = add( currChannel, 1);
        FOR ( jCh = idx; jCh < nChannelsC; jCh++ )
@@ -1247,15 +1237,11 @@ static void biDiagonalReductionRight_64(
            Word32 tmp;
            tmp = W_extract_l( W_shr( singularVectors_Left_64[currChannel][jCh], bitwindow) );
            norm_64 = W_add( norm_64, W_mult0_32_32( tmp, tmp) );
            abs_64 = W_add( abs_64, W_abs( singularVectors_Left_64[currChannel][jCh]) );
        }
        norm_x_e = W_norm( norm_64);
        norm_x = W_extract_h( W_shl( norm_64, norm_x_e) );
        norm_x_e = add( sub( shl( bitwindow, 1), norm_x_e), 1);
        move16();
        abs_x_e = W_norm( abs_64);
        abs_x = W_extract_h( W_shl( abs_64, abs_x_e) );
        abs_x_e = add( sub( add( bitwindow, bitwindow), abs_x_e), 1);

        IF ( norm_x )
        {
@@ -1325,21 +1311,6 @@ static void biDiagonalReductionRight_64(
                    singularVectors_Left_64[iCh][jCh] = W_add( singularVectors_Left_64[iCh][jCh], W_shr( W_mult0_32_32( f, factor2), magic_shift) );
                }
            }
            // FIXME BEGIN: The following code has not yet been tested
            invVal_e = 0;
            move16();
            invVal = BASOP_Util_Divide3232_Scale_newton( abs_x, maxWithSign_fx( r ), &invVal_e);
            invVal_e = add( invVal_e, sub( abs_x_e, r_e) );
            bitwindow = bitwindow0;
            move16();
            FOR ( jCh = idx; jCh < nChannelsL ; jCh++ )
            {
                secDiag[jCh] = Mpy_32_32( W_extract_l( W_shr( singularVectors_Left_64[currChannel][jCh], bitwindow) ), invVal );
                move32();
                secDiag_e[jCh] = add(invVal_e, bitwindow);
                move16();
            }
            // FIXME END
        }
    }
}