Commit 54c3d2e3 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'minor-tune-svd-wmops-mr1010x' into 'main'

added minor WMOPS tuning for SVD module, extends MR1010

See merge request !1081
parents 21cecc43 66e9f8b5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -152,3 +152,4 @@
#define FIX_ISSUE_1214                          /* Ittiam: Fix for issue 1214: Energy leakage in IGF tiles for MDCT-stereo @64kbps SWB*/
#define FIX_881_HILBERT_FILTER                  /* VA: improve the precision of the Hilbert filter to remove 2kHz unwanted tone */
#endif
#define FIX_MINOR_SVD_WMOPS_MR1010X             /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */
+43 −2
Original line number Diff line number Diff line
@@ -919,6 +919,7 @@ static void ApplyRotation_fx(
    *g = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x12 ), add( c_e, x12_e ), Mpy_32_32( L_negate( s ), x11 ), add( s_e, x11_e ), g_e ); /* exp(g_e) */
    move32();

#ifndef FIX_MINOR_SVD_WMOPS_MR1010X
    FOR( ch = 0; ch < nChannels; ch++ )
    {
        x11 = singularVector[ch][currentIndex2];
@@ -934,6 +935,24 @@ static void ApplyRotation_fx(
        singularVector[ch][currentIndex1] = L_shl_sat( singularVector[ch][currentIndex1], temp_exp ); /* exp(temp_exp) */
        move32();
    }
#else
    Word32 s_neg = L_negate( s );
    Word32 temp;
    FOR( ch = 0; ch < nChannels; ch++ )
    {
        x11 = singularVector[ch][currentIndex2];
        move32();
        x12 = singularVector[ch][currentIndex1];
        move32();
        temp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x11 ), c_e, Mpy_32_32( s, x12 ), s_e, &temp_exp ); /* exp(temp_exp) */
        singularVector[ch][currentIndex2] = L_shl_sat( temp, temp_exp );                                  /* exp(temp_exp) */
        move32();
        temp = BASOP_Util_Add_Mant32Exp( Mpy_32_32( c, x12 ), c_e, Mpy_32_32( s_neg, x11 ), s_e, &temp_exp ); /* exp(temp_exp) */
        singularVector[ch][currentIndex1] = L_shl_sat( temp, temp_exp );                                      /* exp(temp_exp) */
        move32();
    }

#endif

    return;
}
@@ -1160,6 +1179,7 @@ IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */
        L_temp = Sqrt32( norm_x, &L_temp_e );
        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 ) );
#ifndef FIX_MINOR_SVD_WMOPS_MR1010X
        IF( singularVectors[currChannel][idx] >= 0 )
        {
            ( *g ) = L_negate( L_temp );
@@ -1170,6 +1190,14 @@ IF( LT_16( currChannel, nChannelsL ) ) /* i <= m */
            ( *g ) = L_negate( L_negate( L_temp ) );
            move32();
        }
#else
            if ( singularVectors[currChannel][idx] >= 0 )
            {
                L_temp = L_negate( L_temp );
            }
            ( *g ) = L_temp;
            move32();
#endif

#ifndef FIX_1010_OPT_SINGLE_RESCALE
        r = BASOP_Util_Add_Mant32Exp( Mpy_32_32( ( *g ), singularVectors[currChannel][idx] ), sing_exp[currChannel], -norm_x, norm_x_e, &r_e );                       /* exp(r_e) */
@@ -1868,6 +1896,7 @@ static Word32 maxWithSign_fx(
    const Word32 a /* Qx */
)
{
#ifndef FIX_MINOR_SVD_WMOPS_MR1010X
    IF( GT_32( L_abs( a ), SVD_MINIMUM_VALUE_FX ) )
    {
        return a;
@@ -1880,6 +1909,18 @@ static Word32 maxWithSign_fx(
    {
        return SVD_MINIMUM_VALUE_FX;
    }
#else
    Word32 result;
    if ( a >= 0 )
    {
        result = L_max( a, SVD_MINIMUM_VALUE_FX );
    }
    if ( a < 0 )
    {
        result = L_min( a, -SVD_MINIMUM_VALUE_FX );
    }
    return result;
#endif
}

/*-------------------------------------------------------------------------