Commit 928bda0f authored by Fabian Bauer's avatar Fabian Bauer
Browse files

added macro for zero-mantissa-fix and activated it

parent c20dfd23
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@

#define FIX_1978_SAT_MISSING_IN_GAIN_ENC                     /* VA:  Fix add saturation missing that lead to a crash in P800-10 */
#define FIX_1981_MAXIMUM_EXP_FX                              /* FhG: Fix bug in function to find maximum value in vector */
#define FIX_1981_MAXIMUM_EXP_FX_2                            /* FhG: Fix bug in function to find maximum value in vector:zero-mantissa */

#define FIX_1979_SAT_MISSING_IN_LSF_ENC                      /* VA: Proposal to fix 1979, saturation in lsf_enc, NOkia to review */
#define FIX_1946_CRASH_JBM_PROCESSING                        /* FhG: Increased guard bits of DFT_fx */
+17 −0
Original line number Diff line number Diff line
@@ -2169,6 +2169,22 @@ Word16 maximum_exp_fx(

    FOR( j = 1; j < lvec_fx; j++ )
    {
#ifdef FIX_1981_MAXIMUM_EXP_FX_2
        Word16 scale = sub( exp_vec[j], exp_vec[ind] );

        test();
        if ( vec_fx[j] == 0 || vec_fx[ind] == 0 )
        {
            scale = 0;
            move16();
        }

        if ( L_mac0_sat( L_shl_sat( L_deposit_l( vec_fx[j] ), scale ), vec_fx[ind], -0x0001 ) > 0 )
        {
            ind = j;
            move16();
        }
#else
        Word16 scale = sub( exp_vec[j], exp_vec[ind] );

        if ( L_mac0_sat( L_shl_sat( L_deposit_l( vec_fx[j] ), scale ), vec_fx[ind], -0x0001 ) > 0 )
@@ -2176,6 +2192,7 @@ Word16 maximum_exp_fx(
            ind = j;
            move16();
        }
#endif
    }

    return ind;