Commit 044ded64 authored by vaillancour's avatar vaillancour
Browse files

fix VBR issues

parent fef9e8d6
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -65,7 +65,9 @@ void deemph_lpc_fx(
    Word16 k,temp;
    Word16 b_fx[M+2];/* Q12 */
    Word16 a_fx[2] = {-22282, 32767};/* Q15 {-PREEMPH_FAC,1.0} */

#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    b_fx[0] = 4096;
    move16();/* 1 in Q12 */
    FOR(k = 0; k < M; k++)
@@ -80,7 +82,11 @@ void deemph_lpc_fx(
    {
        /* LPC_de_curr[k] = a[0]*b[k] + a[1]*b[k+1]; */
        temp = mult(a_fx[0],b_fx[k]);/* Q12 */
#ifdef BASOP_NOGLOB
        LPC_de_curr_fx[k] = add_o(temp,b_fx[k+1], &Overflow);
#else                                                   
        LPC_de_curr_fx[k] = add(temp,b_fx[k+1]);
#endif
        move16();/* Q12 */
    }

@@ -102,7 +108,11 @@ void deemph_lpc_fx(
        {
            /* LPC_de_old[k] = a[0]*b[k] + a[1]*b[k+1]; */
            temp = mult(a_fx[0],b_fx[k]);/* Q12 */
#ifdef BASOP_NOGLOB
            LPC_de_old_fx[k] = add_o(temp,b_fx[k+1], &Overflow);
#else
            LPC_de_old_fx[k] = add(temp,b_fx[k+1]);
#endif
            move16();/* Q12 */
        }
    }
+15 −1
Original line number Diff line number Diff line
@@ -54,22 +54,36 @@ void E_UTIL_f_preemph2(Word16 shift, Word16 *signal, const Word16 mu, const Word
{
    Word16 i, temp;
    Word32 L_tmp;

#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    temp = signal[lg - 1];
    move16();

    FOR (i = sub(lg, 1); i > 0; i--)
    {
        L_tmp = L_mult(signal[i], 16384);
#ifdef BASOP_NOGLOB
        L_tmp = L_msu0_o(L_tmp, signal[i - 1], mu, &Overflow);
        L_tmp = L_shl_o(L_tmp, add(shift,1), &Overflow);
        signal[i] = round_fx_o(L_tmp, &Overflow);
#else
        L_tmp = L_msu0(L_tmp, signal[i - 1], mu);
        L_tmp = L_shl(L_tmp, add(shift,1));
        signal[i] = round_fx(L_tmp);
#endif
    }

    L_tmp = L_mult(signal[0], 16384);
#ifdef BASOP_NOGLOB
    L_tmp = L_msu0_o(L_tmp, *mem, mu, &Overflow);
    L_tmp = L_shl_o(L_tmp, add(shift,1), &Overflow);
    signal[0] = round_fx_o(L_tmp, &Overflow);
#else
    L_tmp = L_msu0(L_tmp, *mem, mu);
    L_tmp = L_shl(L_tmp, add(shift,1));
    signal[0] = round_fx(L_tmp);
#endif

    *mem = temp;
    move16();
+7 −1
Original line number Diff line number Diff line
@@ -1581,7 +1581,9 @@ void pz_filter_sp_fx (
    Word16 s_mem;
    Word32 Ltemp1;
    Word32 Lacc;

#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    s = negate( Qa );
    s = add( s, s );  /* s=-2Qa*/
    s = add( s, 1 );
@@ -1595,7 +1597,11 @@ void pz_filter_sp_fx (


        Lacc = L_shr( Lacc, 1 );
#ifdef BASOP_NOGLOB
        Ltemp1 = L_add_o( L_shl_o( Lacc, Qa, &Overflow), 0x08000, &Overflow);
#else
        Ltemp1 = L_add( L_shl( Lacc, Qa ), 0x08000 );
#endif
        s_mem = extract_h( Ltemp1 );

        Lacc = L_deposit_l(0);
+242 −28

File changed.

Preview size limit exceeded, changes collapsed.

+16 −0
Original line number Diff line number Diff line
@@ -381,7 +381,11 @@ void nelp_encoder_fx(
        EL1_fx = L_deposit_l(0);
        FOR (i=0 ; i<L_FRAME; i++)
        {
#ifdef BASOP_NOGLOB
            EL1_fx = L_mac0_o(EL1_fx, filtRes_fx[i], filtRes_fx[i], &Overflow); /*Q(2*qIn) */
#else
            EL1_fx = L_mac0(EL1_fx, filtRes_fx[i], filtRes_fx[i]); /*Q(2*qIn) */
#endif
        }
        qEL1 = shl(qEL1, 1);

@@ -397,7 +401,11 @@ void nelp_encoder_fx(
        EH1_fx = L_deposit_l(0);
        FOR (i=0 ; i<L_FRAME; i++)
        {
#ifdef BASOP_NOGLOB
            EH1_fx = L_mac0_o(EH1_fx, filtRes_fx[i], filtRes_fx[i], &Overflow); /*Q(2*qEH1) */
#else
            EH1_fx = L_mac0(EH1_fx, filtRes_fx[i], filtRes_fx[i]); /*Q(2*qEH1) */
#endif
        }
        qEH1 = 2*qEH1;
        move16();
@@ -414,7 +422,11 @@ void nelp_encoder_fx(
        Ltemp = L_deposit_l(0);
        FOR (j = (Word16)(i*lag) ; j<(Word16)((i+1)*lag); j++)
        {
#ifdef BASOP_NOGLOB
            Ltemp = L_mac0_o(Ltemp, in_fx[j], in_fx[j], &Overflow); /*Q(2*qGain) */
#else
            Ltemp = L_mac0(Ltemp, in_fx[j], in_fx[j]); /*Q(2*qGain) */
#endif
        }

        /*Gains[i] = (float) sqrt(Gains[i]/lag); */
@@ -438,7 +450,11 @@ void nelp_encoder_fx(
    Ltemp = L_deposit_l(0);
    FOR (j = (Word16)(i*lag) ; j<L_FRAME; j++)
    {
#ifdef BASOP_NOGLOB
        Ltemp = L_mac0_o(Ltemp, in_fx[j], in_fx[j], &Overflow); /*Q(2*qGain) */
#else
        Ltemp = L_mac0(Ltemp, in_fx[j], in_fx[j]); /*Q(2*qGain) */
#endif
    }

    /*Gains[i] = (float) sqrt(Gains[i]/(L_FRAME-(lag*i))); */
Loading