Commit 2020b81a authored by PLAINSI's avatar PLAINSI
Browse files

Fix #468 for 16kHz ParamUpmix

parent a2bcdd0a
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -198,6 +198,7 @@

#define MC_PARAMUPMIX_MODE                              /* Dlb: Contribution 39: Multichannel Parametric Upmix */
#define FIX_469_BRSWITCH_PUPMIX                         /* Dlb: Fix issue 469 for Param Upmix bitrate switching */
#define FIX_468_16KHZ_PUPMIX                            /* Dlb: Fix issue 468 for Param Upmix at 16kHz sampling rate */

#define HODIRAC                                         /* FhG: Contribution 32: Sector-based HO-DirAC method for SBA at high bitrates */
#define DIRAC_ALLOC_HARM                                /* VA: harmonize DirAC parameters allocation/deallocation */
+24 −2
Original line number Diff line number Diff line
@@ -734,6 +734,9 @@ static void ivas_mc_paramupmix_param_est_enc(

    int16_t l_ts;
    int16_t b, i, j, ts, bnd;
#ifdef FIX_468_16KHZ_PUPMIX
    int16_t maxbands;
#endif

    int16_t transient_det[MC_PARAMUPMIX_COMBINATIONS][2];
    int16_t transient_det_l[2], transient_det_r[2];
@@ -823,11 +826,18 @@ static void ivas_mc_paramupmix_param_est_enc(
        ivas_enc_cov_handler_process( hMCParamUpmix->hCovEnc[b], pp_in_fr_real, pp_in_fr_imag, cov_real, cov_dtx_real, hMCParamUpmix->hFbMixer->pFb, 0, hMCParamUpmix->hFbMixer->pFb->filterbank_num_bands, MC_PARAMUPMIX_NCH, 0 /*dtx_vad*/, transient_det[b] );
#endif
    }

#ifdef FIX_468_16KHZ_PUPMIX
    maxbands = hMCParamUpmix->hFbMixer->pFb->filterbank_num_bands;
    for ( b = 0; b < MC_PARAMUPMIX_COMBINATIONS; b++ )
    {
        for ( bnd = 0; bnd < maxbands; bnd++ )
        {
#else
    for ( b = 0; b < MC_PARAMUPMIX_COMBINATIONS; b++ )
    {
        for ( bnd = 0; bnd < IVAS_MAX_NUM_BANDS; bnd++ )
        {
#endif
            rxy = hMCParamUpmix->cov_real[b][1][0][bnd];
            ryy = hMCParamUpmix->cov_real[b][1][1][bnd];
            cmat = rxy / ( ryy + EPSILON );
@@ -841,7 +851,19 @@ static void ivas_mc_paramupmix_param_est_enc(
            betas[b][bnd] = (float) 2.0 * wetaux;
        }
    }

#ifdef FIX_468_16KHZ_PUPMIX
    if ( maxbands < IVAS_MAX_NUM_BANDS )
    {
        for ( b = 0; b < MC_PARAMUPMIX_COMBINATIONS; b++ )
        {
            for ( bnd = maxbands; bnd < IVAS_MAX_NUM_BANDS; bnd++ )
            {
                alphas[b][bnd] = 0.0;
                betas[b][bnd] = 0.0;
            }
        }
    }
#endif
    return;
}