Commit 86b6cd0a authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge branch...

Merge branch 'basop-2545-ltv-regression-significant-mld-increase-for-ltv_basop_encoder-masa-2tc-at-128-kbps-48khz' into 'main'

[non-BE] Resolve "[ltv-regression] Significant MLD increase for ltv_basop_encoder-MASA 2TC at 128 kbps, 48kHz in, 48kHz out, FOA out"

Closes #2545

See merge request !2961
parents 06072653 3d7f0a89
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@
#define FIX_BASOP_2529_MASA_RATIO_SCALINGS              /* Nokia: BASOP issue 2529: Fix MASA ratio scalings and verifications */
#define FIX_BASOP_2531_MCT_CP_BITRATE                   /* FhG: BASOP issue 2531: Fix MCT cp_bitrate calculation; affects bitrate switching only */
#define FIX_BASOP_2541_OMASA_ENC_FIXES                  /* Nokia: BASOP issue 2541: Fix function ivas_encode_masaism_metadata_fx */
#define FIX_BASOP_2545_FIX_LTV_REGRESSION_2529          /* Nokia: BASOP issue 2545: Fix LTV regression caused by issue 2529 fix */

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

+4 −0
Original line number Diff line number Diff line
@@ -3160,7 +3160,11 @@ static void average_masa_metadata_fx(
            hMeta->directional_meta[i].spread_coherence_fx[j][k] = BASOP_Util_Divide3232_Scale( spread_coh_sum_fx, L_add( energy_sum_fx, EPSILON_FX ), &temp2_e );
            move16();
            temp2_e = add( temp2_e, sub( spread_coh_sum_e, energy_sum_e ) );
#ifdef FIX_BASOP_2545_FIX_LTV_REGRESSION_2529
            hMeta->directional_meta[i].spread_coherence_fx[j][k] = shl_sat( hMeta->directional_meta[i].spread_coherence_fx[j][k], temp2_e ); /*changing q from 15-temp2_e to q15*/
#else
            hMeta->directional_meta[i].spread_coherence_fx[j][k] = shl( hMeta->directional_meta[i].spread_coherence_fx[j][k], temp2_e ); /*changing q from 15-temp2_e to q15*/
#endif
            move16();
            IF( i == 0 )
            {
+10 −0
Original line number Diff line number Diff line
@@ -210,7 +210,12 @@ ivas_error MasaFileReader_readNextFrame(
            for ( b = 0; b < MASA_FREQUENCY_BANDS; b++ )
            {
#ifdef FIX_BASOP_2529_MASA_RATIO_SCALINGS
#ifdef FIX_BASOP_2545_FIX_LTV_REGRESSION_2529
                int32_t tmp_coh = ( (int32_t) readOther[b] * ONE_IN_Q15 + 254 ) / 255;
                hMeta->directional_meta[i].spread_coherence_fx[j][b] = (Word16) ( tmp_coh > MAX_16 ? MAX_16 : tmp_coh ); // Q15, need to clamp
#else
                hMeta->directional_meta[i].spread_coherence_fx[j][b] = (Word16) ( ( (int32_t) readOther[b] * ONE_IN_Q15 + 254 ) / 255 ); // Q15
#endif
#else
                hMeta->directional_meta[i].spread_coherence_fx[j][b] = (Word16) ( readOther[b] * ONE_IN_Q7 ); // Q15
#endif
@@ -242,7 +247,12 @@ ivas_error MasaFileReader_readNextFrame(
        for ( b = 0; b < MASA_FREQUENCY_BANDS; b++ )
        {
#ifdef FIX_BASOP_2529_MASA_RATIO_SCALINGS
#ifdef FIX_BASOP_2545_FIX_LTV_REGRESSION_2529
            int32_t tmp_coh = ( (int32_t) readOther[b] * ONE_IN_Q15 + 254 ) / 255;
            hMeta->common_meta.surround_coherence_fx[j][b] = (Word16) ( tmp_coh > MAX_16 ? MAX_16 : tmp_coh ); // Q15, need to clamp
#else
            hMeta->common_meta.surround_coherence_fx[j][b] = (Word16) ( ( (int32_t) readOther[b] * ONE_IN_Q15 + 254 ) / 255 ); // Q15
#endif
#else
            hMeta->common_meta.surround_coherence_fx[j][b] = shl( (Word16) readOther[b], 7 ); // Q8->Q15
            move16();