Commit df23b197 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into float-1600-masa-part-rendering-of-omasa-does-not-always-follow-correct-path-in-internal-renderer
parents 2a17bd9f 8c5a173e
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@
#define FIX_ISSUE_2613_WRONG_COMP_MACRO                 /* FhG: basop issue 2613: Inconsistent comparison macros in function tdm_SCh_LSF_intra_pred_fx*/
#define FIX_ISSUE_2611_WRONG_COMMENT                    /* FhG: basop issue 2611: Wrong Q value comment in fucntion stereo_dft_sg_recovery_fx()*/
#define FIX_BASOP_2550_TCX_ENC_MEM_UPDATE               /* FhG: fix condition in tcx_encoder_memory_update_*_fx(), bring inline with float */
#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 ################################## */

@@ -99,6 +100,10 @@
#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_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 */

/* ##################### End NON-BE switches ########################### */
+2 −2
Original line number Diff line number Diff line
@@ -2128,7 +2128,7 @@ void noisy_speech_detection_fx(
            logTotalNoise = Mpy_32_16_1( L_add( logTotalNoise, logTotalNoiseExp ), 24660 /*0.75257498916 Q15*/ ); /*Q31 - logTotalNoiseExp*/
        }

        hFdCngDec->lp_noise = L_add( Mpy_32_16_1( hFdCngDec->lp_noise, 32604 /*0.995 Q15*/ ), L_shr( Mpy_32_16_1( logTotalNoise, 20972 /*0.64 Q15*/ ), 7 ) ); /*hFdCngDec->q_lp_noise*/
        hFdCngDec->lp_noise = L_add( Mpy_32_16_1( hFdCngDec->lp_noise, 32604 /*0.995 Q15*/ ), L_shr( Mpy_32_16_1( logTotalNoise, 20972 /*0.64 Q15*/ ), 7 ) ); /*Q23*/
        move32();
    }
    ELSE
@@ -2175,7 +2175,7 @@ void noisy_speech_detection_fx(
            }
        }

        hFdCngDec->lp_speech = L_add( Mpy_32_16_1( hFdCngDec->lp_speech, 32604 /*0.995 Q15*/ ), L_shr( Mpy_32_16_1( logEtot, 20972 /*0.64 Q15*/ ), 7 ) ); /*hFdCngDec->q_lp_speech*/
        hFdCngDec->lp_speech = L_add( Mpy_32_16_1( hFdCngDec->lp_speech, 32604 /*0.995 Q15*/ ), L_shr( Mpy_32_16_1( logEtot, 20972 /*0.64 Q15*/ ), 7 ) ); /*Q23*/
        move32();
    }

