Commit 477a3584 authored by vasilache's avatar vasilache
Browse files

fix 1338

parent b400f210
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -2461,6 +2461,25 @@ static void reduce_metadata_further_fx(
                meanRatio = L_add( meanRatio, Mpy_32_32( hqmetadata->q_direction[0].band_data[band].energy_ratio_fx[sf], energy[sf][band] ) ); // hMasa->data.q_energy - 1
            }
        }
#ifdef FIX_1338_DIFFERENT_CORE_BRATE_MASA
        /* just to keep the value*/
        totalEnergySum = Mpy_32_32( totalEnergySum, hqmetadata->q_direction[0].band_data[selectedBand].energy_ratio_fx[0] );
        /* If the ratio of the selected band is larger than the average ratio of all bands and if there is an onset, merge over frequency bands.
         * Otherwise, merge over subframes. */
        exp = sub( 31, sub( hMasa->data.q_energy, 1 ) );

        IF( BASOP_Util_Cmp_Mant32Exp( totalEnergySum, sub( exp, tmp2 ), meanRatio, exp ) > 0 )
        //  IF( BASOP_Util_Cmp_Mant32Exp( hqmetadata->q_direction[0].band_data[selectedBand].energy_ratio_fx[0], 1, meanRatio, exp ) > 0 )
        {
            mergeOverFreqBands = 1;
            move16();
        }
        ELSE
        {
            mergeOverFreqBands = 0;
            move16();
        }
#else
        IF( totalEnergySum != 0 )
        {
            meanRatio = BASOP_Util_Divide3232_Scale_cadence( meanRatio, totalEnergySum, &exp );
@@ -2486,6 +2505,7 @@ static void reduce_metadata_further_fx(
            mergeOverFreqBands = 0;
            move16();
        }
#endif
    }
    ELSE
    {