Commit 83a9031f authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Added one bit headroom to cx_fx calculation.

parent c38548bc
Loading
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1799,8 +1799,22 @@ void ivas_param_mc_dec_digest_tc_fx(
        test();
        IF( hParamMC->hMetadataPMC->bAttackPresent && ( EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_LS_CONV_COV ) || EQ_32( hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) ) )
        {
#ifdef MERGE_REQUEST_1926_SPEEDUP_ivas_svd_dec_fx_NONBE
            Word16 len = imult1616( nchan_transport, nchan_transport );
            Word16 sc = s_min( getScaleFactor32( cx_fx, len ), getScaleFactor32( cx_next_band_fx, len ) );
            IF( EQ_16( sc, 0 ) )
            {
                Scale_sig32( cx_fx, len, -Q1 );           // add one bit head room
                Scale_sig32( cx_next_band_fx, len, -Q1 ); // add one bit head room
                cx_e = add( cx_e, Q1 );
                cx_next_band_e = add( cx_e, Q1 );
            }
            v_add_fx( cx_fx, cx_next_band_fx, cx_fx, len );
            Copy32( cx_fx, cx_next_band_fx, len );
#else
            v_add_fx( cx_fx, cx_next_band_fx, cx_fx, imult1616( nchan_transport, nchan_transport ) );
            Copy32( cx_fx, cx_next_band_fx, imult1616( nchan_transport, nchan_transport ) );
#endif
        }

        FOR( is_next_band = 0; is_next_band < 2; is_next_band++ )