Loading lib_dec/ivas_svd_dec_fx.c +59 −98 Original line number Diff line number Diff line Loading @@ -76,9 +76,8 @@ static void biDiagonalReductionLeft_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ Word32 g, /* Q31 */ Word16 g_e ); static void biDiagonalReductionRight_fx( Loading @@ -89,10 +88,9 @@ static void biDiagonalReductionRight_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ ); // Q31 Word32 *g, /* Q31 */ Word16 *g_e ); static void singularVectorsAccumulationLeft_fx( Word32 singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) as Input, Q31 as output */ Loading Loading @@ -822,10 +820,9 @@ static void HouseholderReduction_fx( { Word16 nCh; // float g = 0.0f, sig_x = 0.0f;// to be removed Word32 g_fx = 0, sig_x_fx = 0; move32(); Word32 g_fx = 0; Word16 g_e = 0; move32(); Word16 sig_x_fx_e = 0; move16(); Word16 iCh, jCh; Loading @@ -842,8 +839,8 @@ static void HouseholderReduction_fx( /* Bidiagonal Reduction for every channel */ 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 ); 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 ); 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 ); biDiagonalReductionRight_fx( singularVectors_Left_fx, secDiag_fx, singularVectors_Left_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &g_fx, &g_e ); 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) */ Loading Loading @@ -881,9 +878,8 @@ static void biDiagonalReductionLeft_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ Word32 g, /* Q31 */ Word16 g_e ) { Word16 iCh, jCh, idx; Loading @@ -892,68 +888,54 @@ static void biDiagonalReductionLeft_fx( Word32 L_temp; Word16 L_temp_e; secDiag[currChannel] = Mpy_32_32( *sig_x, *g ); /* exp(sig_x_e) */ secDiag[currChannel] = g ; /* exp(sig_x_e) */ move32(); secDiag_e[currChannel] = *sig_x_e; secDiag_e[currChannel] = g_e; move16(); /* Setting values to 0 */ ( *sig_x ) = 0; move32(); ( *g ) = 0; g = 0; move32(); g_e = 0; move16(); IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ { idx = currChannel; move16(); FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { ( *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) */ } IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { Word16 invVal_e; Word32 invVal; invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); norm_x = 0; move32(); norm_x_e = 0; move16(); FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { Word16 temp_e = norm_l( singularVectors[jCh][currChannel] ); singularVectors[jCh][currChannel] = Mpy_32_32( L_shl( singularVectors[jCh][currChannel], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); singularVectors2_e[jCh][currChannel] = sub( add( invVal_e, sub( singularVectors2_e[jCh][currChannel], *sig_x_e ) ), temp_e ); move16(); 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) */ } IF( GT_16( norm_x_e, 0 ) ) IF( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { norm_x = MAX_32; move32(); norm_x_e = 0; move16(); } Word16 invVal_e; Word32 invVal; L_temp_e = norm_x_e; move16(); L_temp = Sqrt32( norm_x, &L_temp_e ); L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 // L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 //( *g ) = L_negate( GE_32( singularVectors[currChannel][idx], 0 ) ? L_temp : L_negate( L_temp ) ); if ( singularVectors[currChannel][idx] >= 0 ) { L_temp = L_negate( L_temp ); } ( *g ) = L_temp; g = L_temp; g_e = L_temp_e; move32(); move16(); 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 */ r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( g ), singularVectors[currChannel][idx] ), add( singularVectors2_e[currChannel][idx], g_e), -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 ), g_e, &singularVectors2_e[currChannel][idx] ); /* sing_exp */ move32(); invVal_e = r_e; move16(); invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); FOR( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ Loading @@ -978,19 +960,12 @@ static void biDiagonalReductionLeft_fx( } FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { singularVectors[jCh][currChannel] = Mpy_32_32( singularVectors[jCh][currChannel], ( *sig_x ) ); /* sing_exp + sig_x_e */ move32(); singularVectors2_e[jCh][currChannel] = add( singularVectors2_e[jCh][currChannel], *sig_x_e ); move16(); } } // rescaling block singularValues[currChannel] = Mpy_32_32( ( *sig_x ), ( *g ) ); /* sig_x_e */ singularValues[currChannel] = g; move32(); singularValues_e[currChannel] = *sig_x_e; singularValues_e[currChannel] = g_e; move16(); } Loading @@ -1011,9 +986,8 @@ static void biDiagonalReductionRight_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ Word32 *g, /* Q31 */ Word16 *g_e ) { Word16 iCh, jCh, idx; Loading @@ -1022,51 +996,39 @@ static void biDiagonalReductionRight_fx( Word32 L_temp; Word16 L_temp_e; /* Setting values to 0 */ ( *sig_x ) = 0; move32(); ( *g ) = 0; move32(); ( *g_e ) = 0; move16(); IF( LT_16( currChannel, nChannelsL ) && NE_16( currChannel, sub( nChannelsC, 1 ) ) ) /* i <=m && i !=n */ { idx = add( currChannel, 1 ); /* Q0 */ FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[currChannel][jCh] ), singularVectors2_e[currChannel][jCh], sig_x_e ); /* exp(sig_x_e) */ } IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { norm_x = 0; move32(); norm_x_e = 0; move16(); Word16 invVal_e, temp_e; Word32 invVal; invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */ { temp_e = norm_l( singularVectors[currChannel][jCh] ); singularVectors[currChannel][jCh] = Mpy_32_32( L_shl( singularVectors[currChannel][jCh], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); singularVectors2_e[currChannel][jCh] = add( sub( invVal_e, temp_e ), sub( singularVectors2_e[currChannel][jCh], *sig_x_e ) ); move16(); norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[currChannel][jCh], singularVectors[currChannel][jCh] ), shl( singularVectors2_e[currChannel][jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ } IF( GT_16( norm_x_e, 0 ) ) IF( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { norm_x = MAX_32; move32(); norm_x_e = 0; move16(); } Word16 invVal_e, temp_e; Word32 invVal; // IF( GT_16( norm_x_e, 0 ) ) // { // norm_x = MAX_32; // move32(); // norm_x_e = 0; // move16(); // } L_temp_e = norm_x_e; move16(); L_temp = Sqrt32( norm_x, &L_temp_e ); L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 // L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 IF( singularVectors[currChannel][idx] >= 0 ) { ( *g ) = L_negate( L_temp ); /* exp(L_temp_e) */ Loading @@ -1077,11 +1039,17 @@ static void biDiagonalReductionRight_fx( ( *g ) = L_negate( L_negate( L_temp ) ); /* exp(L_temp_e) */ move32(); } *g_e = L_temp_e; move16(); 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] ); /* exp(sing_exp) */ singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), ( *g_e ), &singularVectors2_e[currChannel][idx] ); /* exp(sing_exp) */ move32(); invVal_e = r_e; move16(); invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ Loading Loading @@ -1111,13 +1079,6 @@ static void biDiagonalReductionRight_fx( } } FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { singularVectors[currChannel][jCh] = Mpy_32_32( singularVectors[currChannel][jCh], ( *sig_x ) ); /* exp(sing_exp + sig_x_e) */ move32(); singularVectors2_e[currChannel][jCh] = add( singularVectors2_e[currChannel][jCh], *sig_x_e ); move16(); } } } Loading Loading
lib_dec/ivas_svd_dec_fx.c +59 −98 Original line number Diff line number Diff line Loading @@ -76,9 +76,8 @@ static void biDiagonalReductionLeft_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ Word32 g, /* Q31 */ Word16 g_e ); static void biDiagonalReductionRight_fx( Loading @@ -89,10 +88,9 @@ static void biDiagonalReductionRight_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ ); // Q31 Word32 *g, /* Q31 */ Word16 *g_e ); static void singularVectorsAccumulationLeft_fx( Word32 singularVectors_Left[][MAX_OUTPUT_CHANNELS], /* exp(singularVectors_e) as Input, Q31 as output */ Loading Loading @@ -822,10 +820,9 @@ static void HouseholderReduction_fx( { Word16 nCh; // float g = 0.0f, sig_x = 0.0f;// to be removed Word32 g_fx = 0, sig_x_fx = 0; move32(); Word32 g_fx = 0; Word16 g_e = 0; move32(); Word16 sig_x_fx_e = 0; move16(); Word16 iCh, jCh; Loading @@ -842,8 +839,8 @@ static void HouseholderReduction_fx( /* Bidiagonal Reduction for every channel */ 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 ); 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 ); 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 ); biDiagonalReductionRight_fx( singularVectors_Left_fx, secDiag_fx, singularVectors_Left_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &g_fx, &g_e ); 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) */ Loading Loading @@ -881,9 +878,8 @@ static void biDiagonalReductionLeft_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ Word32 g, /* Q31 */ Word16 g_e ) { Word16 iCh, jCh, idx; Loading @@ -892,68 +888,54 @@ static void biDiagonalReductionLeft_fx( Word32 L_temp; Word16 L_temp_e; secDiag[currChannel] = Mpy_32_32( *sig_x, *g ); /* exp(sig_x_e) */ secDiag[currChannel] = g ; /* exp(sig_x_e) */ move32(); secDiag_e[currChannel] = *sig_x_e; secDiag_e[currChannel] = g_e; move16(); /* Setting values to 0 */ ( *sig_x ) = 0; move32(); ( *g ) = 0; g = 0; move32(); g_e = 0; move16(); IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */ { idx = currChannel; move16(); FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { ( *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) */ } IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { Word16 invVal_e; Word32 invVal; invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); norm_x = 0; move32(); norm_x_e = 0; move16(); FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { Word16 temp_e = norm_l( singularVectors[jCh][currChannel] ); singularVectors[jCh][currChannel] = Mpy_32_32( L_shl( singularVectors[jCh][currChannel], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); singularVectors2_e[jCh][currChannel] = sub( add( invVal_e, sub( singularVectors2_e[jCh][currChannel], *sig_x_e ) ), temp_e ); move16(); 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) */ } IF( GT_16( norm_x_e, 0 ) ) IF( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { norm_x = MAX_32; move32(); norm_x_e = 0; move16(); } Word16 invVal_e; Word32 invVal; L_temp_e = norm_x_e; move16(); L_temp = Sqrt32( norm_x, &L_temp_e ); L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 // L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 //( *g ) = L_negate( GE_32( singularVectors[currChannel][idx], 0 ) ? L_temp : L_negate( L_temp ) ); if ( singularVectors[currChannel][idx] >= 0 ) { L_temp = L_negate( L_temp ); } ( *g ) = L_temp; g = L_temp; g_e = L_temp_e; move32(); move16(); 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 */ r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( g ), singularVectors[currChannel][idx] ), add( singularVectors2_e[currChannel][idx], g_e), -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 ), g_e, &singularVectors2_e[currChannel][idx] ); /* sing_exp */ move32(); invVal_e = r_e; move16(); invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); FOR( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ Loading @@ -978,19 +960,12 @@ static void biDiagonalReductionLeft_fx( } FOR( jCh = idx; jCh < nChannelsL; jCh++ ) /* nChannelsL */ { singularVectors[jCh][currChannel] = Mpy_32_32( singularVectors[jCh][currChannel], ( *sig_x ) ); /* sing_exp + sig_x_e */ move32(); singularVectors2_e[jCh][currChannel] = add( singularVectors2_e[jCh][currChannel], *sig_x_e ); move16(); } } // rescaling block singularValues[currChannel] = Mpy_32_32( ( *sig_x ), ( *g ) ); /* sig_x_e */ singularValues[currChannel] = g; move32(); singularValues_e[currChannel] = *sig_x_e; singularValues_e[currChannel] = g_e; move16(); } Loading @@ -1011,9 +986,8 @@ static void biDiagonalReductionRight_fx( const Word16 nChannelsL, /* Q0 */ const Word16 nChannelsC, /* Q0 */ const Word16 currChannel, /* Q0 */ Word32 *sig_x, /* exp(sig_x_e) */ Word16 *sig_x_e, Word32 *g /* Q31 */ Word32 *g, /* Q31 */ Word16 *g_e ) { Word16 iCh, jCh, idx; Loading @@ -1022,51 +996,39 @@ static void biDiagonalReductionRight_fx( Word32 L_temp; Word16 L_temp_e; /* Setting values to 0 */ ( *sig_x ) = 0; move32(); ( *g ) = 0; move32(); ( *g_e ) = 0; move16(); IF( LT_16( currChannel, nChannelsL ) && NE_16( currChannel, sub( nChannelsC, 1 ) ) ) /* i <=m && i !=n */ { idx = add( currChannel, 1 ); /* Q0 */ FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { ( *sig_x ) = BASOP_Util_Add_Mant32Exp( *sig_x, *sig_x_e, L_abs( singularVectors[currChannel][jCh] ), singularVectors2_e[currChannel][jCh], sig_x_e ); /* exp(sig_x_e) */ } IF( ( *sig_x ) ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { norm_x = 0; move32(); norm_x_e = 0; move16(); Word16 invVal_e, temp_e; Word32 invVal; invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */ { temp_e = norm_l( singularVectors[currChannel][jCh] ); singularVectors[currChannel][jCh] = Mpy_32_32( L_shl( singularVectors[currChannel][jCh], temp_e ), invVal ); /* exp(sing_exp + (singularVectors_e - sig_x_e) */ move32(); singularVectors2_e[currChannel][jCh] = add( sub( invVal_e, temp_e ), sub( singularVectors2_e[currChannel][jCh], *sig_x_e ) ); move16(); norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[currChannel][jCh], singularVectors[currChannel][jCh] ), shl( singularVectors2_e[currChannel][jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */ } IF( GT_16( norm_x_e, 0 ) ) IF( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */ { norm_x = MAX_32; move32(); norm_x_e = 0; move16(); } Word16 invVal_e, temp_e; Word32 invVal; // IF( GT_16( norm_x_e, 0 ) ) // { // norm_x = MAX_32; // move32(); // norm_x_e = 0; // move16(); // } L_temp_e = norm_x_e; move16(); L_temp = Sqrt32( norm_x, &L_temp_e ); L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 // L_temp = L_shl_r( L_temp, L_temp_e ); // Q31 IF( singularVectors[currChannel][idx] >= 0 ) { ( *g ) = L_negate( L_temp ); /* exp(L_temp_e) */ Loading @@ -1077,11 +1039,17 @@ static void biDiagonalReductionRight_fx( ( *g ) = L_negate( L_negate( L_temp ) ); /* exp(L_temp_e) */ move32(); } *g_e = L_temp_e; move16(); 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] ); /* exp(sing_exp) */ singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), ( *g_e ), &singularVectors2_e[currChannel][idx] ); /* exp(sing_exp) */ move32(); invVal_e = r_e; move16(); invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ Loading Loading @@ -1111,13 +1079,6 @@ static void biDiagonalReductionRight_fx( } } FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { singularVectors[currChannel][jCh] = Mpy_32_32( singularVectors[currChannel][jCh], ( *sig_x ) ); /* exp(sing_exp + sig_x_e) */ move32(); singularVectors2_e[currChannel][jCh] = add( singularVectors2_e[currChannel][jCh], *sig_x_e ); move16(); } } } Loading