Commit 9ad25685 authored by thomas dettbarn's avatar thomas dettbarn
Browse files

first iteration is working again.

parent 4aba1abd
Loading
Loading
Loading
Loading
+63 −2
Original line number Diff line number Diff line
@@ -899,6 +899,22 @@ static void HouseholderReduction_fx(
			nChannelsC,
			nCh
		);
		{
			int i,j;
			printf("\ncompare%d, (%d)\x1b[1;32mstart\x1b[0m\n",nCh,singularVectors_Left_e);
			for (i=0;i<nChannelsL;i++)
			{
				printf("compare%d,%d: \x1b[1;32m",nCh,i);
				for (j=0;j<nChannelsC;j++)
				{
					Word16 n;
					n=W_norm(singularVectors_Left_64[i][j]);
					printf("%08X ",W_extract_h(W_shl(singularVectors_Left_64[i][j],n)));
				}
				printf("\x1b[0m\n");
			}
			printf("compare%d \x1b[1;32mend\x1b[0m\n",nCh);
		}

                bitwindow=nCh+1;
		biDiagonalReductionRight_64(
@@ -910,6 +926,22 @@ static void HouseholderReduction_fx(
			&g_fx,
			&g_e	
		);
		{
			int i,j;
			printf("\nCOMPARE%d, (%d)\x1b[1;32mstart\x1b[0m\n",nCh,singularVectors_Left_e);
			for (i=0;i<nChannelsL;i++)
			{
				printf("COMPARE%d,%d: \x1b[1;32m",nCh,i);
				for (j=0;j<nChannelsC;j++)
				{
					Word16 n;
					n=W_norm(singularVectors_Left_64[i][j]);
					printf("%08X<%3d ",W_extract_h(W_shl(singularVectors_Left_64[i][j],n)),n);
				}
				printf("\x1b[0m\n");
			}
			printf("COMPARE%d \x1b[1;32mend\x1b[0m\n",nCh);
		}
	}	
	pop_wmops();
#endif
@@ -927,7 +959,37 @@ static void HouseholderReduction_fx(
    FOR( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */
    {
        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 );
   		{
			int i,j;
			printf("compare%d, start\n",nCh);
			for (i=0;i<nChannelsL;i++)
			{
				printf("compare%d,%d: ",nCh,i);
				for (j=0;j<nChannelsC;j++)
				{
					Word16 n;
					printf("%08X ",singularVectors_Left_fx[i][j]);
				}
				printf("\n");
			}
			printf("compare%d, end\n",nCh);
		}
        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 );
		{
			int i,j;
			printf("COMPARE%d, start\n",nCh);
			for (i=0;i<nChannelsL;i++)
			{
				printf("COMPARE%d,%d: ",nCh,i);
				for (j=0;j<nChannelsC;j++)
				{
					Word16 n;
					printf("%08X<%3d ",singularVectors_Left_fx[i][j],singularVectors_Left_fx_e[i][j]);
				}
				printf("\n");
			}
			printf("COMPARE%d, end\n",nCh);
		}

        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) */
@@ -1005,13 +1067,12 @@ static void biDiagonalReductionLeft_64(
           g = L_negate( g );
        }
        factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][currChannel], bitwindow-1) );
        tmp_e=sub( sub( g_e, bitwindow), 3);	// bitwindow=singularvectors_e+1 --> g_e-sin_e-2 <=> g_e-bitwindow-3
        tmp_e=sub( sub( g_e, bitwindow), 1);	// bitwindow=singularvectors_e+1 --> g_e-sin_e-2 <=> g_e-bitwindow-3
        tmpmul=W_mult0_32_32( g, factor2);
        tmpmul=W_shl(tmpmul, tmp_e);
        r_64=W_sub(tmpmul, norm_64);
        r_e=W_norm(r_64 );
        r=W_extract_h( W_shl( r_64, r_e ) );
//        r_e = sub( sub( add( add(1, singularVectors_e),g_e), tmp_e), r_e);  // 1+singularVectors_e + g_e - ((g_e-singularVectors_e)-2)-r_e
        r_e = sub( add( 1, add(bitwindow, bitwindow )), r_e );