Commit 837ec434 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

fixed macro name, replaced some overflow ops

parent ce46dce8
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@
#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */
#define CONF_DISTATT                                    /* Eri: Make distance attenuation configurable */

#define ISSUE_1866_replace_overflow_libcdec
#define ISSUE_1866_replace_overflow_libdec

#define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR          /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/
#define NONBE_FIX_MC_LFE_LPF                                  /* Dlb: Adding the LFE LPF filter back for MC content. */
+6 −0
Original line number Diff line number Diff line
@@ -872,10 +872,12 @@ static void decod_gen_voic_core_switch_fx(
    Word16 *pt1;
    GSC_DEC_HANDLE hGSCDec;
    hGSCDec = st_fx->hGSCDec;
#ifndef ISSUE_1866_replace_overflow_libdec
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move16();
#endif
#endif


    /*----------------------------------------------------------------------*
@@ -966,7 +968,11 @@ static void decod_gen_voic_core_switch_fx(
    IF( st_fx->prev_bfi )
    {
        /*gain_code = min(gain_code, 0.5f*gain_code+0.5f*st->lp_gainc);*/
#ifdef ISSUE_1866_replace_overflow_libdec
        gain_code16 = s_min( gain_code16, mac_r( L_mult( 16384, gain_code16 ), shl_sat( 16384 >> 3, st_fx->Q_exc ), st_fx->lp_gainc_fx ) ); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */ //??sat
#else
        gain_code16 = s_min( gain_code16, mac_r( L_mult( 16384, gain_code16 ), shl_o( 16384 >> 3, st_fx->Q_exc, &Overflow ), st_fx->lp_gainc_fx ) ); /* st_fx->lp_gainc_fx in Q3 >>3 to bring it to Q0 as gain_code16 */
#endif
    }

    FOR( i = 0; i < L_SUBFR; i++ )
