Commit 3a09b51c authored by vaillancour's avatar vaillancour
Browse files

Fixes for stv48n1_dtx_bw_59_1280_evs_amrwb_48kHz.b10.COD

parent 4947addb
Loading
Loading
Loading
Loading
+16 −18
Original line number Diff line number Diff line
@@ -81,9 +81,7 @@ void enhancer_fx(
    Word16 gain_code_hi;
    Word16 pit_sharp, tmp16;
    Word16 excp[L_SUBFR], sc;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif



    pit_sharp = gain_pit;
@@ -142,7 +140,7 @@ void enhancer_fx(

    /* tmp = 0.5f * (1.0f - voice_fac) */
#ifdef BASOP_NOGLOB
    tmp = msu_ro(0x40000000, voice_fac, 16384, &Overflow); /*Q15 */ /* 1=unvoiced, 0=voiced */
    tmp = msu_r_sat(0x40000000, voice_fac, 16384); /*Q15 */ /* 1=unvoiced, 0=voiced */
#else
    tmp = msu_r(0x40000000, voice_fac, 16384); /*Q15 */ /* 1=unvoiced, 0=voiced */
#endif
@@ -196,8 +194,11 @@ void enhancer_fx(
        test();
        IF ( Opt_AMR_WB && ( EQ_32(core_brate,ACELP_8k85)||EQ_32(core_brate,ACELP_6k60)))
        {
#ifdef BASOP_NOGLOB
            pit_sharp = shl_sat(gain_pit, 1); /* saturation can occur here Q14 -> Q15 */
#else
            pit_sharp = shl(gain_pit, 1); /* saturation can occur here Q14 -> Q15 */

#endif
            /* saturation takes care of "if (pit_sharp > 1.0) { pit_sharp=1.0; }" */
            IF (GT_16(pit_sharp, 16384))
            {
@@ -300,9 +301,6 @@ Word16 E_UTIL_enhancer(
    Word32 L_tmp;
    Word16 code_exp, exc2_exp;
    Word16 max_cdk_index_uv;
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
#endif

    move16();
    code_exp = 15-9;
@@ -349,7 +347,7 @@ Word16 E_UTIL_enhancer(
    /* if gain_code is computed function of energy, noise enhancer is by-passed.*/
    BASOP_SATURATE_WARNING_OFF_EVS
#ifdef BASOP_NOGLOB
    tmp = msu_ro(1073741824l/*0.5f Q31*/, 16384/*0.5f Q15*/, voice_fac, &Overflow);             /* 1=unvoiced, 0=voiced */
    tmp = msu_r_sat(1073741824l/*0.5f Q31*/, 16384/*0.5f Q15*/, voice_fac);             /* 1=unvoiced, 0=voiced */
#else /* BASOP_NOGLOB */
    tmp = msu_r(1073741824l/*0.5f Q31*/, 16384/*0.5f Q15*/, voice_fac);             /* 1=unvoiced, 0=voiced */
#endif
@@ -384,8 +382,8 @@ Word16 E_UTIL_enhancer(
    code_exp = sub(add(31-16 + 15-11, code_exp), tmp);

#ifdef BASOP_NOGLOB
    L_tmp = L_shl_o(L_tmp, tmp, &Overflow);
    gain = round_fx_o(L_tmp, &Overflow);
    L_tmp = L_shl_sat(L_tmp, tmp);
    gain = round_fx_sat(L_tmp);
#else
    L_tmp = L_shl(L_tmp, tmp);
    gain = round_fx(L_tmp);
@@ -429,13 +427,13 @@ Word16 E_UTIL_enhancer(
        /* exc2[i]         = exc2[i]         + code[i]         - tmp*(code[i+1]+code[i-1]); */
        L_tmp = L_mult(code[i], 16384);
#ifdef BASOP_NOGLOB
        L_tmp = L_msu0_o(L_tmp,tmp,code[i-1], &Overflow);
        L_tmp = L_msu0_o(L_tmp,tmp,code[i+1], &Overflow);
        L_tmp = L_msu0_sat(L_tmp,tmp,code[i-1]);
        L_tmp = L_msu0_sat(L_tmp,tmp,code[i+1]);
        if (gain)
        {
            L_tmp = L_shl_o(L_tmp,gain, &Overflow);
            L_tmp = L_shl_sat(L_tmp,gain);
        }
        exc2[i] = msu_ro(L_tmp,-32768, exc2[i], &Overflow);
        exc2[i] = msu_r_sat(L_tmp,-32768, exc2[i]);
#else
        L_tmp = L_msu0(L_tmp,tmp,code[i-1]);
        L_tmp = L_msu0(L_tmp,tmp,code[i+1]);
@@ -450,12 +448,12 @@ Word16 E_UTIL_enhancer(
    /* exc2[L_subfr-1] = exc2[L_subfr-1] + code[L_subfr-1] - tmp*code[L_subfr-2]; */
    L_tmp = L_mult(code[i], 16384);
#ifdef BASOP_NOGLOB
    L_tmp = L_msu0_o(L_tmp,tmp,code[i-1], &Overflow);
    L_tmp = L_msu0_sat(L_tmp,tmp,code[i-1]);
    if (gain)
    {
        L_tmp = L_shl_o(L_tmp,gain, &Overflow);
        L_tmp = L_shl_sat(L_tmp,gain);
    }
    exc2[i] = msu_ro(L_tmp,-32768, exc2[i], &Overflow);
    exc2[i] = msu_r_sat(L_tmp,-32768, exc2[i]);
#else
    L_tmp = L_msu0(L_tmp,tmp,code[i-1]);
    if (gain)
+4 −1
Original line number Diff line number Diff line
@@ -196,8 +196,11 @@ static void normalize_spec_fx(
    temp = Invert16(abs_s(fy_norm_fx[idx]), &exp);
    L_temp = L_mult(temp, fac_up_fx);
    exp = sub(15, exp);
#ifdef BASOP_NOGLOB
    L_temp = L_shl_sat(L_temp, exp);
#else
    L_temp = L_shl(L_temp, exp);

#endif
    FOR (j = 0; j < L_frame; j++)
    {
        fy_norm_fx[j] = round_fx(Mult_32_16(L_temp, fy_norm_fx[j]));