Commit 310f44c7 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge branch '1718_basop_portMR1457' into 'main-pc'

[allow-regression][Non-BE][split-non-BE]Port MR1457 to main-pc

See merge request !1688
parents 2c3cbc0d dcf8b5fc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1286,7 +1286,11 @@ enum
#define MASA_RATIO_TOLERANCE                    0.1f
#define MASA_RATIO_THRESHOLD                    0.1f
#define MASA_ANGLE_TOLERANCE                    0.5f
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
#define MASA_RATIO_THRESHOLD_FX                 32212255    // 0.015 in Q31
#else
#define MASA_RATIO_THRESHOLD_FX                 214748365   // 0.1 in Q31
#endif
#define MASA_RATIO_TOLERANCE_FX                 107374182   // 0.1 in Q30
#define MASA_ANGLE_TOLERANCE_FX                 ONE_IN_Q21  // 0.5 in Q22
#define MASA_LIMIT_NO_BANDS_SUR_COH             8
+1 −0
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@

#define FIX_1024_REMOVE_PARAMMC_MIXING_MAT              /* VA: issue 1024: remove unused function ivas_param_mc_get_mono_stereo_mixing_matrices() */
#define FIX_1741_REVERB_TIMES_Q_FORMAT                  /* Philips: reverberation times in Q26 format instead of Q31 */
#define NONBE_FIX_1034_DRY_MASA_RATIOS                  /* Nokia: Fix issue 1034, use of wrong numDir state. */

/* #################### End BASOP porting switches ############################ */

+22 −0
Original line number Diff line number Diff line
@@ -1857,6 +1857,9 @@ void ivas_masa_combine_directions_fx(
                hMeta->directional_meta[1].energy_ratio_fx[j][i] = 0;                                // Q30
                move16();
                move16();
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
                hMeta->common_meta.diffuse_to_total_ratio_fx[j][i] = L_sub( ONE_IN_Q30, hMeta->directional_meta[0].energy_ratio_fx[j][i] ); // Q30
#endif

                IF( computeCoherence )
                {
@@ -2104,6 +2107,10 @@ static void detect_metadata_composition_fx(
            {
                FOR( band = 0; band < MASA_FREQUENCY_BANDS; band++ )
                {
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
                    hMeta->directional_meta[0].spherical_index[sf][band] = hMeta->directional_meta[1].spherical_index[sf][band];
                    move16();
#endif
                    hMeta->directional_meta[0].azimuth_fx[sf][band] = hMeta->directional_meta[1].azimuth_fx[sf][band];                   /*q22*/
                    hMeta->directional_meta[0].elevation_fx[sf][band] = hMeta->directional_meta[1].elevation_fx[sf][band];               /*q22*/
                    hMeta->directional_meta[0].energy_ratio_fx[sf][band] = hMeta->directional_meta[1].energy_ratio_fx[sf][band];         /*q30*/
@@ -2228,7 +2235,12 @@ static void compensate_energy_ratios_fx(
    UWord8 numDirs;

    hMeta = &( hMasa->masaMetadata );
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
    numDirs = hMasa->config.numberOfDirections;
    move16();
#else
    numDirs = (UWord8) add( hMeta->descriptive_meta.numberOfDirections, 1 );
#endif

    FOR( sf = 0; sf < MAX_PARAM_SPATIAL_SUBFRAMES; sf++ )
    {
@@ -3137,10 +3149,20 @@ static void copy_masa_metadata_subframe_fx(
)
{
    UWord8 dir;
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
    UWord8 band;
#endif

    /* directional metadata */
    FOR( dir = 0; dir < MASA_MAXIMUM_DIRECTIONS; dir++ )
    {
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
        FOR( band = 0; band < MASA_FREQUENCY_BANDS; band++ )
        {
            hMetaTo->directional_meta[dir].spherical_index[sfTo][band] = hMetaFrom->directional_meta[dir].spherical_index[sfFrom][band];
            move16();
        }
#endif
        Copy32( hMetaFrom->directional_meta[dir].azimuth_fx[sfFrom], hMetaTo->directional_meta[dir].azimuth_fx[sfTo], MASA_FREQUENCY_BANDS );                 // Q22
        Copy32( hMetaFrom->directional_meta[dir].elevation_fx[sfFrom], hMetaTo->directional_meta[dir].elevation_fx[sfTo], MASA_FREQUENCY_BANDS );             // Q22
        Copy32( hMetaFrom->directional_meta[dir].energy_ratio_fx[sfFrom], hMetaTo->directional_meta[dir].energy_ratio_fx[sfTo], MASA_FREQUENCY_BANDS );       // Q30