Commit c2c1ee66 authored by Arash Azizi's avatar Arash Azizi
Browse files

issue: 2446 Fixing overflow problem in scale_sig() in con_tcx_ivas_fx()

parent 9aacef5a
Loading
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1070,8 +1070,18 @@ void con_tcx_ivas_fx(
        }
#endif // !HARMONIZE_2446_CON_TCX_FX


#ifndef HARMONIZE_2446_CON_TCX_FX
        scale_sig(&(synth[-(((L_frame / 2) + hTcxDec->pit_max_TCX) + 2 * M)]), add(add(shr(L_frame, 1), hTcxDec->pit_max_TCX), shl_sat(M, 1)), negate(st->Q_syn_factor)); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */
#else
        IF(!leg_flag) {
            scale_sig(&(synth[-(((L_frame / 2) + hTcxDec->pit_max_TCX) + 2 * M)]), add(add(shr(L_frame, 1), hTcxDec->pit_max_TCX), shl_sat(M, 1)), negate(st->Q_syn_factor)); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */
        }
        ELSE{
            Scale_sig(&(synth[-(((L_frame / 2) + hTcxDec->pit_max_TCX) + 2 * M)]), add(add(shr(L_frame, 1), hTcxDec->pit_max_TCX), shl_sat(M, 1)), negate(st->Q_syn_factor)); /*Q0, Setting back to Q0, as the following calculations are implemented assuming synth is in Q0 */
        }
        
#endif // !HARMONIZE_2446_CON_TCX_FX

        
        st->Mode2_lp_gainc = L_deposit_l( 0 );