Commit ca636735 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

port NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS

parent 4bec0fbb
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@
#define FIX_1001_ARI_HM_OVERFLOW                        /* FhG: (no changes needed in BASOP) fix for undef behaviour in in the harmonic TCX model arithmetic coder */
#define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE                  /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */
#define NONBE_FIX_1004_USAN_DTX_MASA_NO_DIRS            /* Nokia: fix USAN error caused by non-setting of correctly the number of MASA directions in DTX */
#define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS            /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */

/* #################### End BASOP porting switches ############################ */

+19 −0
Original line number Diff line number Diff line
@@ -51,6 +51,13 @@
#include "rom_dec.h"
#include "ivas_prot_fx.h"

#ifdef NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS
/*-----------------------------------------------------------------------*
 * Local constants
 *-----------------------------------------------------------------------*/

#define SQRT_EPSILON_FX 68 /* Q31 square root of EPSILON */
#endif

/*-------------------------------------------------------------------*
 * ivas_dirac_dec_output_synthesis_cov_open()
@@ -930,9 +937,21 @@ Word16 computeMixingMatrices_fx(
        }
    }

#ifdef NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS
    limit_fx = Mpy_32_32( limit_fx, reg_Sx_fx );
    limit_e = add( limit_e, reg_Sx_e );
    IF( BASOP_Util_Cmp_Mant32Exp( limit_fx, limit_e, SQRT_EPSILON_FX /* Q31 */, 0 ) < 0 )
    {
        limit_fx = SQRT_EPSILON_FX;
        move32();
        limit_e = 0;
        move16();
    }
#else
    L_tmp = Mpy_32_32( limit_fx, reg_Sx_fx );
    limit_e = add( limit_e, reg_Sx_e );
    limit_fx = L_add( L_tmp, EPSILON_FX );
#endif

    FOR( i = 0; i < lengthCx; ++i )
    {