+9 −0
Original line number Diff line number Diff line
@@ -345,6 +345,9 @@ static void stereo_dft_generate_comfort_noise_fx(
        {
            q_cngNoiseLevel_upd = s_min( q_cngNoiseLevel_upd, add( e_norm_temp[i], norm_l( cngNoiseLevel_upd[i] ) ) );
        }
#ifdef NONBE_FIX2614_LP_CNG_ASSERT
        q_cngNoiseLevel_upd = s_min( q_cngNoiseLevel_upd, sub( 31, shr( st->hFdCngDec->bandNoiseShape_exp, 1 ) ) );
#endif
        FOR( i = 0; i < st->L_frame; i++ )
        {
            cngNoiseLevel_upd[i] = L_shl( cngNoiseLevel_upd[i], sub( q_cngNoiseLevel_upd, e_norm_temp[i] ) );
@@ -772,8 +775,10 @@ static void stereo_dft_generate_comfort_noise_fx(
    }
    ELSE IF( ( chan == 0 ) )
    {
#ifndef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT
        Word16 q_lp_noise = 0; // st->hFdCngDec->q_lp_noise; // to be populated appropriately.
        move16();
#endif
        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)
        // log_lp_noise at this stage is in Q25. where as the structure value is in Q23
@@ -783,7 +788,11 @@ static void stereo_dft_generate_comfort_noise_fx(
        move32();
        st->lp_noise = st->hFdCngDec->lp_noise; /* Q23 */
        move32();
#ifdef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT
        st->hFdCngDec->hFdCngCom->flag_noisy_speech = extract_l( LT_32( L_sub( st->hFdCngDec->lp_speech, st->hFdCngDec->lp_noise ), 234881024 /* 28.0f in Q23 */ ) ); /* Q0 */
#else
        st->hFdCngDec->hFdCngCom->flag_noisy_speech = extract_l( LT_32( L_shr( L_sub( st->hFdCngDec->lp_speech, st->hFdCngDec->lp_noise ), q_lp_noise ), 28 ) ); /* Q0 */
#endif
        move16();
        st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = add( mult_r( 32440 /* 0.99 in Q15 */, st->hFdCngDec->hFdCngCom->likelihood_noisy_speech ),
                                                                 mult_r( 328 /* 0.01 in Q15 */, st->hFdCngDec->hFdCngCom->flag_noisy_speech ) ); /* Q15 */
+15 −0
Original line number Diff line number Diff line
@@ -738,22 +738,37 @@ void stereo_dft_res_ecu_burst_att_fx(
)
{
    Word32 fac;
#ifndef FIX_ISSUE_2618_PLC_RES_ATT_SCALING
    Word16 q_fac;
#endif
    Word16 exponent;

#ifndef FIX_ISSUE_2618_PLC_RES_ATT_SCALING
    q_fac = 0;
    move16();
#endif
    exponent = 0;
    move16();

    /* attenuation of residual; follow attenuation of DMX */
    IF( hStereoDft->core_hist[0] == ACELP_CORE )
    {
#ifdef FIX_ISSUE_2618_PLC_RES_ATT_SCALING
        fac = L_deposit_h( BASOP_Util_Divide3232_Scale( dmx_nrg, hStereoDft->past_dmx_nrg_fx, &exponent ) );
        fac = Sqrt32( fac, &exponent );
        fac = Mpy_32_16_1( fac, (Word16) ( 0x0CCD ) ); /* * 0.1f (Q15) */
        fac = L_shl_sat( fac, exponent );              /* Q31 */
#else
        fac = Mpy_32_16_1( Sqrt32( L_deposit_h( BASOP_Util_Divide3232_Scale( dmx_nrg, hStereoDft->past_dmx_nrg_fx, &q_fac ) ), &exponent ), (Word16) ( 0x0CCD ) ); /* Q0 */
#endif
    }
    ELSE
    {
#ifdef FIX_ISSUE_2618_PLC_RES_ATT_SCALING
        fac = L_sub( MAX_32, L_deposit_h( BASOP_Util_Divide3232_Scale( L_sub( hStereoDft->time_offs, L_ana ), L_add( hStereoDft->time_offs, L_ana ), &exponent ) ) ); /* Q31 */
#else
        fac = L_sub( MAX_32, L_deposit_h( BASOP_Util_Divide3232_Scale( L_sub( hStereoDft->time_offs, L_ana ), L_add( hStereoDft->time_offs, L_ana ), &q_fac ) ) ); /* Q0 */
#endif
    }

    v_multc_fx( pDFT_RES, fac, pDFT_RES, shl( L_res, 1 ) );
+4 −0
Original line number Diff line number Diff line
@@ -137,10 +137,14 @@ typedef struct

    Word16 flag_dtx_mode;
    Word32 lp_speech; /* format: Q9.23 */
#ifndef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT
    Word16 q_lp_speech;
#endif

    Word32 lp_noise; /* format: Q9.23 */
#ifndef FIX_BASOP_2621_STEREO_CNG_NOISY_SPEECH_QSHIFT
    Word16 q_lp_noise;
#endif

    Word16 msPeriodogBuf[MSBUFLEN * NPART_SHAPING];

Loading