From 2020b81ab4fc4195fd0a152170fe11245ecaa6c7 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Thu, 18 May 2023 14:18:34 +0200 Subject: [PATCH 1/2] Fix #468 for 16kHz ParamUpmix --- lib_com/options.h | 1 + lib_enc/ivas_mc_paramupmix_enc.c | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index be54df0c71..e993f90ec2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 */ diff --git a/lib_enc/ivas_mc_paramupmix_enc.c b/lib_enc/ivas_mc_paramupmix_enc.c index 6363ee3b13..9c62d1d6a0 100644 --- a/lib_enc/ivas_mc_paramupmix_enc.c +++ b/lib_enc/ivas_mc_paramupmix_enc.c @@ -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; } -- GitLab From 1c185abd23ce528cc8772e3d831f18999cd82e80 Mon Sep 17 00:00:00 2001 From: Simon Plain Date: Mon, 22 May 2023 09:23:58 +0200 Subject: [PATCH 2/2] Add option --- lib_com/options.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_com/options.h b/lib_com/options.h index ed7c70ab02..3aa32b9701 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,6 +161,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 */ -- GitLab