Commit 8a69c3ac authored by norvell's avatar norvell
Browse files

Add fix FIX_1416_MDCT_CLASSIFIER for TCX/HQ classifier

parent d74de338
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@
#define BASOP_NOGLOB_DECLARE_LOCAL
#endif

#define FIX_1416_MDCT_CLASSIFIER                /* Eri: Fix for precision in mdct_classifier_ivas_fx, aligning HQ/TCX decision with float */

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
//#define OPT_STEREO_32KBPS_V1                    /* Optimization made in stereo decoding path for 32kbps decoding */
#endif
+9 −0
Original line number Diff line number Diff line
@@ -878,8 +878,13 @@ Word16 mdct_classifier_ivas_fx(

    FOR( i = 0; i < 32; i++ )
    {
#ifdef FIX_1416_MDCT_CLASSIFIER
        avrg_l = L_add( avrg_l, X[20 + i], 5 );
        avrg_h = L_add( avrg_h, X[96 + i], 5 );
#else
        avrg_l = L_add( avrg_l, L_shr( X[20 + i], 5 ) );
        avrg_h = L_add( avrg_h, L_shr( X[96 + i], 5 ) );
#endif
        IF( GT_32( X[20 + i], peak_l ) )
        {
            peak_l = L_add( X[20 + i], 0 );
@@ -889,6 +894,10 @@ Word16 mdct_classifier_ivas_fx(
            peak_h = L_add( X[96 + i], 0 );
        }
    }
#ifdef FIX_1416_MDCT_CLASSIFIER
    avrg_l = L_shr( X[20 + i], 5 );
    avrg_h = L_shr( X[96 + i], 5 );
#endif

    /* Compute: d_acc - 12*(np -1). */
    acc = L_deposit_l( d_acc );