Commit 07a9f0d5 authored by Arthur Tritthart's avatar Arthur Tritthart
Browse files

added s_min/s_max around shift a,ount

parent 3ae58efb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -803,7 +803,7 @@ static void ivas_get_pred_coeffs_enc_fx(
                IF( LT_16( q_tmp, q_cov_real[0][0][b] ) )
                {
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
                    tmp64 = W_shr( tmp64, Min(63, sub( q_cov_real[0][0][b], q_tmp ) ) ); // Q=q_tmp
                    tmp64 = W_shr( tmp64, s_min(63, sub( q_cov_real[0][0][b], q_tmp ) ) ); // Q=q_tmp
#else
                    tmp64 = W_shr( tmp64, sub( q_cov_real[0][0][b], q_tmp ) ); // Q=q_tmp
#endif

lib_com/swb_tbe_com_fx.c

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -6747,7 +6747,11 @@ void synthesise_fb_high_band_fx(
        Word64 W_temp;

        t_Q = sub( shl( exp_tmp, 1 ), 8 );
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
        P_ONE = W_shl( P_ONE, s_min( 63, sub( t_Q, 15 ) ) );
#else
        P_ONE = W_shl( P_ONE, sub( t_Q, 15 ) );
#endif

        W_temp = W_add( P_ONE, temp1 );

lib_com/tns_base.c

100644 → 100755
+4 −1
Original line number Diff line number Diff line
@@ -646,8 +646,11 @@ Word16 ITF_Detect_ivas_fx(
        {
            sum = W_mac_32_32( sum, temp_spectrum[i], temp_spectrum[i] ); // 2(Q+shift)+1
        }

#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
        IF( LE_64( sum, W_shl( 32768 * 2 /* HLM_MIN_NRG in Q1 */, s_min( 63, shl( add( Q, shift ), 1 ) ) ) ) )
#else
        IF( LE_64( sum, W_shl( 32768 * 2 /* HLM_MIN_NRG in Q1 */, shl( add( Q, shift ), 1 ) ) ) )
#endif
        {
            BREAK;
        }
+1 −1
Original line number Diff line number Diff line
@@ -647,7 +647,7 @@ static void d_syn_filt_fx(
            ELSE
            {
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
                s_fx = W_sub( W_shr( s_fx, Min( 63, sub( s_q_fx, temp_q ) ) ), temp );
                s_fx = W_sub( W_shr( s_fx, s_min( 63, sub( s_q_fx, temp_q ) ) ), temp );
#else
                s_fx = W_sub( W_shr( s_fx, sub( s_q_fx, temp_q ) ), temp );
#endif
+1 −1
Original line number Diff line number Diff line
@@ -1965,7 +1965,7 @@ void ivas_mdct_core_whitening_enc_fx(
            FOR( i = 0; i < NB_DIV; i++ )
            {
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
                chE_tot_fx = W_add( W_shr( chE_fx[i], Min(63, sub( chE_q[i], q ) ) ), chE_tot_fx );
                chE_tot_fx = W_add( W_shr( chE_fx[i], s_min(63, sub( chE_q[i], q ) ) ), chE_tot_fx );
#else
                chE_tot_fx = W_add( W_shr( chE_fx[i], sub( chE_q[i], q ) ), chE_tot_fx );
#endif
Loading