Commit f5535d39 authored by Manuel Jander's avatar Manuel Jander
Browse files

Merge remote-tracking branch 'origin' into basop-2493-usage-of-extract_l-with-values-out-of-range-2

parents e53b1486 f122e999
Loading
Loading
Loading
Loading
+5 −21
Original line number Diff line number Diff line
@@ -2720,19 +2720,14 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
                               const Word16 *bufY16,  /* i: 16-bit buffer quite right-aligned   */
                               Word16 bufY16_exp,     /* i: exponent of buffer bufY16           */
                               Word16 len,            /* i: buffer len to process               */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
                               Word16 *exp,           /* o: result exponent                     */
                               const Word16 is_ivas ) /* i: flag indicating IVAS to maintain EVS BE */
#else
                               Word16 *exp ) /* o: result exponent                     */
#endif
{
    Word32 L_sum;
    Word16 shift, shift1, i;


    shift = getScaleFactor32( bufX32, len ); /* current available headroom */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
    IF( EQ_16( is_ivas, 1 ) )
    {
        shift = sub( shift, sub( 15, norm_s( len ) ) ); /* reduced required headroom  */
@@ -2741,14 +2736,10 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
    {
        shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom  */
    }
#else
    shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom  */
#endif
    L_sum = 0; /* Clear accu                 */
    move32();
    FOR( i = 0; i < len; i++ )
    {
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
        IF( EQ_16( is_ivas, 1 ) )
        {
            L_sum = L_add( L_sum, Mpy_32_16_1( L_shl( bufX32[i], shift ), bufY16[i] ) );
@@ -2757,22 +2748,15 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
        {
            L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] );
        }
#else
        L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] );
#endif
    }
    shift1 = norm_l( L_sum );
    L_sum = L_shl( L_sum, shift1 ); /* return value */

    shift = sub( add( bufX32_exp, bufY16_exp ), add( shift, shift1 ) );
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
    IF( EQ_16( is_ivas, 0 ) )
    {
        shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */
    }
#else
    shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */
#endif
    /* In case of NULL result, we want to have a 0 exponent too */
    if ( L_sum == 0 )
        shift = 0;
+5 −9
Original line number Diff line number Diff line
@@ -864,12 +864,8 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
                               const Word16 *bufY16,   /* i: 16-bit buffer quite right-aligned   */
                               Word16 bufY16_exp,      /* i: exponent of buffer bufY16           */
                               Word16 len,             /* i: buffer len to process               */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
                               Word16 *exp,            /* o: result exponent                     */
                               const Word16 is_ivas ); /* i: flag indicating IVAS to maintain EVS BE */
#else
                               Word16 *exp ); /* o: result exponent                     */
#endif

/*!**********************************************************************
   \brief   Converts linear factor or energy to Decibel
+2 −6
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_BASOP_2620_ICBWE_GSMAPPING_DEAD_CLAMP       /* FhG: remove dead (always-overwritten) gsMapping clamp in ic_bwe_enc_gsMapping_fx; float ref has no clamp */

/* #################### End BE switches ################################## */

@@ -94,12 +93,9 @@
/* any switch which is non-be wrt. TS 26.251 V3.0 */

#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#define FIX_BASOP_2612_RESET_DECIM_MEM                  /* FhG: BASOP #2612: reset (zero) the 16k resampler memory of the secondary channel on DFT->TD stereo switch (otherwise -> fx overshoot) */
#define FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT   /* FhG: BASOP #2621: stereo_dft_generate_comfort_noise_fx flag_noisy_speech: compare (lp_speech-lp_noise) Q23 diff against 28.0 in Q23 (was vs integer 28 with q_lp_noise=0) */
#define FIX_ISSUE_2618_PLC_RES_ATT_SCALING              /* FhG: BASOP #2618: residual PLC burst attenuation, apply divide/Sqrt32 exponent so fac tracks exponent correctly */
#define NONBE_FIX2614_LP_CNG_ASSERT                     /* FhG: */
#define FIX_FLOAT_1600_OMASA_WRONG_RENDER_PATH          /* Nokia: float issue 1600: fix initialization condition of stereo type detection for OMASA */
#define FIX_BASOP_1765_MASA1TC_CNG_MISMATCH             /* Nokia: BASOP issue 1765: Improve accuracy of FD CNG noise estimation */
#define FIX_BASOP_2627_PARAM_MC_ILD_REMAP_EXP           /* FhG: BASOP #2627: accumulate 10^(ILD/10) using a dynamic exponent */
#define FIX_BASOP_2635_EFAP_ADD_VERTEX_ELE_ROUND        /* FhG: BASOP #2635: round |elevation| with anint_fx before the 90deg subtraction in add_vertex_fx */

#define FIX_2493_CHECK_64BIT                            /* FhG: Verify that 64 bit ops do not encounter an overflow. */
#define NONBE_FIX_2493_EXTRACT_L_estDownmixGain_fx     /* FhG: Fix extract_l overflow inside estDownmixGain_fx() */
+0 −4
Original line number Diff line number Diff line
@@ -6420,12 +6420,8 @@ void noisy_speech_detection_fx(
    HANDLE_FD_CNG_DEC hFdCngDec, /* i/o: FD_CNG structure            */
    const Word16 vad,            /* i  : VAD flag                    */
    const Word16 *syn,           /* i  : i   time-domain frame       */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
    const Word16 Q,
    const Word16 is_ivas );
#else
    const Word16 Q );
#endif

void generate_comfort_noise_dec_fx(
    Word32 **bufferReal, /* o   : matrix to real part of i   bands */
+0 −4
Original line number Diff line number Diff line
@@ -1549,7 +1549,6 @@ ivas_error acelp_core_dec_fx(
            IF( st->idchan == 0 && ( st->flag_cna || ( EQ_16( st->cng_type, FD_CNG ) && LE_32( st->total_brate, ACELP_32k ) ) || ( st->cng_type == LP_CNG && LE_32( st->core_brate, SID_2k40 ) ) ) )
            {
                /*Noisy speech detector*/
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
                IF( NE_16( st->element_mode, EVS_MONO ) )
                {
                    noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn, 1 );
@@ -1558,9 +1557,6 @@ ivas_error acelp_core_dec_fx(
                {
                    noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn, 0 );
                }
#else
                noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn );
#endif

                st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r( st->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440 /*0.99 Q15*/ );
                move16();
Loading