diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index 1e7a13d4540aff74c0ec06175475fcd69a12c697..081e1281491241425b6229d7ce21b7dcd244fea7 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -445,12 +445,20 @@ ivas_error ivas_core_enc_fx( move16(); } - Scale_sig( st->input_fx, input_frame, negate( st->q_inp ) ); // Q0 - Scale_sig( st->old_input_signal_fx, input_frame, negate( st->q_old_inp ) ); // Q0 - st->q_old_inp = 0; - move16(); - st->q_inp = 0; - move16(); + test(); + test(); + test(); + test(); + test(); + IF( ( st->q_old_inp < 0 && st->q_inp < 0 && norm_arr( st->input_fx, input_frame ) && norm_arr( st->old_input_signal_fx, input_frame ) ) || ( st->q_old_inp > 0 && st->q_inp > 0 ) ) + { + scale_sig( st->input_fx, input_frame, negate( st->q_inp ) ); // Q0 + scale_sig( st->old_input_signal_fx, input_frame, negate( st->q_old_inp ) ); // Q0 + st->q_old_inp = 0; + move16(); + st->q_inp = 0; + move16(); + } } Word16 Q_spec_old[2], L_spec; Q_spec_old[0] = hCPE->hCoreCoder[0]->hTcxEnc->spectrum_long_e;