Commit a64d99ea authored by vaillancour's avatar vaillancour
Browse files

fixes for max_band bw_switch_NB_WB_SWB_FB.txt bw_59_1280.bin 32...

parent 5f94be93
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -244,6 +244,9 @@ Word16 BitAllocF_fx (
    Word16 tmp, exp1, exp2;
    Word32 Rsubband_w32_fx[NB_SFM];                                             /* Q15  */
    Word16 B_w16_fx;
#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif /* BASOP_NOGLOB */

    set32_fx( Rsubband_w32_fx, 0, NB_SFM);

@@ -433,7 +436,11 @@ Word16 BitAllocF_fx (
            exp1 = sub(norm_l(L_tmp2), 1);
            exp2 = norm_s(n);
            tmp = div_s(extract_h(L_shl(L_tmp2, exp1)), shl(n, exp2));/*15 + 15 + exp1 - 16 - exp2*/
#ifdef BASOP_NOGLOB
            m_fx = shl_o(tmp, sub(exp2, exp1), &Overflow);/*Q14*/
#else
            m_fx = shl(tmp, sub(exp2, exp1));/*Q14*/
#endif
            if (L_tmp1 < 0)
            {
                m_fx = negate(m_fx);
+6 −0
Original line number Diff line number Diff line
@@ -1637,9 +1637,15 @@ void a2rc_fx( const Word16* a, /* i: can be any Q */
        IF ( m & 1 )
        {
            L_tmp1 = L_mult( denom_mant, f_fx[ j] ); /* denom*f[j]. Q15*Q12 = Q28 (floating with exp) */
#ifdef BASOP_NOGLOB
            L_tmp1 = L_mac_o( L_tmp1, tmp,f_fx[j], &Overflow ); /* denom*f[j]+km*denom*f[j] in Q28 (floating with exp) */
            L_tmp1 = L_shr_o( L_tmp1, exp, &Overflow); /* bringing to true Q28 */
            f_fx[j] = round_fx_o( L_tmp1, &Overflow); /* extracting in q_a */
#else      
            L_tmp1 = L_mac( L_tmp1, tmp,f_fx[j] ); /* denom*f[j]+km*denom*f[j] in Q28 (floating with exp) */
            L_tmp1 = L_shr( L_tmp1, exp ); /* bringing to true Q28 */
            f_fx[j] = round_fx( L_tmp1 ); /* extracting in q_a */
#endif
        }
    }

+9 −0
Original line number Diff line number Diff line
@@ -585,12 +585,21 @@ Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 */
        L_ener_tot = L_add(L_ener_tot, L_ener);
#endif
    }
#ifdef BASOP_NOGLOB
    L_ener = L_deposit_l(abs_s(sub_o(sp[1], sp[0], &Overflow)));
#else
    L_ener = L_deposit_l(abs_s(sub(sp[1], sp[0])));
#endif
    FOR (i = 2; i < N; i++)
    {
        /* Eq to (sp[i] - sp[i-1]) * (sp[i-1] - sp[i-2]) < 0 */
#ifdef BASOP_NOGLOB
        tmp1 = sub_o(sp[i], sp[i-1], &Overflow);
        tmp2 = sub_o(sp[i-1], sp[i-2], &Overflow);
#else
        tmp1 = sub(sp[i], sp[i-1]);
        tmp2 = sub(sp[i-1], sp[i-2]);
#endif
        tmp2 = mult(tmp1, tmp2);
        tmp1 = abs_s(tmp1);
        /* to Get either 0 or -1 in 'tmp2' */
+7 −2
Original line number Diff line number Diff line
@@ -3124,7 +3124,9 @@ void noiseinj_hf_fx(
    Word16 exp_normn, exp_normd;
    Word16 div_fx;
    Word16 Qdiv;

#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    set16_fx(map_pulse_t_fx, 0, band_end_fx[BANDS_fx-1]+1);
    set16_fx(map_pulse_fx, 0, band_end_fx[BANDS_fx-1]+1);

@@ -3224,8 +3226,11 @@ void noiseinj_hf_fx(

            /* SQRT Part */
            sqrt_32n_16_fx(L_deposit_h(div_fx), add(Qdiv, 16), &ni_scale_fx, &Qtemp);
#ifdef BASOP_NOGLOB
            ni_scale_fx = shl_o(ni_scale_fx, sub(14, Qtemp), &Overflow);
#else
            ni_scale_fx = shl(ni_scale_fx, sub(14, Qtemp));

#endif
            ni_scale_fx = s_min(20408, ni_scale_fx); /* 1.25=20408.0(Q14) */

            ni_scale_fx = s_max(12288, ni_scale_fx); /* 0.75=12288.0(Q14) */
+11 −0
Original line number Diff line number Diff line
@@ -1429,6 +1429,9 @@ void GenShapedSHBExcitation_fx(
    Word32 White_exc16k_32[L_FRAME16k];
    Word16 Q_temp;
    Word16 prev_Q_bwe_exc_fb;
#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif 
#ifdef ADD_IVAS_TBE_CODE
    Word32 tempD;
    Word16 alpha, step, mem_csfilt_left, mem_csfilt_right, excNoisyEnvLeft[L_FRAME16k], excNoisyEnvRight[L_FRAME16k];
@@ -1959,7 +1962,11 @@ void GenShapedSHBExcitation_fx(
                    temp = sub(MAX_16, temp);
                    tempQ31 = Mult_32_16(pow1, temp);
                    L_tmp = root_a_over_b_fx(tempQ31, Q_pow1, pow22, Q_pow22, &exp);
#ifdef BASOP_NOGLOB
                    temp2 = round_fx_o(L_shl_o(L_tmp, exp, &Overflow), &Overflow);    /* Q15 whiteEnvShapedExc scale factor */
#else
                    temp2 = round_fx(L_shl(L_tmp, exp));    /* Q15 whiteEnvShapedExc scale factor */
#endif
                }
                ELSE
                {
@@ -1977,7 +1984,11 @@ void GenShapedSHBExcitation_fx(
                    temp = sub(MAX_16, vf_tmp);
                    tempQ31 = Mult_32_16(pow1, temp);
                    L_tmp = root_a_over_b_fx(tempQ31, Q_pow1, pow22, Q_pow22, &exp);
#ifdef BASOP_NOGLOB
                    temp2 = round_fx_o(L_shl_o(L_tmp, exp, &Overflow), &Overflow);    /* Q15 whiteEnvShapedExc scale factor */
#else
                    temp2 = round_fx(L_shl(L_tmp, exp));    /* Q15 whiteEnvShapedExc scale factor */
#endif
                }

                FOR(j = 0; j < lSubFr; j++)
Loading