Commit 83a60c2d authored by multrus's avatar multrus
Browse files

separate changes to lib_com/ivas_dirac_com_fx.c from cldfb_opt

parent 3ea8505d
Loading
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -1026,6 +1026,7 @@ void computeDiffuseness_fixed(
    q_intensity_slow = sub( add( q_intensity, q_intensity ), 31 );

    /* Compute Diffuseness */
#ifndef OPT_SBA_DEC_PATH
    p_tmp = intensity_slow_abs;
    exp2 = 0;
    move16();
@@ -1064,6 +1065,31 @@ void computeDiffuseness_fixed(
            move32();
        }
    }
#else /* OPT_SBA_DEC_PATH */
    Word16 diff = sub( 62, q_ene );
    p_tmp = intensity_slow_abs;
    FOR( i = 0; i < num_freq_bands; ++i )
    {

        exp1 = sub( 31, q_intensity_slow );
        tmp = Sqrt32( p_tmp[i], &exp1 );

        tmp = BASOP_Util_Divide3232_Scale_newton( tmp, L_add( energy_slow[i], EPSILLON_FX ), &exp2 );
        q_tmp = sub( diff, add( exp1, exp2 ) );
        // bring to Q30
        tmp = L_shl_sat( tmp, sub( Q30, q_tmp ) );
        diffuseness[i] = L_sub( ONE_IN_Q30, tmp );
        move32();

        if ( LT_32( diffuseness[i], 0 ) )
        {
            diffuseness[i] = 0;
            move32();
        }
    }

#endif /* OPT_SBA_DEC_PATH */

    *q_diffuseness = Q30;
    move16();

+2 −0
Original line number Diff line number Diff line
@@ -106,4 +106,6 @@

#define FIX_1713_EXP                            /* VA: proposed correction to exp in ic-BWE*/

#define OPT_SBA_DEC_PATH

#endif