Commit bab7b6b0 authored by multrus's avatar multrus
Browse files

Merge branch '1811-w_shl-w_shr-called-with-exceeding-shift-values' into 'main'

[non-BE][split-non-BE] Resolve "W_shl()/W_shr() called with exceeding shift values"

See merge request !1928
parents 255fe356 f8d69f35
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -802,7 +802,11 @@ static void ivas_get_pred_coeffs_enc_fx(
                tmp64 = W_mult0_32_32( w_norm_fac, dm_w ); // Q=q_tmp
                IF( LT_16( q_tmp, q_cov_real[0][0][b] ) )
                {
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
                    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
                }
                ELSE
                {
+1 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@
#define	NONBE_SVD_OPTIMIZATION                               /* FhG: reduce WMOPS of HouseHolderReduction() in ivas_svd_dec.c() by removing redundant mathematics and using 64 bit additions */
#define FIX_1766_TCX2ACELP_BWE_ISSUE                         /* VA : Fix rare BWE issue when switching from TCX to ACELP */
#define FIX_1781_SPECTRAL_GAPS                               /* FhG: Change internal calculation of tcx_noise_factor_ivas_fx() to 32-bit*/
#define FIX_ISSUE_1811_EXCEEDING_W_SHIFTS                    /* FhG: limit exceeding 64bit shifts */


/* #################### Start BASOP porting switches ############################ */

lib_com/swb_tbe_com_fx.c

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -6903,7 +6903,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
@@ -651,8 +651,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;
        }

lib_dec/ivas_lfe_plc_fx.c

100644 → 100755
+4 −0
Original line number Diff line number Diff line
@@ -646,7 +646,11 @@ static void d_syn_filt_fx(
            }
            ELSE
            {
#ifdef FIX_ISSUE_1811_EXCEEDING_W_SHIFTS
                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
                s_q_fx = temp_q;
                move16();
            }
Loading