Commit c2229c49 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'high_mld_case_fix_omasa' into 'main'

High MLD case fix for OMASA format

See merge request !499
parents 8ae3df8c 7183a385
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@
#define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE         /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */
#define NON_BE_FIX_807_MASA_DTX_BRSW                     /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */
#define FIX_BASOP_812_NAN_COHSNR                        /* FhG: BASOP issue 812: fix nan values in sparse frames for cohSNR value in ITD estimation*/

#define FIX_828_PORT_1152_FROM_FLT_REPO                  /* FhG: fix for issue 828 - fix uninitialized value used in BASOP */
/* #################### End FIXES switches ############################ */

#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */
+63 −48
Original line number Diff line number Diff line
@@ -537,8 +537,8 @@ void TonalMDCTConceal_SaveFreqSignal_ivas_fx(
        hTonalMDCTConc->lastBlockData.spectralData_exp = sub( mdctSpectrum_exp, s );
        move16();

        move16();
        hTonalMDCTConc->lastBlockData.gain_tcx_exp = gain_tcx_exp;
        move16();
        Copy( scaleFactors, hTonalMDCTConc->lastBlockData.scaleFactors, hTonalMDCTConc->nScaleFactors );
    }

@@ -1463,6 +1463,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
            {
                Word32 num, den;
                Word16 exp_num, exp_den;
                Word32 max_concealment_value;

                exp_num = cngLevelBackgroundTrace_bfi_e;
                move16();
@@ -1489,21 +1490,25 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(

                L_tmp = L_deposit_h( 0 );
                exp = sub( hTonalMDCTConc->lastBlockData.spectralData_exp, add( concealment_noise_e, exp ) );

                (void) maximum_abs_32_fx( concealment_noise, crossOverFreq, &max_concealment_value );
                IF( GT_32( max_concealment_value, 0 ) )
                {
                    IF( GT_16( exp, 0 ) )
                    {
                        g = shr( g, exp );
                        *mdctSpectrum_exp = hTonalMDCTConc->lastBlockData.spectralData_exp;
                        move16();
                    }
                    ELSE
                    {
                        crossfadeGain = shl( crossfadeGain, exp );
                        *mdctSpectrum_exp = sub( hTonalMDCTConc->lastBlockData.spectralData_exp, exp );
                        move16();
                    }
                    /*make a headroom for mdct_shaping*/
                    exp = sub( *mdctSpectrum_exp, SPEC_EXP_DEC );
                    /* assert(exp < 0);*/
                IF( exp < 0 )
                    IF( LT_16( exp, 0 ) )
                    {
                        *mdctSpectrum_exp = SPEC_EXP_DEC;
                        move16();
@@ -1513,6 +1518,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
                        exp = 0;
                        move16();
                    }
                }

                FOR( i = 0; i < crossOverFreq; i++ )
                {
@@ -1535,15 +1541,17 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
                    move32();

                    hTonalMDCTConc->faded_signal_nrg = L_add( hTonalMDCTConc->faded_signal_nrg, Mpy_32_32( mdctSpectrum[i], mdctSpectrum[i] ) );
                    move32();
                }

                hTonalMDCTConc->faded_signal_nrg_exp = shl( *mdctSpectrum_exp, 1 );

                FOR( i = crossOverFreq; i < hTonalMDCTConc->lastBlockData.nSamples; i++ )
                {
                    mdctSpectrum[i] = 0;
                    move32();
                }
                *mdctSpectrum_exp = sub( hTonalMDCTConc->lastBlockData.spectralData_exp, exp );
                move16();
                hTonalMDCTConc->faded_signal_nrg_exp = shl( *mdctSpectrum_exp, 1 );
                move16();
            }
        }
        ELSE
@@ -1638,6 +1646,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
            {
                Word32 num, den;
                Word16 exp_num, exp_den;
                Word32 max_concealment_value;

                exp_num = cngLevelBackgroundTrace_bfi_e;
                move16();
@@ -1665,6 +1674,9 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
                L_tmp = L_deposit_h( 0 );
                exp = sub( hTonalMDCTConc->lastBlockData.spectralData_exp, add( concealment_noise_e, exp ) );

                (void) maximum_abs_32_fx( concealment_noise, hTonalMDCTConc->pTCI->lowerIndex[0], &max_concealment_value );
                IF( GT_32( max_concealment_value, 0 ) )
                {
                    IF( GT_16( exp, 0 ) )
                    {
                        g = shr( g, exp );
@@ -1675,11 +1687,12 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
                    {
                        crossfadeGain = shl( crossfadeGain, exp );
                        *mdctSpectrum_exp = sub( hTonalMDCTConc->lastBlockData.spectralData_exp, exp );
                        move16();
                    }
                    /*make a headroom for mdct_shaping*/
                    exp = sub( *mdctSpectrum_exp, SPEC_EXP_DEC );
                    /* assert(exp < 0);*/
                IF( exp < 0 )
                    IF( LT_16( exp, 0 ) )
                    {
                        *mdctSpectrum_exp = SPEC_EXP_DEC;
                        move16();
@@ -1689,6 +1702,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
                        exp = 0;
                        move16();
                    }
                }

                FOR( l = 0; l < hTonalMDCTConc->pTCI->lowerIndex[0]; l++ )
                {
@@ -1874,6 +1888,7 @@ void TonalMDCTConceal_InsertNoise_ivas_fx(
            {
                crossfadeGain = shl( crossfadeGain, exp );
                *mdctSpectrum_exp = sub( hTonalMDCTConc->lastBlockData.spectralData_exp, exp );
                move16();
            }
            /*make a headroom for mdct_shaping*/
            exp = sub( *mdctSpectrum_exp, SPEC_EXP_DEC );
+7 −0
Original line number Diff line number Diff line
@@ -578,7 +578,14 @@ static int16_t stereo_dft_enc_itd_vad(

    float Spd[STEREO_DFT_N_16k_ENC / 2 + 1];


#ifdef FIX_828_PORT_1152_FROM_FLT_REPO
    /* Spd is later only used starting at itd_vad_band_tbl[0], so only compute values starting from there */
    /* -> this avoids uninitialized values in Spd_L and Spd_R at index 0 to be used */
    for ( i = itd_vad_band_tbl[0]; i <= STEREO_DFT_N_16k_ENC / 2; i++ )
#else
    for ( i = 0; i <= STEREO_DFT_N_16k_ENC / 2; i++ )
#endif
    {
        Spd[i] = 0.5f * ( Spd_L[i] + Spd_R[i] );
    }