Commit 3f0458ec authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Exclude EVS_MONO from dynamic scaling of the synthesis buffer.

parent 58de895a
Loading
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -4081,12 +4081,19 @@ void decoder_tcx_ivas_fx(

    /* Scaling up again */
#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE
    IF( NE_32( st->element_mode, EVS_MONO ) ) // to keep evs bit-exactness
    {
        Word16 q_min = s_min( add( q_win, getScaleFactor16( synth_fx, L_frame_glob ) ),
                              add( q_winFB, getScaleFactor16( synthFB_fx, L_frameTCX_glob ) ) );
        q_min = s_min( q_min, st->Q_syn );
        Scale_sig( synth_fx, L_frame_glob, sub( q_min, q_win ) );
        Scale_sig( synthFB_fx, L_frameTCX_glob, sub( q_min, q_winFB ) );
        *synth_q = q_min;
    }
    ELSE
    {
        *synth_q = st->Q_syn;
    }
#else
    Scale_sig( synth_fx, L_frame_glob, sub( st->Q_syn, q_win ) );
    Scale_sig( synthFB_fx, L_frameTCX_glob, sub( st->Q_syn, q_winFB ) );
+2 −2
Original line number Diff line number Diff line
@@ -523,8 +523,8 @@ ivas_error ivas_core_dec_fx(
            }

#ifdef FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE
            if ( ( EQ_32( st->last_core, TCX_10_CORE ) || EQ_32( st->last_core, TCX_20_CORE ) ) ||                                                                                                                                   // st->Q_syn_factor is set in TCX mode; otherwise, it may be uninitialized
                 ( hCPE != NULL && ( GT_16( hCPE->element_mode, IVAS_CPE_DFT ) && EQ_16( hCPE->last_element_mode, IVAS_CPE_DFT ) && ( ( EQ_32( sts[0]->last_core, TCX_10_CORE ) || EQ_32( sts[0]->last_core, TCX_20_CORE ) ) ) ) ) ) // in this case sts[1] gets it value from sts[0]
            IF( ( EQ_32( st->last_core, TCX_10_CORE ) || EQ_32( st->last_core, TCX_20_CORE ) ) ||                                                                                                                                   // st->Q_syn_factor is set in TCX mode; otherwise, it may be uninitialized
                ( hCPE != NULL && ( GT_16( hCPE->element_mode, IVAS_CPE_DFT ) && EQ_16( hCPE->last_element_mode, IVAS_CPE_DFT ) && ( ( EQ_32( sts[0]->last_core, TCX_10_CORE ) || EQ_32( sts[0]->last_core, TCX_20_CORE ) ) ) ) ) ) // In this case, sts[1] gets its value from sts[0].
            {
                Scale_sig( st->old_exc_fx, L_EXC_MEM_DEC, negate( st->Q_syn_factor ) );
                st->Q_syn = add( st->Q_syn, st->Q_syn_factor );