diff --git a/lib_com/options.h b/lib_com/options.h index ea9a483ead8a4b4113a6bb986b6ac114d3f49ca2..0ee80d1cf2b25a0c611dacfd1933b1879d6e7dee 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,8 +155,8 @@ #define FIX_572_LFE_LPF_ENC /* FhG: issue 572: always apply the low pass filter to the LFE channel */ #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 */ diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 32fbf135ba282ae03b1536c3a696cc01474dab61..37fb66a2aab341688a1c73b55c5df56663a00dce 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 715d3fe2488fc80dcfe8d01904598fdb0572fa1c..461d878ec2739e07d3c729daa2ed89def94ee208 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 } } }