Commit 5f1be5ac authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

scale fac only in ACLEP branch

parent 86cd9778
Loading
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -754,9 +754,10 @@ void stereo_dft_res_ecu_burst_att_fx(
    IF( hStereoDft->core_hist[0] == ACELP_CORE )
    {
#ifdef FIX_ISSUE_2618_PLC_RES_ATT_SCALING
        fac = L_deposit_h( BASOP_Util_Divide3232_Scale( dmx_nrg, hStereoDft->past_dmx_nrg_fx, &exponent ) ); /* ratio mantissa Q31, exp 'exponent' */
        fac = Sqrt32( fac, &exponent );                                                                      /* sqrt: Q31 mantissa, exponent halved */
        fac = L_deposit_h( BASOP_Util_Divide3232_Scale( dmx_nrg, hStereoDft->past_dmx_nrg_fx, &exponent ) );
        fac = Sqrt32( fac, &exponent );
        fac = Mpy_32_16_1( fac, (Word16) ( 0x0CCD ) ); /* * 0.1f (Q15) */
        fac = L_shl_sat( fac, exponent );              /* Q31 */
#else

        fac = Mpy_32_16_1( Sqrt32( L_deposit_h( BASOP_Util_Divide3232_Scale( dmx_nrg, hStereoDft->past_dmx_nrg_fx, &q_fac ) ), &exponent ), (Word16) ( 0x0CCD ) ); /* Q0 */
@@ -770,9 +771,7 @@ void stereo_dft_res_ecu_burst_att_fx(
        fac = L_sub( MAX_32, L_deposit_h( BASOP_Util_Divide3232_Scale( L_sub( hStereoDft->time_offs, L_ana ), L_add( hStereoDft->time_offs, L_ana ), &q_fac ) ) ); /* Q0 */
#endif
    }
#ifdef FIX_ISSUE_2618_PLC_RES_ATT_SCALING
    fac = L_shl_sat( fac, exponent ); /* Q31 */
#endif

    v_multc_fx( pDFT_RES, fac, pDFT_RES, shl( L_res, 1 ) );

    return;