Commit 5cb8d86d authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ltv_crash_fix_mult_ch_5_1_13.2_48k' into 'main'

Fix for LTV Multichannel 5_1 at 13.2 kbps 48kHz stream crash

See merge request !1428
parents 98e28d13 298c2401
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -233,7 +233,7 @@ void pre_echo_att_ivas_fx(
            tmp = BASOP_Util_Divide3232_Scale( *Last_frame_ener_fx, etmp_fx, &tmp_e ); /* numerator Q = 2 * Q_new + 1;  denominator Q = 31 - tmp_e */
            tmp_e = add( tmp_e, sub( sub( 31, etmp_e ), add( shl( Q_new, 1 ), 1 ) ) ); /* tmp_e = tmp_e + (31 - tmp_e) - (2 * Q_new + 1) */
            tmp = Sqrt16( tmp, &tmp_e );
            ratio_fx = shr( tmp, sub( 2, tmp_e ) ); /* Q13 */
            ratio_fx = shr_sat( tmp, sub( 2, tmp_e ) ); /* Q13 */

            /* Pre-echo atttenuation should never increase the energy */
            ratio_fx = s_min( ratio_fx, 8192 /* 1 in Q13 */ ); /* Q13 */