Commit b752ac4b authored by Fabian Bauer's avatar Fabian Bauer
Browse files

take lmnopqrs from ce60069 but swb_bwe_com_fx

parent 33901be5
Loading
Loading
Loading
Loading
Loading
+112 −82
Original line number Diff line number Diff line
@@ -38,6 +38,12 @@

#include <assert.h>

#ifndef ISSUE_1836_FILEACTIVE_swb_bwe_com_lr_fx_c
#ifdef ISSUE_1836_replace_overflow_libcom
#undef ISSUE_1836_replace_overflow_libcom
#endif
#endif

/*-------------------------------------------------------------------*
 * GetPredictedSignal()
 *
@@ -927,9 +933,11 @@ void SpectrumSmoothing_fx(
    Word16 reset_flag;
    Word16 pp, pk;
    Word16 exp_norm;
#ifndef ISSUE_1836_replace_overflow_libcom
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif

    *Qss = 10;
@@ -986,7 +994,11 @@ void SpectrumSmoothing_fx(
        IF( GT_32( L_max_val[i], 0x1L ) )
        {
            exp_normd = norm_l( L_max_val[i] );
#ifdef ISSUE_1836_replace_overflow_libcom
            max_val_norm_fx = div_s( 0x2800, round_fx_sat( L_shl( L_max_val[i], exp_normd ) ) ); /* Q10-(Qs+exp_normd-16) */ //??sat
#else
            max_val_norm_fx = div_s( 0x2800, round_fx_o( L_shl_o( L_max_val[i], exp_normd, &Overflow ), &Overflow ) ); /* Q10-(Qs+exp_normd-16) */
#endif
            Qmax_val_norm[i] = sub( 10 - 12 + 16 + 15, exp_normd );
            move16(); /* 10 - (12+exp_normd-16) +15 */
            ;
@@ -1008,10 +1020,19 @@ void SpectrumSmoothing_fx(
                outBuf_pss_fx[j] = 0;
                move16();
            }
            ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) )
            {
                IF( L_inBuf_pss[j] >= 0 )
            ELSE IF( LT_32( L_abs( L_inBuf_pss[j] ), L_max_val[i] ) ){
#ifdef ISSUE_1836_replace_overflow_libcom
                IF( L_inBuf_pss[j] >= 0 ){
                    outBuf_pss_fx[j] = round_fx_sat( L_shl_sat( Mpy_32_16_r( L_shl( L_inBuf_pss[j], exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ); //??sat //??sat
            move32();
        }
        ELSE
        {
            outBuf_pss_fx[j] = negate( round_fx_sat( L_shl_sat( Mpy_32_16_r( L_shl_sat( L_abs( L_inBuf_pss[j] ), exp_norm ), max_val_norm_fx ), sub( exp_shift, exp_norm ) ) ) ); //??sat //??sat //??sat
            move16();
        }
#else
                IF( L_inBuf_pss[j] >= 0 ){
                    outBuf_pss_fx[j] = round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_inBuf_pss[j], exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow );
            move32();
        }
@@ -1020,6 +1041,7 @@ void SpectrumSmoothing_fx(
            outBuf_pss_fx[j] = negate( round_fx_o( L_shl_o( Mpy_32_16_r( L_shl_o( L_abs( L_inBuf_pss[j] ), exp_norm, &Overflow ), max_val_norm_fx ), sub( exp_shift, exp_norm ), &Overflow ), &Overflow ) );
            move16();
        }
#endif
    }
    ELSE
    {
@@ -2225,9 +2247,11 @@ void ton_ene_est_fx(
    Word16 temp2_fx, Qtemp2;
    Word16 temp_fx;

#ifndef ISSUE_1836_replace_overflow_libcom
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif

    *QbeL = 3;
@@ -2338,7 +2362,7 @@ void ton_ene_est_fx(
        move16();
        /* 0.06=15729(Q18) */
        exp_shift = sub( 18, QE_r );
#ifdef ISSUE_1796_replace_shl_o
#ifdef ISSUE_1836_replace_overflow_libcom //??sat
        E_r_shift_fx = shl_sat( E_r_fx, exp_shift );
#else
        E_r_shift_fx = shl_o( E_r_fx, exp_shift, &Overflow );
@@ -2380,13 +2404,19 @@ void ton_ene_est_fx(
            L_temp = Mult_32_16( L_temp, E_r_fx );

            /* 0.12f: 257698038 (Q31) */
#ifdef ISSUE_1836_replace_overflow_libcom
            IF( GE_32( L_shl_sat( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ) ), 257698038 ) ) //??sat
#else
            if ( GE_32( L_shl_o( L_temp, sub( 31, add( add( shl( Qavg_pe[k], 1 ), QE_r ), 1 - 15 ) ), &Overflow ), 257698038 ) )
#endif
            {
                ni_gain_fx[k] = mult_r( 1638, ni_gain_fx[k] ); /* 0.05 : 1638(Q15) */
                move16();
            }
#ifndef ISSUE_1836_replace_overflow_libcom
            Overflow = 0;
            move16();
#endif
            ni_gain_fx[k] = shl( ni_gain_fx[k], sub( Qni_gain, Qavg_pe[k] ) );
            move16();
            assert( Qni_gain == 8 );                     /* 358 is '(short)(1.4*pow(2,Qni_gain))' */
@@ -3213,7 +3243,7 @@ void noiseinj_hf_fx(
    Word16 exp_normn, exp_normd;
    Word16 div_fx;
    Word16 Qdiv;
#ifndef ISSUE_1796_replace_shl_o
#ifndef ISSUE_1836_replace_overflow_libcom
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
@@ -3252,8 +3282,8 @@ void noiseinj_hf_fx(
    move32();
    /**p_L_En = (float)sqrt(*p_En);*/
    sqrt_32n_16_fx( *p_L_En, QbeL, p_sqrt_En_fx, &Qtemp );
#ifdef ISSUE_1796_replace_shl_o
    *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */
#ifdef ISSUE_1836_replace_overflow_libcom
    *p_sqrt_En_fx = shl_sat( *p_sqrt_En_fx, sub( QsEn, Qtemp ) ); /* -> Q2 */ //??sat
#else
    *p_sqrt_En_fx = shl_o( *p_sqrt_En_fx, sub( QsEn, Qtemp ), &Overflow ); /* -> Q2 */
#endif
@@ -3326,8 +3356,8 @@ FOR( k = BANDS_fx - NB_SWB_SUBBANDS; k < BANDS_fx; k++ )

        /* SQRT Part */
        sqrt_32n_16_fx( L_deposit_h( div_fx ), add( Qdiv, 16 ), &ni_scale_fx, &Qtemp );
#ifdef ISSUE_1796_replace_shl_o
        ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) );
#ifdef ISSUE_1836_replace_overflow_libcom
        ni_scale_fx = shl_sat( ni_scale_fx, sub( 14, Qtemp ) ); //??sat
#else
        ni_scale_fx = shl_o( ni_scale_fx, sub( 14, Qtemp ), &Overflow );
#endif
+212 −49

File changed.

Preview size limit exceeded, changes collapsed.