diff --git a/lib_com/options.h b/lib_com/options.h index 05b2e2d39f8fabf91f729a3c417c17f60879fd8d..9d59d03d9c91fde94c7b5f669a1be1d11e0a9039 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -101,6 +101,7 @@ #define NONBE_FIX_991_PARAMBIN_BINARY_HRTF /* Nokia: issue #991: fix using of binary file HRTF in ParamBin (to activate when USE_NEW_HRTF_BINARY_FILE_FORMAT and FIX_777_COMBI_RENDER_CONFIG_FILE are on ) */ +#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 */ #define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ diff --git a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c index 14c662543eee8e5c104aa2b6d9d9d6e8e5698654..758363bfbe9f1b33d753a98d24e39c2abd800376 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c @@ -31,6 +31,8 @@ *******************************************************************************************************/ +#include "basop_util.h" +#include "enh32.h" #include #include #include @@ -50,6 +52,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() @@ -878,8 +887,18 @@ Word16 computeMixingMatrices_fx( } limit_e = add( limit_e, reg_Sx_e ); - +#ifdef NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS + limit_fx = Mpy_32_32( limit_fx, reg_Sx_fx ); + 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 /* NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS */ limit_fx = Madd_32_32( EPSILON_FX, limit_fx, reg_Sx_fx ); +#endif FOR( i = 0; i < lengthCx; ++i ) {