Loading lib_dec/ivas_svd_dec_fx.c +10 −11 Original line number Diff line number Diff line Loading @@ -1004,7 +1004,8 @@ static void biDiagonalReductionLeft_64( { #define HEADROOM_LEFT_1 1 #define HEADROOM_LEFT_2 ( HEADROOM_LEFT_1 + 1 ) #define HEADROOM_LEFT_2 2 //( HEADROOM_LEFT_1 + 1 ) #define HEADROOM_LEFT_3 3 //( HEADROOM_LEFT_1 + 1 ) Word16 iCh, jCh; Word32 norm_x; Loading Loading @@ -1048,19 +1049,18 @@ static void biDiagonalReductionLeft_64( ( *g ) = L_negate( *g ); } factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][currChannel], HEADROOM_LEFT_1 ) ); tmp_e = sub( ( *g_e ), HEADROOM_LEFT_1 ); tmp_e = sub( HEADROOM_LEFT_1, ( *g_e ) ); tmpmul = W_mult0_32_32( ( *g ), factor2 ); tmpmul = W_shl( tmpmul, tmp_e ); tmpmul = W_shr( 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 ) ); invVal_e = sub( add( 1, ( HEADROOM_LEFT_1 + HEADROOM_LEFT_1 ) ), r_e ); invVal_e = 0; invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, r, &invVal_e ); tmp_e = add( 31, sub( HEADROOM_LEFT_1, *g_e ) ); 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 ) ); // here, the exponent goes up. FOR( iCh = add( currChannel, 1 ); iCh < nChannelsC; iCh++ ) Loading @@ -1081,10 +1081,10 @@ static void biDiagonalReductionLeft_64( 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 = add( add( norm_x_e, 23 ), sub( add( 1, ( HEADROOM_LEFT_1 + HEADROOM_LEFT_1 ) ), r_e ) ); magic_shift = norm_x_e+22+HEADROOM_LEFT_3+2*HEADROOM_LEFT_1-r_e; FOR( jCh = currChannel; jCh < nChannelsL; jCh++ ) { factor1 = W_extract_l( W_shr( singularVectors_Left_64[jCh][currChannel], HEADROOM_LEFT_2 ) ); factor1 = W_extract_h( W_shl( singularVectors_Left_64[jCh][currChannel], 32-HEADROOM_LEFT_3 ) ); singularVectors_Left_64[jCh][iCh] = W_add( singularVectors_Left_64[jCh][iCh], W_shr( W_mult0_32_32( f, factor1 ), magic_shift ) ); } } Loading Loading @@ -1132,7 +1132,6 @@ static void biDiagonalReductionRight_64( } norm_x_e = W_norm( norm_64 ); norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) ); norm_x_e = add( sub( ( HEADROOM_RIGHT_1 + HEADROOM_RIGHT_1 ), norm_x_e ), 1 ); move16(); IF( norm_x ) Loading @@ -1149,7 +1148,7 @@ static void biDiagonalReductionRight_64( Word32 invVal; Word16 invVal_e; ( *g_e ) = norm_x_e; ( *g_e ) = add( sub( ( HEADROOM_RIGHT_1 + HEADROOM_RIGHT_1 ), norm_x_e ), 1 ); move16(); ( *g ) = Sqrt32( norm_x, g_e ); IF( GE_64( singularVectors_Left_64[currChannel][idx], 0 ) ) Loading Loading
lib_dec/ivas_svd_dec_fx.c +10 −11 Original line number Diff line number Diff line Loading @@ -1004,7 +1004,8 @@ static void biDiagonalReductionLeft_64( { #define HEADROOM_LEFT_1 1 #define HEADROOM_LEFT_2 ( HEADROOM_LEFT_1 + 1 ) #define HEADROOM_LEFT_2 2 //( HEADROOM_LEFT_1 + 1 ) #define HEADROOM_LEFT_3 3 //( HEADROOM_LEFT_1 + 1 ) Word16 iCh, jCh; Word32 norm_x; Loading Loading @@ -1048,19 +1049,18 @@ static void biDiagonalReductionLeft_64( ( *g ) = L_negate( *g ); } factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][currChannel], HEADROOM_LEFT_1 ) ); tmp_e = sub( ( *g_e ), HEADROOM_LEFT_1 ); tmp_e = sub( HEADROOM_LEFT_1, ( *g_e ) ); tmpmul = W_mult0_32_32( ( *g ), factor2 ); tmpmul = W_shl( tmpmul, tmp_e ); tmpmul = W_shr( 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 ) ); invVal_e = sub( add( 1, ( HEADROOM_LEFT_1 + HEADROOM_LEFT_1 ) ), r_e ); invVal_e = 0; invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, r, &invVal_e ); tmp_e = add( 31, sub( HEADROOM_LEFT_1, *g_e ) ); 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 ) ); // here, the exponent goes up. FOR( iCh = add( currChannel, 1 ); iCh < nChannelsC; iCh++ ) Loading @@ -1081,10 +1081,10 @@ static void biDiagonalReductionLeft_64( 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 = add( add( norm_x_e, 23 ), sub( add( 1, ( HEADROOM_LEFT_1 + HEADROOM_LEFT_1 ) ), r_e ) ); magic_shift = norm_x_e+22+HEADROOM_LEFT_3+2*HEADROOM_LEFT_1-r_e; FOR( jCh = currChannel; jCh < nChannelsL; jCh++ ) { factor1 = W_extract_l( W_shr( singularVectors_Left_64[jCh][currChannel], HEADROOM_LEFT_2 ) ); factor1 = W_extract_h( W_shl( singularVectors_Left_64[jCh][currChannel], 32-HEADROOM_LEFT_3 ) ); singularVectors_Left_64[jCh][iCh] = W_add( singularVectors_Left_64[jCh][iCh], W_shr( W_mult0_32_32( f, factor1 ), magic_shift ) ); } } Loading Loading @@ -1132,7 +1132,6 @@ static void biDiagonalReductionRight_64( } norm_x_e = W_norm( norm_64 ); norm_x = W_extract_h( W_shl( norm_64, norm_x_e ) ); norm_x_e = add( sub( ( HEADROOM_RIGHT_1 + HEADROOM_RIGHT_1 ), norm_x_e ), 1 ); move16(); IF( norm_x ) Loading @@ -1149,7 +1148,7 @@ static void biDiagonalReductionRight_64( Word32 invVal; Word16 invVal_e; ( *g_e ) = norm_x_e; ( *g_e ) = add( sub( ( HEADROOM_RIGHT_1 + HEADROOM_RIGHT_1 ), norm_x_e ), 1 ); move16(); ( *g ) = Sqrt32( norm_x, g_e ); IF( GE_64( singularVectors_Left_64[currChannel][idx], 0 ) ) Loading