Commit 4e46b165 authored by vaillancour's avatar vaillancour
Browse files

Merge branch 'basop_noglob' of forge.3gpp.org:ivas-codec-pc/ivas-codec-basop into basop_noglob

parents 044ded64 b8f8d05b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -371,7 +371,11 @@ void hq2_noise_inject_fx(
                        ELSE IF(count[sub(k,1)] == 0 && tmp4 > 0)
                        {
                            L_tmp = L_mult(env_fx2[sub(k,1)],tmp); /* Q(1+Q_speech+1 = Q_speech+2) */
#ifdef BASOP_NOGLOB
                            fac_fx = extract_h(L_shl_o(L_tmp, sub(26, Q_speech), &Overflow));/*Q12 */
#else
                            fac_fx = extract_h(L_shl(L_tmp,sub(26,Q_speech)));/*Q12 */
#endif
                        }
                    }

+12 −0
Original line number Diff line number Diff line
@@ -113,6 +113,10 @@ void window_ola_fx(
    Word16 SS2[L_FRAME48k-NS2SA(48000, N_ZERO_MDCT_NS)];
    Word16 wret2[L_FRAME48k-NS2SA(48000, N_ZERO_MDCT_NS)];
    Word16 tmp2;
#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif


    /* Windows loading */
    tcx_get_windows_mode1(  left_mode,  right_mode, win_left, win_right, win_int_left,win_int_right, L);
@@ -325,7 +329,11 @@ void window_ola_fx(
            p4=OldauOut+n;
            FOR (i=0; i < temp; i++)
            {
#ifdef BASOP_NOGLOB
                *p1 = add_o(mult(*p1, *p2), shl(mult(*p4, *p3), 5), &Overflow);/*auOut[i]*SS2[i]+ OldauOut[i+n]*(SS2[L-n-i-1])/(wret2[i]+0.01f);;*/ move16();
#else
                *p1 =add( mult(*p1,*p2),shl(mult(*p4,*p3),5));/*auOut[i]*SS2[i]+ OldauOut[i+n]*(SS2[L-n-i-1])/(wret2[i]+0.01f);;*/ move16();
#endif
                p1++;
                p2++;
                p3++;
@@ -424,7 +432,11 @@ void window_ola_fx(
            temp_len = sub(shr(L,1), n);
            FOR (i = 0; i < temp_len; i++)
            {
#ifdef BASOP_NOGLOB
                *p1++ = round_fx_o(L_add_o(L_shl(Mult_32_16(*pa++, *p3), 1), L_deposit_h(*p4++), &Overflow), &Overflow);  /* (( Qin + Q15 -15)+1  + ( Qin - 15 + 16))-1 */
#else
                *p1++=round_fx(L_add(L_shl(Mult_32_16(*pa++,*p3),1),L_deposit_h(*p4++)));  /* (( Qin + Q15 -15)+1  + ( Qin - 15 + 16))-1 */
#endif
                p3-=decimate;
                /*paout[i] = ImdctOut[L/2 + i] * win_right[(2*L-i)*decimate-1-decay-windecay48]+OldauOut[i];*/
            }
+8 −0
Original line number Diff line number Diff line
@@ -704,6 +704,10 @@ static Word16 find_best_delay_fx(
    Word32 min_sq_cross_fx, min_corr_fx;
    Word32 accA_fx, accB_fx;
    Word32 Rxy_fx[MAXDELAY_FEC], Ryy_fx[MAXDELAY_FEC];
#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif


    d1 = mind1;
    move16();
@@ -767,7 +771,11 @@ static Word16 find_best_delay_fx(
        L_tmp1 = L_shl(min_sq_cross_fx, exp1);
        L_tmp2 = L_shl(min_corr_fx, exp2);
        tmp = div_s(extract_h(L_tmp1), extract_h(L_tmp2));/*15 + exp1 - exp2 */
#ifdef BASOP_NOGLOB
        tmp = shl_o(tmp, sub(exp2, add(exp1, 1)), &Overflow);/*14 */
#else
        tmp = shl(tmp, sub(exp2, add(exp1, 1)));/*14 */
#endif
    }

    *false_flag = 0;
+12 −0
Original line number Diff line number Diff line
@@ -187,7 +187,11 @@ void FEC_scale_syn_fx(
            {
                /* gain2 = (float)sqrt( enr_old / enr2 );*/
                L_tmp = Sqrt_Ratio32(L_enr_old, 0, L_enr2, 0, &exp2);
#ifdef BASOP_NOGLOB
                gain2 = round_fx_o(L_shl_o(L_tmp, sub(exp2, 1), &Overflow), &Overflow); /* in Q14 */
#else
                gain2 = round_fx(L_shl(L_tmp, sub(exp2, 1))); /* in Q14 */
#endif

                /*if( gain2 > 1.0f )gain2 = 1.0f;*/
                gain2 = s_min(gain2, 16384);
@@ -200,7 +204,11 @@ void FEC_scale_syn_fx(

                /*gain1 = (float)sqrt( enr_old / enr1 );*/
                L_tmp = Sqrt_Ratio32(L_enr_old, 0, L_enr1, 0, &exp2);
#ifdef BASOP_NOGLOB
                gain1 = round_fx_o(L_shl_o(L_tmp, sub(exp2, 1), &Overflow), &Overflow); /* in Q14 */
#else
                gain1 = round_fx(L_shl(L_tmp, sub(exp2, 1))); /* in Q14 */
#endif

                /*if( gain1 > 1.0f )gain1 = 1.0f;*/
                gain1 = s_min(gain1, 16384);
@@ -300,7 +308,11 @@ void FEC_scale_syn_fx(

                    /*gain1 = (float)sqrt( enr_old / enr1 );*/
                    L_tmp = Sqrt_Ratio32(L_enr_old, 0, L_enr1, 0, &exp2);
#ifdef BASOP_NOGLOB
                    gain1 = round_fx_o(L_shl_o(L_tmp, sub(exp2, 1), &Overflow), &Overflow); /* in Q14 */
#else
                    gain1 = round_fx(L_shl(L_tmp, sub(exp2, 1))); /* in Q14 */
#endif

                    /*if( gain1 > 1.2f )gain1 = 1.2f;*/
                    /* prevent clipping */
+8 −0
Original line number Diff line number Diff line
@@ -613,6 +613,10 @@ static void decod_gen_voic_core_switch_fx(
    Word16 *pt1;
    GSC_DEC_HANDLE hGSCDec;
    hGSCDec = st_fx->hGSCDec;
#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif



    /*----------------------------------------------------------------------*
@@ -697,7 +701,11 @@ static void decod_gen_voic_core_switch_fx(
    IF( st_fx->prev_bfi_fx )
    {
        /*gain_code = min(gain_code, 0.5f*gain_code+0.5f*st->lp_gainc);*/
#ifdef BASOP_NOGLOB
        gain_code16 = s_min(gain_code16, mac_r(L_mult(16384, gain_code16), shl_o(16384 >> 3, st_fx->Q_exc, &Overflow), st_fx->lp_gainc_fx)); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */
#else
        gain_code16 = s_min(gain_code16, mac_r(L_mult(16384,gain_code16),shl(16384>>3, st_fx->Q_exc), st_fx->lp_gainc_fx)); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */
#endif
    }

    FOR (i = 0; i < L_SUBFR; i++)
Loading