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

good enough.

parent d317f38d
Loading
Loading
Loading
Loading
+50 −208
Original line number Diff line number Diff line
@@ -854,7 +854,6 @@ static void ApplyRotation_fx(
 *
 *
 *-------------------------------------------------------------------------*/
FILE *f_debug=NULL;

static void HouseholderReduction_fx(
    Word32 singularVectors_Left_fx[][MAX_OUTPUT_CHANNELS],  /* exp(singularVectors_Left_e) */
@@ -895,7 +894,6 @@ static void HouseholderReduction_fx(
    Word16 iCh, jCh;
    Word16 singularVectors_Left_fx_e[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS];
#ifdef MERGE_REQUEST_1926_SPEEDUP_ivas_svd_dec_fx_NONBE
	if (f_debug==NULL) f_debug=fopen("MYCODE.trace","wb");
    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
    {
        FOR( iCh = 0; iCh < nChannelsC; iCh++ )
@@ -903,34 +901,8 @@ static void HouseholderReduction_fx(
            singularVectors_Left_64[jCh][iCh] = W_shr( W_deposit32_h( singularVectors_Left_fx[jCh][iCh] ), 32 );
        }
    }
    FOR( nCh = 0; nCh < nChannelsC; nCh++ )
    {
	    unsigned int x;
	    x=0xd00faffe;fwrite(&x,sizeof(int),1,f_debug);
	    fwrite(&nChannelsL,sizeof(short),1,f_debug);
	    fwrite(&nChannelsC,sizeof(short),1,f_debug);
	    fwrite(&singularVectors_Left_e,sizeof(short),1,f_debug);
    }
    for ( nCh = 0; nCh < nChannelsC; nCh++ )
    {

	    {
		    fwrite(&nCh,sizeof(short),1,f_debug);

		    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
		    {
			    FOR( iCh = 0; iCh < nChannelsC; iCh++ )
			    {
				    Word16 n;
                                    Word32 y;
				    n=W_norm(singularVectors_Left_64[jCh][iCh]);
				    y=W_extract_h(W_shl(singularVectors_Left_64[jCh][iCh],n));
				    fwrite(&n,sizeof(Word16),1,f_debug);
				    fwrite(&y,sizeof(Word32),1,f_debug);

			    }
		    }

	    }
        biDiagonalReductionLeft_64(
            singularVectors_Left_64,
            nChannelsL,
@@ -944,23 +916,6 @@ static void HouseholderReduction_fx(
        secDiag_fx[nCh] = g_right_fx; /* from the previous channel */
        move32();
        secDiag_fx_e[nCh] = add( singularVectors_Left_e, g_right_e );
       	    {

		    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
		    {
			    FOR( iCh = 0; iCh < nChannelsC; iCh++ )
			    {
				    Word16 n;
                                    Word32 y;
				    n=W_norm(singularVectors_Left_64[jCh][iCh]);
				    y=W_extract_h(W_shl(singularVectors_Left_64[jCh][iCh],n));
				    fwrite(&n,sizeof(Word16),1,f_debug);
				    fwrite(&y,sizeof(Word32),1,f_debug);

			    }
		    }

	    }
        biDiagonalReductionRight_64(
            singularVectors_Left_64,
            nChannelsL,
@@ -968,27 +923,6 @@ static void HouseholderReduction_fx(
            nCh,
            &g_right_fx,
            &g_right_e );
       	    {
		    fwrite(&singularValues_fx[nCh],sizeof(int),1,f_debug);
	            fwrite(&singularValues_fx_e[nCh],sizeof(short),1,f_debug);
		    fwrite(&secDiag_fx[nCh],sizeof(int),1,f_debug);
	            fwrite(&secDiag_fx_e[nCh],sizeof(short),1,f_debug);

		    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
		    {
			    FOR( iCh = 0; iCh < nChannelsC; iCh++ )
			    {
				    Word16 n;
                                    Word32 y;
				    n=W_norm(singularVectors_Left_64[jCh][iCh]);
				    y=W_extract_h(W_shl(singularVectors_Left_64[jCh][iCh],n));
				    fwrite(&n,sizeof(Word16),1,f_debug);
				    fwrite(&y,sizeof(Word32),1,f_debug);

			    }
		    }

	    }
        {
            Word16 L_temp_e;
            Word32 L_temp;
@@ -1016,7 +950,6 @@ static void HouseholderReduction_fx(
        }
    }
#else
	if (f_debug==NULL) f_debug=fopen("MAINCODE.trace","wb");

    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
    {
@@ -1026,75 +959,12 @@ static void HouseholderReduction_fx(
            move16();
        }
    }
    {
	    unsigned int x;
	    x=0xd00faffe;fwrite(&x,sizeof(int),1,f_debug);
	    fwrite(&nChannelsL,sizeof(short),1,f_debug);
	    fwrite(&nChannelsC,sizeof(short),1,f_debug);
	    fwrite(&singularVectors_Left_e,sizeof(short),1,f_debug);
    }

    /* Bidiagonal Reduction for every channel */
    FOR( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */
    {
	    {
		    fwrite(&nCh,sizeof(short),1,f_debug);

		    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
		    {
			    FOR( iCh = 0; iCh < nChannelsC; iCh++ )
			    {
				    Word16 n;
                                    Word32 y;
				    n=singularVectors_Left_fx_e[jCh][iCh];
				    y=singularVectors_Left_fx[jCh][iCh];
				    fwrite(&n,sizeof(Word16),1,f_debug);
				    fwrite(&y,sizeof(Word32),1,f_debug);

			    }
		    }

	    }
        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 );
       	    {

		    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
		    {
			    FOR( iCh = 0; iCh < nChannelsC; iCh++ )
			    {
				    Word16 n;
                                    Word32 y;
				    n=singularVectors_Left_fx_e[jCh][iCh];
				    y=singularVectors_Left_fx[jCh][iCh];
				    fwrite(&n,sizeof(Word16),1,f_debug);
				    fwrite(&y,sizeof(Word32),1,f_debug);

			    }
		    }

	    }
        biDiagonalReductionRight_fx( singularVectors_Left_fx, secDiag_fx, singularVectors_Left_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &sig_x_fx, &sig_x_fx_e, &g_fx );
	    {

		    fwrite(&singularValues_fx[nCh],sizeof(int),1,f_debug);
	            fwrite(&singularValues_fx_e[nCh],sizeof(short),1,f_debug);
		    fwrite(&secDiag_fx[nCh],sizeof(int),1,f_debug);
	            fwrite(&secDiag_fx_e[nCh],sizeof(short),1,f_debug);
		    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
		    {
			    FOR( iCh = 0; iCh < nChannelsC; iCh++ )
			    {
				    Word16 n;
                                    Word32 y;
				    n=singularVectors_Left_fx_e[jCh][iCh];
				    y=singularVectors_Left_fx[jCh][iCh];
				    fwrite(&n,sizeof(Word16),1,f_debug);
				    fwrite(&y,sizeof(Word32),1,f_debug);

			    }
		    }

	    }

        Word16 L_temp_e;
        Word32 L_temp = BASOP_Util_Add_Mant32Exp( L_abs( singularValues_fx[nCh] ), singularValues_fx_e[nCh], L_abs( secDiag_fx[nCh] ), secDiag_fx_e[nCh], &L_temp_e ); /* exp(L_temp_e) */
@@ -1125,7 +995,7 @@ static void HouseholderReduction_fx(
 *-------------------------------------------------------------------------*/

static void biDiagonalReductionLeft_64(
    Word64 singularVectors_Left_64[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS],
    Word64 singularVectors_Left_64[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS],		// q(sing)	exp(sing)
    const Word16 nChannelsL,  /* Q0 */
    const Word16 nChannelsC,  /* Q0 */
    const Word16 currChannel, /* Q0 */
@@ -1134,9 +1004,9 @@ static void biDiagonalReductionLeft_64(
{

#define HEADROOM_LEFT_1 2
#define HEADROOM_LEFT_2 ( 16 - norm_x_e0 / 4 ) // 12
#define HEADROOM_LEFT_3 ( 16 - norm_x_e0 / 4 ) // 14
#define HEADROOM_LEFT_4 ( 16 - norm_x_e0 / 4 ) // 15
#define HEADROOM_LEFT_2 ( 16 - norm_x_e0 / 4 ) //  10
#define HEADROOM_LEFT_3 ( 16 - norm_x_e0 / 4 ) //  4
#define HEADROOM_LEFT_4 ( 16 - norm_x_e0 / 4 ) //  14

    Word16 iCh, jCh;
    Word32 norm_x;
@@ -1157,21 +1027,12 @@ static void biDiagonalReductionLeft_64(
        move64();
        FOR( jCh = currChannel; jCh < nChannelsL; jCh++ ) /* nChannelsL */
        {
            tmp = W_extract_l( W_shr( singularVectors_Left_64[jCh][currChannel], HEADROOM_LEFT_1 ) );
            norm_64 = W_add( norm_64, W_mult0_32_32( tmp, tmp ) );
            tmp = W_extract_l( W_shr( singularVectors_Left_64[jCh][currChannel], HEADROOM_LEFT_1 ) );	// q(sing)-H1			// exp(sing)+H1
            norm_64 = W_add( norm_64, W_mult0_32_32( tmp, tmp ) );					// q(norm)=2*q(sing)-2*H1	// exp(norm)=2*exp(sing)+2*H1
        }
        norm_x_e = W_norm( norm_64 );			
        norm_x_e0 = W_norm( norm_64 );
        norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );
    }
{
	Word32 sig_x;
	Word16 sig_x_e;

	sig_x=(norm_x!=0);
	sig_x_e=0;
	fwrite(&sig_x,sizeof(Word32),1,f_debug);
	fwrite(&sig_x_e,sizeof(Word16),1,f_debug);
        norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );	// q(norm_x)=32-exp(norm_x)	exp(norm_x)=exp(norm)-32
    }
    IF( norm_x )
    {
@@ -1179,58 +1040,51 @@ static void biDiagonalReductionLeft_64(
        Word16 tmp_e;
        Word64 tmpmul;

        Word64 r_64; //  = sqrt(norm)*singularVectors_Left_64[currChannel][currChannel]-norm OR -sqrt(norm)*singularVectors_Left_64[currChannel][currChannel]-norm
        Word64 r_64; 
        Word32 r, invVal;
        Word16 r_e, invVal_e;

        ( *g_e ) = add( sub( ( HEADROOM_LEFT_1 + HEADROOM_LEFT_1 ), norm_x_e ), 1 );
        ( *g_e ) = add( sub( add( HEADROOM_LEFT_1, HEADROOM_LEFT_1 ), norm_x_e ), 1 );		// exp(g)=(2*H1-exp(norm_x)+1)
        move16();
        ( *g ) = Sqrt32( norm_x, g_e );
        ( *g ) = Sqrt32( norm_x, g_e );								// --> exp(g)=((2*H1-exp(norm_x)+1)/2)
        IF( GE_64( singularVectors_Left_64[currChannel][currChannel], 0 ) )
        {
            ( *g ) = L_negate( *g );
        }
        factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][currChannel], HEADROOM_LEFT_2 ) );
        factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][currChannel], HEADROOM_LEFT_2 ) );	// q(factor2)=q(sing)-H2	exp(factor2)=exp(qsing)+H2
        tmp_e = sub( 2 * HEADROOM_LEFT_1 - HEADROOM_LEFT_2, ( *g_e ) );						
        tmpmul = W_mult0_32_32( ( *g ), factor2 );
        tmpmul = W_shr( tmpmul, tmp_e );
        r_64 = W_sub( tmpmul, norm_64 );
        tmpmul = W_mult0_32_32( ( *g ), factor2 );	// q(tmpmul)=q(g)+q(factor2) --> q(tmpmul) ~= q(norm)
        tmpmul = W_shr( tmpmul, tmp_e );		// --> q(tmpmul)=q(g)+q(factor2)-(2*H1-H2-q(g))
        r_64 = W_sub( tmpmul, norm_64 );		// q(r_64)=max(q(tmpmul),q(norm))
        r_e = W_norm( r_64 );
        r = W_extract_h( W_shl( r_64, r_e ) );

        invVal_e = 0;
        move16();
        invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e );
        invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e );	// invVal=1/r --> q(invVal)=-q(r)


        tmp_e = sub( 32, *g_e );
        singularVectors_Left_64[currChannel][currChannel] = W_sub( singularVectors_Left_64[currChannel][currChannel], W_shr( W_deposit32_h( *g ), tmp_e ) );
{
	fwrite(&norm_x,sizeof(Word32),1,f_debug);
	fwrite(&norm_x_e,sizeof(Word16),1,f_debug);
	fwrite(g,sizeof(Word32),1,f_debug);
	fwrite(g_e,sizeof(Word16),1,f_debug);
}
        singularVectors_Left_64[currChannel][currChannel] = W_sub( singularVectors_Left_64[currChannel][currChannel], W_shr( W_deposit32_h( *g ), tmp_e ) ); // q(sing)=max(q(sing),q(r)-(2*H1-H2-exp(r))

        FOR( iCh = add( currChannel, 1 ); iCh < nChannelsC; iCh++ )
        {
            Word32 factor1;
            Word32 factor2;
            Word32 f; // = norm / r
                      //            Word16 f_e;      // not really needed
            Word16 magic_shift;

            norm_64 = 0;
            for ( jCh = currChannel; jCh < nChannelsL; jCh++ )
            {
                factor1 = W_extract_h( W_shl( singularVectors_Left_64[jCh][currChannel], 32 - HEADROOM_LEFT_3 ) );
                factor2 = W_extract_h( W_shl( singularVectors_Left_64[jCh][iCh], 32 - HEADROOM_LEFT_3 ) );
                norm_64 = W_add( norm_64, W_mult0_32_32( factor1, factor2 ) );
                factor1 = W_extract_h( W_shl( singularVectors_Left_64[jCh][currChannel], 32 - HEADROOM_LEFT_3 ) );	// q(factor1) = q(sing)-H3
                factor2 = W_extract_h( W_shl( singularVectors_Left_64[jCh][iCh], 32 - HEADROOM_LEFT_3 ) );		// q(factor2) = q(sing)-H3
                norm_64 = W_add( norm_64, W_mult0_32_32( factor1, factor2 ) );						// q(norm)=2*q(sing)-2*H3
            }
            norm_x_e = W_norm( norm_64 );
            norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );
            f = Mpy_32_32( norm_x, invVal );
            magic_shift = ( norm_x_e - 2 * HEADROOM_LEFT_3 ) - ( r_e - 2 * HEADROOM_LEFT_1 ) + ( 32 - HEADROOM_LEFT_4 ) - 2;
            norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );	// Note: different norm
            f = Mpy_32_32( norm_x, invVal );		// q(f)=q(norm_x)-q(invVal)
            magic_shift = ( norm_x_e - 2 * HEADROOM_LEFT_3 ) - ( r_e - 2 * HEADROOM_LEFT_1 ) + ( 32 - HEADROOM_LEFT_4 ) - 2 * invVal_e;
            FOR( jCh = currChannel; jCh < nChannelsL; jCh++ )
            {
                factor1 = W_extract_h( W_shl( singularVectors_Left_64[jCh][currChannel], 32 - HEADROOM_LEFT_4 ) );
@@ -1262,9 +1116,9 @@ static void biDiagonalReductionRight_64(
    Word16 idx;

#define HEADROOM_RIGHT_1 2
#define HEADROOM_RIGHT_2 ( 16 - norm_x_e0 / 4 ) // 12
#define HEADROOM_RIGHT_3 ( 16 - norm_x_e0 / 4 ) // 14
#define HEADROOM_RIGHT_4 ( 16 - norm_x_e0 / 4 ) // 15
#define HEADROOM_RIGHT_2 ( 16 - norm_x_e0 / 4 ) // 10
#define HEADROOM_RIGHT_3 ( 16 - norm_x_e0 / 4 ) // 4
#define HEADROOM_RIGHT_4 ( 16 - norm_x_e0 / 4 ) // 14


    ( *g ) = 0;
@@ -1279,12 +1133,12 @@ static void biDiagonalReductionRight_64(
        FOR( jCh = idx; jCh < nChannelsC; jCh++ )
        {
            Word32 tmp;
            tmp = W_extract_l( W_shr( singularVectors_Left_64[currChannel][jCh], HEADROOM_RIGHT_1 ) );
            norm_64 = W_add( norm_64, W_mult0_32_32( tmp, tmp ) );
            tmp = W_extract_l( W_shr( singularVectors_Left_64[currChannel][jCh], HEADROOM_RIGHT_1 ) );	// q(sing)-H1			// exp(sing)+H1	
            norm_64 = W_add( norm_64, W_mult0_32_32( tmp, tmp ) );					// q(norm)=2*q(sing)-2*H1	// exp(norm)=2*exp(sing)+2*H1
        }
        norm_x_e = W_norm( norm_64 );
        norm_x_e0 = W_norm( norm_64 );
        norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );
        norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );	// q(norm_x)=32-exp(norm_x)	exp(norm_x)=exp(norm)-32
        move16();

        IF( norm_x )
@@ -1301,29 +1155,28 @@ static void biDiagonalReductionRight_64(
            Word32 invVal;
            Word16 invVal_e;

            ( *g_e ) = add( sub( ( HEADROOM_RIGHT_1 + HEADROOM_RIGHT_1 ), norm_x_e ), 1 );
            ( *g_e ) = add( sub( ( HEADROOM_RIGHT_1 + HEADROOM_RIGHT_1 ), norm_x_e ), 1 );	// exp(g)=(2*H1-exp(norm_x)+1)
            move16();
            ( *g ) = Sqrt32( norm_x, g_e );
            ( *g ) = Sqrt32( norm_x, g_e );							// --> exp(g)=((2*H1-exp(norm_x)+1)/2)
            IF( GE_64( singularVectors_Left_64[currChannel][idx], 0 ) )
            {
                ( *g ) = L_negate( *g );
            }
            move32();
            move16();
            factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][idx], HEADROOM_RIGHT_2 ) );
            factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][idx], HEADROOM_RIGHT_2 ) );	// q(factor2)=q(sing)-H2	exp(factor2)=exp(qsing)+H2
            tmp_e = sub( 2 * HEADROOM_RIGHT_1 - HEADROOM_RIGHT_2, *g_e );
            tmpmul = W_mult0_32_32( *g, factor2 );
            tmpmul = W_shr( tmpmul, tmp_e );
            r_64 = W_sub( tmpmul, norm_64 );
            tmpmul = W_mult0_32_32( *g, factor2 );	// q(tmpmul)=q(g)+q(factor2)
            tmpmul = W_shr( tmpmul, tmp_e );		// --> q(tmpmul)=q(g)+q(factor2)-(2*H1-H2-q(g))
            r_64 = W_sub( tmpmul, norm_64 );		// q(r_64)=max(q(tmpmul),q(norm))
            r_e = W_norm( r_64 );
            r = W_extract_h( W_shl( r_64, r_e ) );

            invVal_e = 0;
            move16();
            invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e );

            invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e );	// invVal=1/r --> q(invVal)=-q(r)
            tmp_e = sub( 32, *g_e );
            singularVectors_Left_64[currChannel][idx] = W_sub( singularVectors_Left_64[currChannel][idx], W_shr( W_deposit32_h( *g ), tmp_e ) ); // here, the exponent goes up
            singularVectors_Left_64[currChannel][idx] = W_sub( singularVectors_Left_64[currChannel][idx], W_shr( W_deposit32_h( *g ), tmp_e ) );	// q(sing)=max(q(sing),q(r)-(2*H1-H2-exp(r)))

            FOR( iCh = idx; iCh < nChannelsL; iCh++ )
            {
@@ -1332,15 +1185,15 @@ static void biDiagonalReductionRight_64(
                move64();
                FOR( jCh = idx; jCh < nChannelsC; jCh++ )
                {
                    factor1 = W_extract_h( W_shl( singularVectors_Left_64[iCh][jCh], 32 - HEADROOM_RIGHT_3 ) );
                    factor2 = W_extract_h( W_shl( singularVectors_Left_64[currChannel][jCh], 32 - HEADROOM_RIGHT_3 ) );
                    norm_64 = W_add( norm_64, W_mult0_32_32( factor1, factor2 ) );
                    factor1 = W_extract_h( W_shl( singularVectors_Left_64[iCh][jCh], 32 - HEADROOM_RIGHT_3 ) );		// q(factor1) = q(sing)-H3
                    factor2 = W_extract_h( W_shl( singularVectors_Left_64[currChannel][jCh], 32 - HEADROOM_RIGHT_3 ) );	// q(factor2) = q(sing)-H3
                    norm_64 = W_add( norm_64, W_mult0_32_32( factor1, factor2 ) );					// q(norm)=2*q(sing)-2*H3
                }

                norm_x_e = W_norm( norm_64 );
                norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );
                f = Mpy_32_32( norm_x, invVal );
                magic_shift = ( norm_x_e - 2 * HEADROOM_RIGHT_3 ) - ( r_e - 2 * HEADROOM_RIGHT_1 ) + ( 32 - HEADROOM_RIGHT_4 ) - 2;
                norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) );	// Note: different norm
                f = Mpy_32_32( norm_x, invVal );	// q(f)=q(norm_x)-q(invVal)
                magic_shift = ( norm_x_e - 2 * HEADROOM_RIGHT_3 ) - ( r_e - 2 * HEADROOM_RIGHT_1 ) + ( 32 - HEADROOM_RIGHT_4 ) - 2 * invVal_e;

                FOR( jCh = idx; jCh < nChannelsC; jCh++ )
                {
@@ -1399,10 +1252,6 @@ static void biDiagonalReductionLeft_fx(
        {
            ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[jCh][currChannel] ), singularVectors2_e[jCh][currChannel], sig_x_e ); /* exp(sig_x_e) */
        }
{
	fwrite(sig_x,sizeof(Word32),1,f_debug);
	fwrite(sig_x_e,sizeof(Word16),1,f_debug);
}

        IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */
        {
@@ -1463,13 +1312,6 @@ static void biDiagonalReductionLeft_fx(
            }
            ( *g ) = L_temp;
            move32();
{
	fwrite(&norm_x,sizeof(Word32),1,f_debug);
	fwrite(&norm_x_e,sizeof(Word16),1,f_debug);
	fwrite(g,sizeof(Word32),1,f_debug);
	fwrite(&L_temp_e,sizeof(Word16),1,f_debug);
}


            r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), singularVectors2_e[currChannel][idx], -norm_x, norm_x_e, &r_e );                                      /* exp(r_e) */
            singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), 0, &singularVectors2_e[currChannel][idx] ); /* sing_exp */
+0 −11
Original line number Diff line number Diff line
@@ -150,17 +150,6 @@ ivas_error AudioFileWriter_write(
    int16_t *samples,
    uint32_t numSamples )
{

	extern FILE *f_debug;

	if (f_debug!=NULL)
	{
		unsigned int x;
		x=0xbeebbeeb;fwrite(&x,sizeof(int),1,f_debug);
		fwrite(&numSamples,sizeof(int),1,f_debug);
		fwrite(samples,sizeof(short),numSamples,f_debug);
		
	}
    ivas_error error = IVAS_ERR_OK;
    if ( self->rawFile )
    {