diff --git a/lib_com/options.h b/lib_com/options.h old mode 100755 new mode 100644 index a24b45626f2d41cbb471ba89b96e97985bb826c7..2d346ef5916926dcd05c79e1df9c941a721e296d --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,6 +162,7 @@ #define FIX_HBR_MASAMETA /* Nokia: Fixes to HBR MASA metadata at 384 and 512 kbps. Addresses issues 438 and 477 as well. */ #define FIX_482_DUMMYDEC_INIT /* Nokia: fix issue #428: missing inits for dummyDec in IVAS_rend */ +#define FIX_468_16KHZ_PUPMIX /* Dlb: Fix issue 468 for Param Upmix at 16kHz sampling rate */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c index fc093c3f59644e9a5538fbe5a389a8ed126fab8d..997b0043ac4f62e51363c6fb40569e2eb03e9b34 100644 --- a/lib_enc/ivas_mc_paramupmix_enc.c +++ b/lib_enc/ivas_mc_paramupmix_enc.c @@ -729,6 +729,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]; @@ -804,11 +807,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], HOA_md_ind ); } - +#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 ); @@ -822,6 +832,18 @@ 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; }