From 41d27e2a588d36a6f52eba1d756497f0be88893b Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 22 Jun 2023 11:40:17 +0200 Subject: [PATCH 1/2] fix #578, transmit C ILD when LFE is active in band 0 for 3TC ParamMC modes --- lib_com/options.h | 2 +- lib_dec/ivas_mc_param_dec.c | 15 +++++++++++++++ lib_enc/ivas_mc_param_enc.c | 15 ++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b7c95bede7..82df39dfd0 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -152,8 +152,8 @@ #define FIX_565_SBA_BURST_IN_FEC /* VA: Issue 565: Fix noise burst during FEC, due to wrong total_brate initialization */ #define FIX_562_ISM2_64KBPS /* VA: issue 562: fix ISM2 at 64kbps issue */ #define FIX_559_EXTL_IGF_MISMATCH /* VA: issue 559: fix mismatch between st->extl and st->igf observed as crash in PlanarSBA bitrate switching */ - #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ +#define FIX_578_PARAMMC_ILD_BS /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 32fbf135ba..37fb66a2aa 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -3055,11 +3055,19 @@ static void ivas_param_mc_bs_decode_parameter_values( int16_t i, j, k; float dequant_seq[PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE]; float dequant_ordered[PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE]; +#ifdef FIX_578_PARAMMC_ILD_BS + int16_t n_lfe_idx; +#endif range_coding = bit_buffer[( *bit_pos )++]; /* Decoding the sequence */ +#ifdef FIX_578_PARAMMC_ILD_BS + n_lfe_idx = map_size - map_size_wo_lfe; + sz_seq = num_param_bands * ( map_size_wo_lfe ) + num_lfe_bands * n_lfe_idx; +#else sz_seq = num_param_bands * ( map_size_wo_lfe ) + num_lfe_bands; +#endif set_s( idx, 0, PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE ); set_zero( dequant_ordered, PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_MAX_VAL_MAP_SIZE ); @@ -3120,7 +3128,14 @@ static void ivas_param_mc_bs_decode_parameter_values( for ( i = 0; i < num_lfe_bands; i++ ) { +#ifdef FIX_578_PARAMMC_ILD_BS + for ( j = 0; j < n_lfe_idx; j++ ) + { + dequant_ordered[map_size - n_lfe_idx + j + i * map_size] = dequant_seq[k++]; + } +#else dequant_ordered[map_size - 1 + i * map_size] = dequant_seq[k++]; +#endif } if ( !( *BER_detect ) ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 715d3fe248..461d878ec2 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -1658,12 +1658,25 @@ static void ivas_param_mc_encode_parameter( { if ( hMetadataPMC->bAttackPresent || hMetadataPMC->param_frame_idx == hMetadataPMC->coding_band_mapping[i] ) { - /* LFE ICC is always the last ICC in coding band 0 */ + /* LFE ICC/ILDs are always the last ones in coding band 0 */ +#ifdef FIX_578_PARAMMC_ILD_BS + int16_t n_lfe_idx, k; + n_lfe_idx = map_size - map_size_wo_lfe; + for ( k = 0; k < n_lfe_idx; k++ ) + { + idx = quant_idx[( i + 1 ) * map_size - n_lfe_idx + k]; + seq[sz_seq] = idx; + seq_delta[sz_seq] = idx - idx_prev + idx_offset; + idx_prev = idx; + sz_seq++; + } +#else idx = quant_idx[( i + 1 ) * map_size - 1]; seq[sz_seq] = idx; seq_delta[sz_seq] = idx - idx_prev + idx_offset; idx_prev = idx; sz_seq++; +#endif } } } -- GitLab From d1cc4f2ce5e361bf256a53b371b6bdb052ae618a Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Thu, 22 Jun 2023 14:48:01 +0200 Subject: [PATCH 2/2] readd define FIX_UNCLR_ISSUE, accidentally deleted in the latest merge from main --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 1ce9477d30..0ee80d1cf2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -156,7 +156,7 @@ #define FIX_QMETA_SID_5k2 /* Nokia: Issue 137: enable using full 5.2k bitrate in MASA SID */ #define FIX_578_PARAMMC_ILD_BS /* FhG: Issue 578: transmitt also center ILD in band 0 when LFE is active in 3TC ParamMC */ - +#define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ -- GitLab