+6 −0
Original line number Diff line number Diff line
@@ -74,9 +74,11 @@ void CNG_dec_fx(
    Word16 enr_new, Aq_tmp[M + 1];
    Word16 LSF_Q_prediction; /* o  : LSF prediction mode - just temporary variable in CNG                */
    TD_CNG_DEC_HANDLE hTdCngDec;
#ifndef ISSUE_1866_replace_overflow_libdec
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif
    hTdCngDec = st_fx->hTdCngDec;

@@ -522,7 +524,11 @@ void CNG_dec_fx(
            FOR( i = 0; i < M; i++ )
            {
                dev = abs_s( sub( lsp_tmp[i], lsp_new[i] ) ); /*Q15*/
#ifdef ISSUE_1866_replace_overflow_libdec
                dist = add_sat( dist, dev );                  /*Q15*/
#else
                dist = add_o( dist, dev, &Overflow );         /*Q15*/
#endif
                if ( GT_16( dev, max_dev ) )
                {
                    max_dev = dev;
+48 −1
Original line number Diff line number Diff line
@@ -181,9 +181,11 @@ void bw_switching_pre_proc_fx(
    Word16 i;
    Word16 syn_dct_fx[L_FRAME];
    Word32 L_tmp;
#ifndef ISSUE_1866_replace_overflow_libdec
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
    Flag Overflow = 0;
    move32();
#endif
#endif

    IF( st_fx->element_mode > EVS_MONO )
@@ -198,7 +200,11 @@ void bw_switching_pre_proc_fx(
         * Calculate tilt of the ACELP core synthesis
         *----------------------------------------------------------------------*/

#ifdef ISSUE_1866_replace_overflow_libdec
        st_fx->tilt_wb_fx = round_fx_sat( L_shl_sat( calc_tilt_bwe_fx( old_syn_12k8_16k_fx, -1, st_fx->L_frame ), 3 ) ); /* Q11 */  //??sat //??sat
#else
        st_fx->tilt_wb_fx = round_fx_o( L_shl_o( calc_tilt_bwe_fx( old_syn_12k8_16k_fx, -1, st_fx->L_frame ), 3, &Overflow ), &Overflow ); /* Q11 */
#endif
        move16();
        /*-------------------------------------------------------------------------------*
         * Calculate frequency energy of 0~3.2kHz and 3.2~6.4kHz the ACELP core synthesis
@@ -209,7 +215,11 @@ void bw_switching_pre_proc_fx(
        L_tmp = L_deposit_l( 0 );
        FOR( i = 0; i < L_FRAME / 2; i++ )
        {
#ifdef ISSUE_1866_replace_overflow_libdec
            L_tmp = L_mac0_sat( L_tmp, syn_dct_fx[i], syn_dct_fx[i] ); /* (2 * Q_syn2) */  //??sat
#else
            L_tmp = L_mac0_o( L_tmp, syn_dct_fx[i], syn_dct_fx[i], &Overflow ); /* (2 * Q_syn2) */
#endif
        }
        L_tmp = L_shr( L_tmp, 7 );                                              /* 2 * Q_syn2 */
        st_fx->enerLL_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */
@@ -217,7 +227,11 @@ void bw_switching_pre_proc_fx(
        L_tmp = L_deposit_l( 0 );
        FOR( ; i < L_FRAME; i++ )
        {
#ifdef ISSUE_1866_replace_overflow_libdec
            L_tmp = L_mac0_sat( L_tmp, syn_dct_fx[i], syn_dct_fx[i] ); //??sat
#else
            L_tmp = L_mac0_o( L_tmp, syn_dct_fx[i], syn_dct_fx[i], &Overflow );
#endif
        }
        L_tmp = L_shr( L_tmp, 7 );                                              /* 2 * Q_syn2 */
        st_fx->enerLH_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */
@@ -230,7 +244,11 @@ void bw_switching_pre_proc_fx(
            L_tmp = L_deposit_l( 0 );
            FOR( i = 0; i < 32; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); /* 2 * Q_syn2 */   //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */
#endif
            }
            L_tmp = L_shr( L_tmp, 5 );                                              /* 2 * Q_syn2 */
            st_fx->enerLL_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */
@@ -238,7 +256,11 @@ void bw_switching_pre_proc_fx(
            L_tmp = L_deposit_l( 0 );
            FOR( ; i < 64; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); /* 2 * Q_syn2 */   //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */
#endif
            }
            L_tmp = L_shr( L_tmp, 5 );                                              /* 2 * Q_syn2 */
            st_fx->enerLH_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */
@@ -249,7 +271,11 @@ void bw_switching_pre_proc_fx(
            L_tmp = L_deposit_l( 0 );
            FOR( i = 0; i < L_FRAME / 2; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); /* 2 * Q_syn2 */   //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */
#endif
            }
            L_tmp = L_shr( L_tmp, 7 );                                              /* 2 * Q_syn2 */
            st_fx->enerLL_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */
@@ -257,7 +283,11 @@ void bw_switching_pre_proc_fx(
            L_tmp = L_deposit_l( 0 );
            FOR( ; i < L_FRAME; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i] ); /* 2 * Q_syn2 */   //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st_fx->t_audio_q_fx[i], st_fx->t_audio_q_fx[i], &Overflow ); /* 2 * Q_syn2 */
#endif
            }
            L_tmp = L_shr( L_tmp, 7 );                                              /* 2 * Q_syn2 */
            st_fx->enerLH_fx = Calc_freq_ener_fx( L_tmp, shl( st_fx->Q_syn2, 1 ) ); /* Q_syn2 */
@@ -2980,9 +3010,10 @@ void ivas_bw_switching_pre_proc_fx(
    Word16 i;
    Word32 syn_dct_fx[L_FRAME];


    #ifndef ISSUE_1866_replace_overflow_libdec
    Flag Overflow = 0;
    move32();
    #endif

    IF( st->element_mode > EVS_MONO )
    {
@@ -3065,7 +3096,11 @@ void ivas_bw_switching_pre_proc_fx(
            move32();
            FOR( i = 0; i < 32; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i] );  //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i], &Overflow );
#endif
            }
            tmp = L_shr( L_tmp, 5 ); // divide by 32
            tmp = getSqrtWord32( tmp );
@@ -3078,7 +3113,11 @@ void ivas_bw_switching_pre_proc_fx(
            move32();
            FOR( ; i < 64; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i] );  //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i], &Overflow );
#endif
            }

            tmp = L_shr( L_tmp, 5 ); // divide by 32
@@ -3094,7 +3133,11 @@ void ivas_bw_switching_pre_proc_fx(
            move32();
            FOR( i = 0; i < L_FRAME / 2; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i] ); //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i], &Overflow );
#endif
            }
            tmp = L_shr( L_tmp, 5 ); // divide by 32
            tmp = getSqrtWord32( tmp );
@@ -3107,7 +3150,11 @@ void ivas_bw_switching_pre_proc_fx(
            move32();
            FOR( ; i < L_FRAME; i++ )
            {
#ifdef ISSUE_1866_replace_overflow_libdec
                L_tmp = L_mac0_sat( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i] );   //??sat
#else
                L_tmp = L_mac0_o( L_tmp, st->t_audio_q_fx[i], st->t_audio_q_fx[i], &Overflow );
#endif
            }
            tmp = L_shr( L_tmp, 5 ); // divide by 32
            tmp = getSqrtWord32( tmp );