Commit 35e6a02a authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3gpp issue 926: Usage of L_shl(), L_shl_o(), L_shl_sat() and L_shr(),...

Fix for 3gpp issue 926: Usage of L_shl(), L_shl_o(), L_shl_sat() and L_shr(), L_shr_o(), L_shr_sat()
parent cb7b6b1e
Loading
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2077,6 +2077,7 @@ static void ivas_calc_p_coeffs_per_band_fx(
    Word32 cov_dd_re[IVAS_SPAR_MAX_CH - 1][IVAS_SPAR_MAX_CH - 1];
    Word32 cov_uu_re[IVAS_SPAR_MAX_CH - 1][IVAS_SPAR_MAX_CH - 1];
    Word16 b_ts_idx;
    Word16 tmp;

    b_ts_idx = add( band_idx, imult1616( i_ts, IVAS_MAX_NUM_BANDS ) );

@@ -2230,7 +2231,7 @@ static void ivas_calc_p_coeffs_per_band_fx(
        Word16 factor_exp = 0;
        move16();
        factor = BASOP_Util_Divide3232_Scale( L_shl( 1, q_postpred_cov_re ), factor, &factor_exp );
        factor = L_shl_sat( factor, factor_exp );
        tmp = sub( 15, factor_exp );

        /* normalise Hermitian (except for rounding) cov_uu */
        FOR( i = num_dmx; i < num_ch; i++ )
@@ -2240,7 +2241,7 @@ static void ivas_calc_p_coeffs_per_band_fx(
                IF( EQ_16( i, j ) )
                {
                    /* force diagonal to be real */
                    cov_uu_re[sub( i, num_dmx )][sub( j, num_dmx )] = W_extract_l( W_shr( W_mult0_32_32( cov_uu_re[sub( i, num_dmx )][sub( j, num_dmx )], factor ), 15 ) );
                    cov_uu_re[sub( i, num_dmx )][sub( j, num_dmx )] = W_extract_l( W_shr( W_mult0_32_32( cov_uu_re[sub( i, num_dmx )][sub( j, num_dmx )], factor ), tmp ) );
                    move32();
                }
                ELSE
@@ -3736,7 +3737,8 @@ void ivas_get_spar_md_from_dirac_fx(
            }


            en_ratio_fac_fx = L_sub( ONE_IN_Q31, L_shl_sat( diffuseness_fx[band], 1 ) ); // assuming q of dissusion 30
            en_ratio_fac_fx = L_shl( L_sub( ONE_IN_Q30 - EPSILON_FX /* Guard to prevent overflow if diffuseness_fx is 0 */, diffuseness_fx[band] ), 1 ); // assuming q of dissusion 30
            en_ratio_fac_fx = L_max( en_ratio_fac_fx, 0 );

            FOR( i = 0; i < num_ch; i++ )
            {