Commit 9c0e6243 authored by vaillancour's avatar vaillancour
Browse files

Fixes for stv48n2_bw_59_1280_evs_amrwb_48kHz.b10.COD

parent 3a09b51c
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -749,10 +749,6 @@ static Word16 Pit_track_fx( /* o : Pitch */
    Word32 Ltmp0, Lcorr0, Lener0;
    Word16 *v1, *v2;
    Word16 exp1, exp2;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif


    /*----------------------------------------------------------------*
     * Test pitch/2 to avoid continuous pitch doubling
@@ -781,9 +777,9 @@ static Word16 Pit_track_fx( /* o : Pitch */
        FOR (i = 1; i < (L_HALFR16k+NBPSF_L_EXTRA)/14; i++)
        {
#ifdef BASOP_NOGLOB
            Lener0 = L_mac0_o(Lener0, *v1, *v1, &Overflow);
            Ltmp0 = L_mac0_o(Ltmp0, *v2, *v2, &Overflow);
            Lcorr0 = L_mac0_o(Lcorr0, *v1++, *v2++, &Overflow);
            Lener0 = L_mac0_sat(Lener0, *v1, *v1);
            Ltmp0 = L_mac0_sat(Ltmp0, *v2, *v2);
            Lcorr0 = L_mac0_sat(Lcorr0, *v1++, *v2++);
#else
            Lener0 = L_mac0(Lener0, *v1, *v1);
            Ltmp0 = L_mac0(Ltmp0, *v2, *v2);
@@ -829,7 +825,7 @@ static Word16 Pit_track_fx( /* o : Pitch */
    exp2 = norm_l(Ltmp);
    /* Multiply the Most Significant 16 bits */
#ifdef BASOP_NOGLOB
    Ltmp = L_mult0(round_fx_o(L_shl_o(Lener, exp1, &Overflow), &Overflow), round_fx_o(L_shl_o(Ltmp, exp2, &Overflow), &Overflow));
    Ltmp = L_mult0(round_fx_sat(L_shl_sat(Lener, exp1)), round_fx_sat(L_shl_sat(Ltmp, exp2)));
#else
    Ltmp = L_mult0(round_fx(L_shl(Lener, exp1)), round_fx(L_shl(Ltmp, exp2)));
#endif
@@ -850,8 +846,11 @@ static Word16 Pit_track_fx( /* o : Pitch */
    exp1 = sub(exp1, exp2);
    Ltmp = Mpy_32_16_1(Lcorr, round_fx(Ltmp));
    /* Go to Q31 */
#ifdef BASOP_NOGLOB
    Ltmp = L_shl_sat(Ltmp, exp1);
#else
    Ltmp = L_shl(Ltmp, exp1);

#endif
    /* cn = normalized correlation of pitch/2 */
    if (GT_32(Ltmp, 2040109466L)) /* 0.95f in Q31 */
    {
+36 −0
Original line number Diff line number Diff line
@@ -737,7 +737,11 @@ static void search_del(
    L_acc = L_mult(ptr_sig_in[0], ptr_sig_in[0]);
    FOR(i = 1; i < L_SUBFR; i++)
    {
#ifdef BASOP_NOGLOB
        L_acc = L_mac_sat(L_acc, ptr_sig_in[i], ptr_sig_in[i]);
#else
        L_acc = L_mac(L_acc, ptr_sig_in[i], ptr_sig_in[i]);
#endif
    }
    IF (L_acc == 0)
    {
@@ -774,12 +778,20 @@ static void search_del(
        L_acc = L_mult(ptr_sig_in[0], ptr_sig_past[0]);
        FOR (n = 1; n < L_SUBFR; n++)
        {
#ifdef BASOP_NOGLOB
            L_acc = L_mac_sat(L_acc, ptr_sig_in[n], ptr_sig_past[n]);
#else
            L_acc = L_mac(L_acc, ptr_sig_in[n], ptr_sig_past[n]);
#endif
        }


        L_acc = L_max(L_acc, 0);
#ifdef BASOP_NOGLOB
        L_temp = L_sub_sat(L_acc, L_num_int);
#else
        L_temp = L_sub(L_acc, L_num_int);
#endif
        if (L_temp > 0L)
        {
            i_max = (Word16) i;
@@ -813,7 +825,11 @@ static void search_del(
    {
        temp = *ptr_sig_past++;
        move16();
#ifdef BASOP_NOGLOB
        L_acc = L_mac_sat(L_acc, temp, temp);
#else
        L_acc = L_mac(L_acc, temp, temp);
#endif
    }
    IF (L_acc == 0L)
    {
@@ -871,18 +887,30 @@ static void search_del(
        L_acc = L_mult(ptr_y_up[1], ptr_y_up[1]);
        FOR (n = 2; n < L_SUBFR; n++)
        {
#ifdef BASOP_NOGLOB
            L_acc = L_mac_sat(L_acc, ptr_y_up[n], ptr_y_up[n]);
#else
            L_acc = L_mac(L_acc, ptr_y_up[n], ptr_y_up[n]);
#endif
        }
        L_temp0 = L_acc; /* sets to 'L_acc' in 1 clock (saved for den1) */
		move32();

        /* den0 */
#ifdef BASOP_NOGLOB
        L_acc = L_mac_sat(L_acc, ptr_y_up[0], ptr_y_up[0]);
#else
        L_acc = L_mac(L_acc, ptr_y_up[0], ptr_y_up[0]);
#endif
        *ptr_L_den0 = L_acc;
        move32();

        /* den1 */
#ifdef BASOP_NOGLOB
        L_acc = L_mac_sat(L_temp0, ptr_y_up[L_SUBFR], ptr_y_up[L_SUBFR]);
#else
        L_acc = L_mac(L_temp0, ptr_y_up[L_SUBFR], ptr_y_up[L_SUBFR]);
#endif
        *ptr_L_den1 = L_acc;
        move32();

@@ -973,7 +1001,11 @@ static void search_del(
        L_acc = L_mult(ptr_sig_in[0], ptr_y_up[0]);
        FOR (n = 1; n < L_SUBFR; n++)
        {
#ifdef BASOP_NOGLOB
            L_acc = L_mac_sat(L_acc, ptr_sig_in[n], ptr_y_up[n]);
#else
            L_acc = L_mac(L_acc, ptr_sig_in[n], ptr_y_up[n]);
#endif
        }
        L_acc = L_shr(L_acc, sh_num); /* sh_num > 0 */
        L_acc = L_max(0, L_acc);
@@ -1006,7 +1038,11 @@ static void search_del(
        L_acc = L_mult(ptr_sig_in[0], ptr_y_up[0]);
        FOR (n = 1; n < L_SUBFR; n++)
        {
#ifdef BASOP_NOGLOB
            L_acc = L_mac_sat(L_acc, ptr_sig_in[n], ptr_y_up[n]);
#else
            L_acc = L_mac(L_acc, ptr_sig_in[n], ptr_y_up[n]);
#endif
        }
        L_acc = L_shr(L_acc, sh_num); /* sh_num > 0 */
        L_acc = L_max(0, L_acc);