Commit 9033c999 authored by bayers's avatar bayers
Browse files

fix #563, ILD limiter overshoot when coming from silence w/o a transient frame...

fix #563, ILD limiter overshoot when coming from silence w/o a transient frame being detected, fix combining of cov matrices in the encoder in transient frames
parent 8c93d871
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1420,6 +1420,9 @@ typedef enum
#define PARAM_MC_MAX_BAND_ABS_COV_DEC           10
#define PARAM_MC_ENER_LIMIT_INTRAFRAME          (1.5f)
#define PARAM_MC_ENER_LIMIT_INTERFRAME          (2.0f)
#ifdef FIX_563_PARAMMC_LIMITER
#define PARAM_MC_ENER_LIMIT_MAX_DELTA_FAC       (15.0f)
#endif
#define PARAM_MC_LFE_ON_THRESH                  (8000.0f)
#define PARAM_MC_BAND_TO_MDCT_BAND_RATIO        16                          /* Ratio of resolution of CLDFB Bands to MDCT Bands */
#define PARAM_MC_SLOT_ENC_NS                    2500000L
+1 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@
#define FIX_547_NAN_IGF_DEC                             /* FhG: issue 547: fix possible nan in IGF decoder */

#define FIX_529_BWD_ISSUE                               /* VA: issue 529: fix Bandwidth Detector not working reliably for Music and Generic Audio */
#define FIX_563_PARAMMC_LIMITER                         /* FhG: issue 563: fix ILD limiter when coming from silence w/o transient set             */

#define IGF_TUNING_96                                   /* FhG: Issue 546: slight tuning of IGF config used in 96 kbps stereo, 128 kbps SBA and others */

+15 −0
Original line number Diff line number Diff line
@@ -856,7 +856,11 @@ static void ivas_param_mc_param_est_enc(

        for ( ; cur_param_band < num_parameter_bands; cur_param_band += 2 )
        {
#ifdef FIX_563_PARAMMC_LIMITER
            if ( cur_param_band < num_parameter_bands )
#else
            if ( cur_param_band + 1 < num_parameter_bands )
#endif
            {
                for ( ch_idx1 = 0; ch_idx1 < nchan_transport; ++ch_idx1 )
                {
@@ -1252,7 +1256,11 @@ static void ivas_param_mc_quantize_ilds(
    ener_fac = 10.0f * log10f( ( tot_ener + EPSILON ) / ( dmx_ener + EPSILON ) );
    delta_fac = ener_fac - hParamMC->ener_fac[freq_idx];

#ifdef FIX_563_PARAMMC_LIMITER
    if ( !hParamMC->hMetadataPMC.bAttackPresent && ( delta_fac > PARAM_MC_ENER_LIMIT_INTERFRAME ) && ( delta_fac < PARAM_MC_ENER_LIMIT_MAX_DELTA_FAC ) )
#else
    if ( !hParamMC->hMetadataPMC.bAttackPresent && ( delta_fac > PARAM_MC_ENER_LIMIT_INTERFRAME ) )
#endif
    {
        float limit_fac;
        limit_fac = powf( 10.0f, ( ( 0.3f * logf( delta_fac - PARAM_MC_ENER_LIMIT_INTERFRAME + 1.0f ) - ( delta_fac - PARAM_MC_ENER_LIMIT_INTERFRAME ) ) / 10.0f ) );
@@ -1261,6 +1269,13 @@ static void ivas_param_mc_quantize_ilds(
    }

    hParamMC->ener_fac[freq_idx] = ener_fac;
#ifdef FIX_563_PARAMMC_LIMITER
    /* update also combined bands ener_fac when in transient frame */
    if ( hParamMC->hMetadataPMC.bAttackPresent && ( ( freq_idx + 1 ) < hParamMC->hMetadataPMC.nbands_coded ) )
    {
        hParamMC->ener_fac[freq_idx + 1] = ener_fac;
    }
#endif

    for ( k = 0; k < num_ilds_to_code; ++k )
    {