Commit 21ae1724 authored by vaillancour's avatar vaillancour
Browse files

adding basop sat for signal with extreme saturation

parent 9ee3e525
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -935,7 +935,11 @@ void core_switching_OLA_fx(
    temp_len = sub(L,tmp);
    FOR( i=0; i< temp_len; i++ )
    {
#ifdef BASOP_NOGLOB
        *pt = add_sat( add_sat( *pt, *pt2++ ), *pt3++ );
#else
        *pt = add( add( *pt, *pt2++ ), *pt3++ );
#endif
        move16();
        pt++;
    }
+7 −1
Original line number Diff line number Diff line
@@ -594,9 +594,15 @@ void FEC_scale_syn_fx(
            FOR( i=0; i<L_frame; i++ )
            {
                gain1 = mac_r(L_tmp, gain1, AGC_FX); /* in Q14 */
#ifdef BASOP_NOGLOB
                exc[i] = mac_r_sat( L_mult_sat( exc[i], gain1 ), exc[i], gain1 );
                move16();
                exc2[i] = mac_r_sat(L_mult_sat(exc2[i], gain1), exc2[i], gain1);
#else
                exc[i] = mac_r( L_mult( exc[i], gain1 ), exc[i], gain1 );
                move16();
                exc2[i] = mac_r(L_mult(exc2[i], gain1), exc2[i], gain1);
#endif
                move16();
            }

+5 −1
Original line number Diff line number Diff line
@@ -327,7 +327,11 @@ ivas_error acelp_core_switch_dec_fx(
            pt2 = &hb_synth_tmp[tmp];
            FOR( i=0; i<gapsize; i++ )
            {
#ifdef BASOP_NOGLOB
                *pt1++ = round_fx_sat( L_shl_sat( L_mult_sat( ( *pt2++ ), gain ), 2 ) );
#else
                *pt1++ = round_fx( L_shl( L_mult( ( *pt2++ ), gain ), 2 ) );
#endif
            }
        }
        ELSE
+5 −1
Original line number Diff line number Diff line
@@ -475,7 +475,11 @@ void decoder_acelp(
                    Ltmp = L_shl( Ltmp, 1 ); /* saturation can occur here */
#endif 
                    BASOP_SATURATE_WARNING_ON_EVS
#ifdef BASOP_NOGLOB
                    exc[i + i_subfr] = round_fx_sat( Ltmp );
#else
                    exc[i + i_subfr] = round_fx( Ltmp );
#endif
                }
                tmp2 = L_SUBFR;
                move16();
+6 −1
Original line number Diff line number Diff line
@@ -81,8 +81,13 @@ void transf_cdbk_dec_fx(
        }

        L_tmp = Mult_32_16(gain_code,gain16);   /* Q16 * Q12 - 15 -> Q13*/
#ifdef BASOP_NOGLOB
        L_tmp = L_shl_sat( L_tmp, 5 );      /* Q13 -> Q18*/
        *gain_preQ = round_fx_sat(L_tmp);           /* Q2*/
#else
        L_tmp = L_shl( L_tmp, 5 );      /* Q13 -> Q18*/
        *gain_preQ = round_fx(L_tmp);           /* Q2*/
#endif
    }
    ELSE
    {
Loading