Commit 55146b97 authored by vaclav's avatar vaclav
Browse files

REMOVE_EVS_DUPLICATES in acelp_core_dec_fx()

parent 2b068b61
Loading
Loading
Loading
Loading
Loading
+51 −14
Original line number Diff line number Diff line
@@ -253,6 +253,21 @@ void Inac_switch_ematch_ivas_fx(
            exp = sub( exp, 14 );
            IF( LT_16( i, 2 ) )
            {
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( element_mode, EVS_MONO ) )
                {
                    FOR( j = 0; j < 8; j++ )
                    {
                        L_tmp = L_mult( *pt_exc, ftmp );
                        L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/
                        *pt_exc = round_fx_sat( L_tmp );            /*Q_exc - 1*/
                        move16();
                        pt_exc++;
                    }
                }
                ELSE
#endif
                {
                    FOR( j = 0; j < 8; j++ )
                    {
                        L_tmp = L_mult0( *pt_exc, ftmp );
@@ -262,7 +277,23 @@ void Inac_switch_ematch_ivas_fx(
                        pt_exc++;
                    }
                }
            }
            ELSE
            {
#ifdef REMOVE_EVS_DUPLICATES
                IF( EQ_16( element_mode, EVS_MONO ) )
                {
                    FOR( j = 0; j < 16; j++ )
                    {
                        L_tmp = L_mult( *pt_exc, ftmp );
                        L_tmp = L_shl_sat( L_tmp, add( exp, 15 ) ); /* Q(Q_exc) -> Q(15+Q_exc)*/
                        *pt_exc = round_fx_sat( L_tmp );            /*Q_exc - 1*/
                        move16();
                        pt_exc++;
                    }
                }
                ELSE
#endif
                {
                    FOR( j = 0; j < 16; j++ )
                    {
@@ -274,10 +305,16 @@ void Inac_switch_ematch_ivas_fx(
                    }
                }
            }
        }

        /* Going back to time */
#ifdef REMOVE_EVS_DUPLICATES
        IF( GT_16( element_mode, EVS_MONO ) )
#endif
        {
            Scale_sig( dct_exc_tmp, 240, 1 ); // Q_exc
            Scale_sig( exc2, 240, 1 );        // Q_exc
        }
        edct_16fx( dct_exc_tmp, exc2, L_frame, 5, element_mode );
    }

+37 −18
Original line number Diff line number Diff line
@@ -1412,6 +1412,21 @@ void highband_exc_dct_in_ivas_fx(
        }
    }
#endif

#ifdef REMOVE_EVS_DUPLICATES
    IF( EQ_16( element_mode, EVS_MONO ) )
    {
        Comp_and_apply_gain_fx( exc_diffQ, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 0, Qexc_diffQ, *Q_exc );

        IF( exc_wo_nf != NULL )
        {
            Comp_and_apply_gain_fx( exc_wo_nf, Ener_per_bd_iQ, Ener_per_bd_yQ, last_bin, 1, Qexc_diffQ, *Q_exc );
            Vr_add( exc_dct_in, exc_wo_nf, exc_wo_nf, L_frame );
        }
    }
    ELSE
    {
#endif
        Word16 Q_tmp = *Q_exc;
        move16();
        Word16 Q_old = *Q_exc;
@@ -1438,6 +1453,10 @@ void highband_exc_dct_in_ivas_fx(
        {
            Scale_sig( exc_dct_in, L_frame, sub( *Q_exc, Q_old ) );
        }
#ifdef REMOVE_EVS_DUPLICATES
    }
#endif

    /*--------------------------------------------------------------------------------------*
     * add the correction layer to the LF bins,
     * and add the quantized pulses or the noise for the higher part of the spectrum
+2 −0
Original line number Diff line number Diff line
@@ -154,4 +154,6 @@
#define FIX_ISSUE_1245                          /* Ittiam: Fix for issue 1245: Basop Encoder: Audible noise for silent Stereo input DTX on @24.4 kbps, @32 kbps*/
#define FIX_MINOR_SVD_WMOPS_MR1010X             /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */
#define SVD_WMOPS_OPT                           /* Ittiam : SVD related optimizations */

#define REMOVE_EVS_DUPLICATES                   /* remove core-coder duplicated functions */
#endif
+3 −0
Original line number Diff line number Diff line
@@ -8242,6 +8242,9 @@ void FEC_scale_syn_ivas_fx(
    Word16 *mem_syn,               /* o:   initial synthesis filter states         */
    Word16 Q_exc,
    Word16 Q_syn,
#ifdef REMOVE_EVS_DUPLICATES
    const Word16 element_mode, /* i  : element mode                            */
#endif
    const Word16 avoid_lpc_burst_on_recovery, /* i  : if true the excitation energy is limited if LP has big gain */
    const Word16 force_scaling                /* i: force scaling                             */
);
+10 −0
Original line number Diff line number Diff line
@@ -641,6 +641,9 @@ void FEC_scale_syn_ivas_fx(
    Word16 *mem_syn,               /* o:   initial synthesis filter states         Q_syn*/
    Word16 Q_exc,
    Word16 Q_syn,
#ifdef REMOVE_EVS_DUPLICATES
    const Word16 element_mode, /* i  : element mode                            */
#endif
    const Word16 avoid_lpc_burst_on_recovery, /* i  : if true the excitation energy is limited if LP has big gain */
    const Word16 force_scaling                /* i: force scaling                             */
)
@@ -735,8 +738,15 @@ void FEC_scale_syn_ivas_fx(
    /*-----------------------------------------------------------------*
     * Find the energy/gain at the end of the frame
     *-----------------------------------------------------------------*/

    tmp = sub( 3, getScaleFactor16( synth, L_frame ) );

#ifdef REMOVE_EVS_DUPLICATES
    test();
    IF( tmp > 0 && GT_16( element_mode, EVS_MONO ) )
#else
    IF( tmp > 0 )
#endif
    {
        Word16 synth_tmp[L_FRAME16k];
        Copy_Scale_sig( synth, synth_tmp, L_frame, -tmp ); // Q_synth - tmp
Loading