Commit 6b38035f authored by vaillancour's avatar vaillancour
Browse files

Fixes some IO decoder conditions

parent 1ed0143a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -30,9 +30,6 @@ Word16 frame_ener_fx(
    Word16 i;
    const Word16 *pt_synth;
    Word32 Ltmp;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif

    exp_enrq = 0;
    move16();
@@ -72,11 +69,15 @@ Word16 frame_ener_fx(
        {
            pos = sub(L_frame, L_frame2);
        }
#ifdef BASOP_NOGLOB
        Ltmp = L_mult_sat(synth[pos], synth[pos]);
#else
        Ltmp = L_mult(synth[pos], synth[pos]);
#endif
        FOR (i = 1; i < L_frame2; i++)
        {
#ifdef BASOP_NOGLOB
            Ltmp = L_mac_o(Ltmp, synth[pos+i], synth[pos+i], &Overflow);
            Ltmp = L_mac_sat(Ltmp, synth[pos+i], synth[pos+i]);
#else /* BASOP_NOGLOB */
            Ltmp = L_mac(Ltmp, synth[pos+i], synth[pos+i]);
#endif
+4 −1
Original line number Diff line number Diff line
@@ -171,8 +171,11 @@ Word16 WB_BWE_gain_pred_fx(
    L_tmp = L_deposit_h(tmp);
    L_tmp = Isqrt_lc(L_tmp, &exp);

#ifdef BASOP_NOGLOB
    WB_fenv[0] = round_fx_sat(L_shl_sat(L_tmp, sub(exp, 12))); /* Q3 */
#else
    WB_fenv[0] = round_fx(L_shl(L_tmp, sub(exp, 12))); /* Q3 */

#endif
    test();
    test();
    IF(NE_16(coder_type,AUDIO)&&NE_16(coder_type,UNVOICED)&&ener_var_flag==0)
+4 −0
Original line number Diff line number Diff line
@@ -228,7 +228,11 @@ void preecho_sb_fx(
        }

        fxptr2--;
#ifdef BASOP_NOGLOB
        *memfilt_lb_fx = shr_sat(*fxptr2, q_sig16);
#else
        *memfilt_lb_fx = shr(*fxptr2, q_sig16);
#endif
        move16(); /* *memfilt_lb_fx in q0  */

        /* energy of low bands 8 present and 1 future sub-frames */
+8 −10
Original line number Diff line number Diff line
@@ -85,9 +85,6 @@ void FEC_clas_estim_fx(
    Word16 pos_limit;
    Word16 codec_mode, narrowBand, tcxonly,preemph_fac;
    Word16 memmax;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif

    nb_subfr = shr(L_frame,6);
    memmax = 0;
@@ -258,7 +255,7 @@ void FEC_clas_estim_fx(

            Corre(&pt1[pos], &pt1[pos-T0], T0, &cor_max[0]);
#ifdef BASOP_NOGLOB
            T0 = mult_ro(add_o(pitch[2], pitch[3], &Overflow), 256, &Overflow);
            T0 = mult_r_sat(add_sat(pitch[2], pitch[3]), 256);
#else
            T0 = mult_r(add(pitch[2], pitch[3]), 256);
#endif
@@ -307,7 +304,7 @@ void FEC_clas_estim_fx(
            IF (EQ_16(codec_mode , MODE1)||!(NE_16(LTP_Gain,-32768/*-1.f Q15*/)&&EQ_16(mode,CLASSIFIER_TCX)))
            {
#ifdef BASOP_NOGLOB
                pc = shr(abs_s(sub(add_o(pitch[3], sub(pitch[2], pitch[1]), &Overflow), pitch[0])), 6);
                pc = shr(abs_s(sub(add_sat(pitch[3], sub(pitch[2], pitch[1])), pitch[0])), 6);
#else
                pc = shr(abs_s(sub(add(pitch[3], sub(pitch[2], pitch[1])), pitch[0])), 6);
#endif
@@ -332,11 +329,12 @@ void FEC_clas_estim_fx(
                pt1++;
                pt2++;
#ifdef BASOP_NOGLOB
                Ltmp = L_mac0_o(Ltmp, *pt1, *pt1, &Overflow);
                Ltmp = L_mac0_sat(Ltmp, *pt1, *pt1);
                Ltmp1 = L_mac0_sat(Ltmp1, *pt1, *pt2);
#else
                Ltmp  = L_mac0(Ltmp,  *pt1, *pt1);
#endif
                Ltmp1 = L_mac0(Ltmp1, *pt1, *pt2);
#endif
            }
            tilt = 0;
            move16();
@@ -361,7 +359,7 @@ void FEC_clas_estim_fx(

                tilt = div_s(tmp_y, tmp_x);
#ifdef BASOP_NOGLOB
                tilt = shl_o(tilt, sub(exp1, exp2), &Overflow); /* saturate to 1.0 */
                tilt = shl_sat(tilt, sub(exp1, exp2)); /* saturate to 1.0 */
#else
                tilt = shl(tilt, sub(exp1, exp2)); /* saturate to 1.0 */
#endif
@@ -388,7 +386,7 @@ void FEC_clas_estim_fx(

            BASOP_SATURATE_WARNING_OFF_EVS
#ifdef BASOP_NOGLOB
            tmp16 = sub_o(LTP_Gain, -32768/*-1.f Q15*/, &Overflow);
            tmp16 = sub_sat(LTP_Gain, -32768/*-1.f Q15*/);
#else
            tmp16 = sub(LTP_Gain , -32768/*-1.f Q15*/);
#endif
@@ -414,7 +412,7 @@ void FEC_clas_estim_fx(
            Ltmp  = L_mac(Ltmp, enern, UNS6);
            BASOP_SATURATE_WARNING_OFF_EVS
#ifdef BASOP_NOGLOB
            fmerit1 = round_fx_o(L_shl_o(Ltmp, 15 - 8, &Overflow), &Overflow);   /*Q15 can saturate to 1.0 */
            fmerit1 = round_fx_sat(L_shl_sat(Ltmp, 15 - 8));   /*Q15 can saturate to 1.0 */
#else
            fmerit1 = round_fx(L_shl(Ltmp, 15-8));   /*Q15 can saturate to 1.0 */
#endif
+4 −0
Original line number Diff line number Diff line
@@ -275,7 +275,11 @@ void FEC_scale_syn_fx(
                        ener_max = L_max(ener_max, L_enr_old);

                        /*if( enr_q > scaling * ener_max ){enr_q = scaling * ener_max;}*/
#ifdef BASOP_NOGLOB
                        L_enr_q = L_min(L_enr_q, L_shl_sat(Mult_32_16(ener_max, scaling),1));   /* scaling in Q14*/
#else
                        L_enr_q = L_min(L_enr_q, L_shl(Mult_32_16(ener_max, scaling),1));   /* scaling in Q14*/
#endif
                    }
                }
                /*gain2 = (float)sqrt( enr_q / enr2 );*/
Loading