Commit 51b2b453 authored by multrus's avatar multrus
Browse files

add compilation switch

parent f334c982
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -104,6 +104,9 @@

#define FIX_1962_FORMAT_CONV_SPECTRAL_DIFF                   /* FhG: Improved precision of targetEnergy in ivas_ls_setup_conversion_process_mdct_fx() */
#define FIX_2003_CON_TCX_OVERFLOW                            /* FhG: Use a dynamic scaling factor for the synth buffer at the output of con_tcx_ivas_fx() */
#define OPT_TCXLTP_FILTER_LOOP                               /* FhG: optimize loop in tcx_ltp_synth_filter */


/* #################### Start BASOP porting switches ############################ */

#define NONBE_1244_FIX_SWB_BWE_MEMORY                   /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */
+46 −0
Original line number Diff line number Diff line
@@ -491,6 +491,8 @@ static void tcx_ltp_synth_filter(
            if ( fade < 0 )
                step = negate( step );
        }

#ifdef OPT_TCXLTP_FILTER_LOOP
        IF( zir != NULL )
        {
            IF( fade != 0 )
@@ -638,6 +640,50 @@ static void tcx_ltp_synth_filter(
                }
            }
        }
#else
        FOR( j = 0; j < length; j++ )
        {
            s = L_deposit_l( 0 );
            s2 = L_deposit_l( 0 );
            k = 0;
            move16();
            FOR( i = 0; i < L; i++ )
            {
                s = L_mac_sat( L_mac_sat( s, w0[k], x0[i] ), w1[k], x1[-i] );   /* Qx */
                s2 = L_mac_sat( L_mac_sat( s2, v0[k], y0[i] ), v1[k], y1[-i] ); /* Qx */
                k = k + pitch_res;
            }

            /* s2 *= ALPHA;
               normal:      synth_ltp[j] = synth[j] - gain * s2 + gain * s;
               zir:         synth_ltp[j] = synth[j] - gain * s2 + gain * s - zir[j];
               fade-in/out: synth_ltp[j] = synth[j] - alpha * gain * s2 + alpha * gain * s; */
            i = sub_sat( round_fx_sat( s ), mult_r_sat( round_fx_sat( s2 ), ALPHA ) ); /* Qx */
            k = mult_r( gain, i );                                                     /* Qx */
            if ( fade != 0 )
                k = mult_r( k, alpha ); /* Qx */
            k = add_sat( synth[j], k ); /* Qx */
            if ( zir != NULL )
            {
                k = sub_sat( k, zir[j] ); /* Qx */
            }

            synth_ltp[j] = k; /* Qx */
            move16();

            BASOP_SATURATE_WARNING_OFF_EVS;
            if ( fade != 0 )
            {
                alpha = add_sat( alpha, step );
            }
            BASOP_SATURATE_WARNING_ON_EVS;

            x0++;
            x1++;
            y0++;
            y1++;
        }
#endif
    }
    ELSE
    {