Commit 849129d3 authored by Mohammadreza Naghibzadeh's avatar Mohammadreza Naghibzadeh
Browse files

Initialize q_lp_noise=23 so (lp_speech-lp_noise) Q23 diff is shifted to Q0 before <28 compare

parent 5440e481
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@
#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_2442_MASA2TC_TO_MONO_AND_AMBI         /* Nokia: BASOP issue 2442: Increase accuracy of computations and add additional gain clamp for low energy decorrelated signal rendering. */
#define FIX_FMSW_DEC_EXT                                /* float issue 1566: fix EXT output in format switching */
#define FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT   /* FhG: BASOP #2621: stereo_dft_generate_comfort_noise_fx: initialize q_lp_noise=23 so (lp_speech-lp_noise) Q23 diff is shifted to Q0(dB) before <28 compare */

/* ##################### End NON-BE switches ########################### */

+4 −0
Original line number Diff line number Diff line
@@ -772,7 +772,11 @@ static void stereo_dft_generate_comfort_noise_fx(
    }
    ELSE IF( ( chan == 0 ) )
    {
#ifdef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT
        Word16 q_lp_noise = 23; /* lp_speech/lp_noise are Q23 */
#else
        Word16 q_lp_noise = 0; // st->hFdCngDec->q_lp_noise; // to be populated appropriately.
#endif
        move16();
        Word32 log_lp_noise = L_add( L_shl( lp_noise_e, Q25 ), BASOP_Util_Log2( L_add( lp_noise, DELTA_FX ) ) ); /* Q25 */
        // log10(x) is computed as log2(x) * log10(2)