diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index fe302e926897fb26aed994cf984a4a65c2b0ef6c..e409c2a891ce395f0e803685d11b053b95d45d4c 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1392,9 +1392,17 @@ typedef enum #define PARAM_MC_ICC_ERROR_BIAS_FAC (1.15f) /* factor for favouring past ICC maps in the adaptive ICC map decision */ #define PARAM_MC_TRANSIENT_BAND_STEP 2 /* Number of parameter bands combined in case of a transient frame*/ #define PARAM_MC_MAX_DECORR_CLDFB_BANDS 20 /* Maximum number of CLDFB bands with decorrelation */ +#ifdef FIX_901_PARAMMC_DEAD_CODE +#define PARAM_MC_MAX_TRANSPORT_CHANS 3 /* Number of down mix channels */ +#else #define PARAM_MC_MAX_TRANSPORT_CHANS 4 /* Number of down mix channels */ +#endif #define PARAM_MC_MAX_ILD_REF_CHANNELS 2 /* Maximum number of reference channels for a coded ILD */ +#ifdef FIX_901_PARAMMC_DEAD_CODE +#define PARAM_MC_NUM_CONFIGS 14 /* Number of available Parametric MC configurations */ +#else #define PARAM_MC_NUM_CONFIGS 15 /* Number of available Parametric MC configurations */ +#endif #define PARAM_MC_MAX_BAND_LFE 1 /* Number of parameter bands for LFE coding */ #define PARAM_MC_SZ_ICC_MAP 11 /* Maximum number of transmitted ICCs per parameter band */ #define PARAM_MC_SZ_ILD_MAP 12 /* Maximum number of transmitted channel energies per band*/ diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index 08cf9e7fa52ff9509c84bc671a49d8a6a58f42a7..5a11a90d8622daad11350a37579aa459d10d98b7 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -86,17 +86,23 @@ uint16_t ivas_param_mc_get_configuration_index( *------------------------------------------------------------------------*/ void ivas_param_mc_metadata_open( - const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ - const int16_t lfe_index, /* i : channel index of LFE */ + const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ +#ifndef FIX_901_PARAMMC_DEAD_CODE + const int16_t lfe_index, /* i : channel index of LFE */ +#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t i; +#endif uint16_t config_index; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t nchan_setup; nchan_setup = ivas_mc_ls_setup_get_num_channels( mc_ls_setup ); +#endif /* get coding band mappings */ set_s( hMetadataPMC->coding_band_mapping, 0, PARAM_MC_MAX_PARAMETER_BANDS ); @@ -129,21 +135,26 @@ void ivas_param_mc_metadata_open( assert( 0 && "nbands must be 20 or 14!" ); } +#ifndef FIX_901_PARAMMC_DEAD_CODE /* create map of all possible ICCs */ ivas_param_mc_create_full_icc_mapping( nchan_setup, lfe_index, hMetadataPMC->icc_map_full, &hMetadataPMC->icc_map_size_full ); +#endif hMetadataPMC->icc_mapping_conf = ivas_param_mc_conf[config_index].icc_mapping_conf; hMetadataPMC->ild_mapping_conf = ivas_param_mc_conf[config_index].ild_mapping_conf; hMetadataPMC->ild_factors = ivas_param_mc_conf[config_index].ild_factors; +#ifndef FIX_901_PARAMMC_DEAD_CODE /* set default ICC maps */ for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) { ivas_param_mc_default_icc_map( hMetadataPMC->icc_mapping_conf, hMetadataPMC->icc_mapping[i] ); } - +#endif /* init remaining flags and indices */ hMetadataPMC->param_frame_idx = 0; +#ifndef FIX_901_PARAMMC_DEAD_CODE hMetadataPMC->flag_use_adaptive_icc_map = 0; +#endif hMetadataPMC->bAttackPresent = 0; hMetadataPMC->attackIndex = 0; hMetadataPMC->lfe_on = 1; @@ -198,7 +209,7 @@ void ivas_param_mc_set_coded_bands( return; } - +#ifndef FIX_901_PARAMMC_DEAD_CODE /*------------------------------------------------------------------------- * ivas_param_mc_metadata_close() * @@ -223,7 +234,7 @@ void ivas_param_mc_metadata_close( return; } - +#endif /*------------------------------------------------------------------------- * ivas_param_mc_getNumTransportChannels() @@ -247,7 +258,7 @@ int16_t ivas_param_mc_getNumTransportChannels( return nchan_transport; } - +#ifndef FIX_901_PARAMMC_DEAD_CODE /*------------------------------------------------------------------------- * ivas_param_mc_create_full_icc_mapping() * @@ -303,7 +314,6 @@ void ivas_param_mc_create_full_icc_mapping( return; } - /*------------------------------------------------------------------------- * ivas_param_mc_default_icc_map() * @@ -326,6 +336,7 @@ void ivas_param_mc_default_icc_map( return; } +#endif /*------------------------------------------------------------------------- @@ -408,9 +419,11 @@ static int16_t ivas_param_mc_get_num_param_bands( case IVAS_128k: num_parameter_bands = 14; break; +#ifndef FIX_901_PARAMMC_DEAD_CODE case IVAS_160k: num_parameter_bands = 20; break; +#endif } break; default: diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c34def3824cc2f80f00f627d6d8e654eb7f3e8fe..d0c797e27d7a193ce464c0b5f800fb20d0e6b043 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3805,7 +3805,9 @@ void ivas_mc_paramupmix_dec_render( void ivas_param_mc_metadata_open( const MC_LS_SETUP mc_ls_setup, /* i : MC ls setup */ +#ifndef FIX_901_PARAMMC_DEAD_CODE const int16_t lfe_index, /* i : channel index of LFE */ +#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* o : handle for the Parametric MC parameter coding state */ ); @@ -3814,6 +3816,7 @@ void ivas_param_mc_set_coded_bands( HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ ); +#ifndef FIX_901_PARAMMC_DEAD_CODE void ivas_param_mc_metadata_close( HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC /* i/o: handle for the Parametric MC parameter coding state */ ); @@ -3824,7 +3827,7 @@ void ivas_param_mc_create_full_icc_mapping( int16_t *icc_map[2], /* o : map of all possible ICCs */ int16_t *icc_map_size_full /* o : number of all possible ICCs */ ); - +#endif /*! r: number of IVAS transport channels */ int16_t ivas_param_mc_getNumTransportChannels( const int32_t ivas_total_bitrate, /* i : IVAS total bitrate */ @@ -3889,11 +3892,13 @@ void ivas_param_mc_dec( float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ ); +#ifndef FIX_901_PARAMMC_DEAD_CODE void ivas_param_mc_default_icc_map( const PARAM_MC_ICC_MAPPING * hIccMapping, /* i : handle to ICC mapping configuration */ int16_t icc_map[PARAM_MC_SZ_ICC_MAP][2] /* o : copy of map from the configuration */ ); +#endif /*! r: number of cldfb synthesis instances */ int16_t param_mc_get_num_cldfb_syntheses( Decoder_Struct *st_ivas /* i : IVAS decoder structure */ diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 1bcab0c0d6a627ba1692dd8a99f64b9370066595..8ab2c868211318adada1af03c69e25f4e30e1d15 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -1973,6 +1973,7 @@ const float ivas_param_mc_ild_fac_CICP19_3tc[12] = 0.5f }; +#ifndef FIX_901_PARAMMC_DEAD_CODE const float ivas_param_mc_ild_fac_CICP19_4tc[12] = { 0.35f, @@ -1989,6 +1990,7 @@ const float ivas_param_mc_ild_fac_CICP19_4tc[12] = 0.2f, }; +#endif const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc = { 5, @@ -2052,6 +2054,7 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_3tc = {{0},{1},{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} }; +#ifndef FIX_901_PARAMMC_DEAD_CODE const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc = { 11, @@ -2061,6 +2064,7 @@ const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_4tc = {{0},{1},{0,1},{0},{1},{0},{1},{2},{3},{2},{3},{0,1}} }; +#endif const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc = { 4, @@ -2161,6 +2165,7 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_3tc = } }; +#ifndef FIX_901_PARAMMC_DEAD_CODE const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc = { 8, @@ -2177,6 +2182,7 @@ const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_4tc = } }; +#endif const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = { /* CICP6 48000 */ @@ -2332,7 +2338,9 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = &ivas_param_mc_icc_mapping_CICP19_3tc, &ivas_param_mc_dmx_fac_CICP19_3tc[0], &ivas_param_mc_ild_fac_CICP19_3tc[0] - }, + } +#ifndef FIX_901_PARAMMC_DEAD_CODE + , /* CICP19 160000 */ { MC_LS_SETUP_7_1_4, @@ -2344,6 +2352,7 @@ const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = &ivas_param_mc_dmx_fac_CICP19_4tc[0], &ivas_param_mc_ild_fac_CICP19_4tc[0] } +#endif }; const float ivas_param_mc_quant_ild_5d1_48[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index e8699bc50042e82e3b1d7410be47f7e07a676627..1f55909a23354fadeeaa31849a5be630aa4e1768 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -595,11 +595,15 @@ typedef struct ivas_parametric_mc_metadata_struct { const PARAM_MC_ILD_MAPPING *ild_mapping_conf; const PARAM_MC_ICC_MAPPING *icc_mapping_conf; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t icc_mapping[PARAM_MC_PARAMETER_FRAMES][PARAM_MC_SZ_ICC_MAP][2]; int16_t *icc_map_full[2]; +#endif int16_t icc_map_size_full; int16_t param_frame_idx; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t flag_use_adaptive_icc_map; +#endif const float *ild_factors; int16_t coding_band_mapping[PARAM_MC_MAX_PARAMETER_BANDS]; int16_t nbands_in_param_frame[PARAM_MC_PARAMETER_FRAMES]; diff --git a/lib_com/options.h b/lib_com/options.h index 0803c5bcfd32f7f2455fc5838bb35ff787f8a3e0..d29032ce339546c37c171d7ddb1e513e676ae713 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -159,6 +159,8 @@ #define FIX_944_REMOVE_LS_RENDERER_CALL_IN_STEREO /* VA: issue 994: remove an obsolete call of function ivas_ls_setup_conversion() in stereo */ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ +#define FIX_901_PARAMMC_DEAD_CODE /* FhG: issue 901: remove dead ParamMC code */ + diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 76bf2678e14306c99fbcf42ca0acfd25ede8005c..45ed71c978ae495b6095c38aa44e345869df1142 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -114,7 +114,9 @@ ivas_error ivas_param_mc_dec_open( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; +#ifndef FIX_901_PARAMMC_DEAD_CODE IVAS_OUTPUT_SETUP hTransportSetup; +#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -146,8 +148,9 @@ ivas_error ivas_param_mc_dec_open( output_Fs = st_ivas->hDecoderConfig->output_Fs; output_config = st_ivas->hDecoderConfig->output_config; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - +#ifndef FIX_901_PARAMMC_DEAD_CODE hTransportSetup = st_ivas->hTransSetup; +#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; hParamMC->hoa_encoder = NULL; @@ -228,7 +231,11 @@ ivas_error ivas_param_mc_dec_open( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); +#else + ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); +#endif /* init arrays for quantized parameters */ if ( ( hParamMC->icc_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ) ) == NULL ) @@ -551,7 +558,9 @@ ivas_error ivas_param_mc_dec_reconfig( { int16_t k, nchan_transport; PARAM_MC_DEC_HANDLE hParamMC; +#ifndef FIX_901_PARAMMC_DEAD_CODE IVAS_OUTPUT_SETUP hTransportSetup; +#endif int16_t nchan_out_transport; int16_t nchan_out_cov; float proto_matrix[MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS]; @@ -580,8 +589,9 @@ ivas_error ivas_param_mc_dec_reconfig( output_Fs = st_ivas->hDecoderConfig->output_Fs; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - +#ifndef FIX_901_PARAMMC_DEAD_CODE hTransportSetup = st_ivas->hTransSetup; +#endif mc_ls_setup = ivas_mc_map_output_config_to_mc_ls_setup( st_ivas->transport_config ); nchan_out_transport = st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe; @@ -625,6 +635,7 @@ ivas_error ivas_param_mc_dec_reconfig( hParamMC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); hParamMC->max_band_energy_compensation = hParamMC->num_freq_bands; +#ifndef FIX_901_PARAMMC_DEAD_CODE /* deallocate the full icc map, gets newly allocated in the metadata open function */ for ( k = 0; k < 2; k++ ) @@ -639,9 +650,14 @@ ivas_error ivas_param_mc_dec_reconfig( } } +#endif mvs2s( hParamMC->band_grouping, band_grouping_old, hParamMC->hMetadataPMC->num_parameter_bands + 1 ); +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); +#else + ivas_param_mc_metadata_open( mc_ls_setup, ivas_total_brate, hParamMC->hMetadataPMC ); +#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC->num_parameter_bands == 20 ) @@ -1098,8 +1114,9 @@ void ivas_param_mc_dec_close( /* parameter decoding */ if ( hParamMC->hMetadataPMC != NULL ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_close( hParamMC->hMetadataPMC ); - +#endif free( hParamMC->hMetadataPMC ); hParamMC->hMetadataPMC = NULL; } @@ -1215,7 +1232,10 @@ void ivas_param_mc_dec_read_BS( int16_t num_lfe_bands; int16_t num_param_bands; int16_t metadata_bit_pos; - int16_t i, j, k, l; + int16_t i, j, k; +#ifndef FIX_901_PARAMMC_DEAD_CODE + int16_t l; +#endif int16_t icc_map_size; int16_t icc_map_size_wo_lfe; int16_t ild_map_size; @@ -1304,6 +1324,7 @@ void ivas_param_mc_dec_read_BS( num_lfe_bands = 0; } +#ifndef FIX_901_PARAMMC_DEAD_CODE if ( hMetadataPMC->flag_use_adaptive_icc_map == 1 ) { int16_t icc_mapping_index[PARAM_MC_SZ_ICC_MAP]; @@ -1363,6 +1384,7 @@ void ivas_param_mc_dec_read_BS( } } +#endif ivas_param_mc_bs_decode_parameter_values( bit_buffer, &bit_pos, bits_to_copy, &st->BER_detect, hMetadataPMC, &hMetadataPMC->icc_coding, icc_map_size_wo_lfe, icc_map_size, num_lfe_bands, band_step, num_param_bands, hParamMC->icc_q ); if ( !st->BER_detect ) @@ -1890,7 +1912,6 @@ void ivas_param_mc_dec_render( return; } - /*------------------------------------------------------------------------- * ivas_param_mc_dec() * @@ -1931,7 +1952,6 @@ void ivas_param_mc_dec( return; } - /*------------------------------------------------------------------------- * param_mc_dec_init() * @@ -2711,11 +2731,15 @@ static void ivas_param_mc_dequantize_cov( int16_t l; float *Cyp; float ap; +#ifndef FIX_901_PARAMMC_DEAD_CODE int16_t param_frame_idx; +#endif const PARAM_MC_ILD_MAPPING *h_ild_mapping; float Cy_state_int[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; +#ifndef FIX_901_PARAMMC_DEAD_CODE param_frame_idx = hParamMC->hMetadataPMC->param_frame_idx; +#endif set_zero( Nrqq, MAX_OUTPUT_CHANNELS ); h_ild_mapping = hParamMC->hMetadataPMC->ild_mapping_conf; @@ -2756,8 +2780,13 @@ static void ivas_param_mc_dequantize_cov( /* replace some estimated ICCs with transmitted values */ for ( k = 0; k < hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe; k++ ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1]] = icc_q[k]; Cy_state_int[hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping[param_frame_idx][k][0]] = icc_q[k]; +#else + Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1]] = icc_q[k]; + Cy_state_int[hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][1] + nY_int * hParamMC->hMetadataPMC->icc_mapping_conf->icc_mapping[k][0]] = icc_q[k]; +#endif } if ( param_band_index >= PARAM_MC_MAX_BAND_LFE || !hParamMC->hMetadataPMC->lfe_on ) diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 5d67f62e0f3011c15fac9583a6b46098cf554b66..b32bb1ce5d630dc95c73c28c545e3de0f7b93b75 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -62,8 +62,10 @@ static void ivas_param_mc_parameter_quantizer( const float *x, const int16_t L, static void ivas_param_mc_transient_detection( PARAM_MC_ENC_HANDLE hParamMC, TRAN_DET_HANDLE hTranDet, int16_t *bAttackPresent, int16_t *attackIdx ); +#ifndef FIX_901_PARAMMC_DEAD_CODE static void ivas_param_mc_enc_find_icc_map( PARAM_MC_ENC_HANDLE hParamMC, float Cx_sum[][PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], float Cy_sum[][MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float ILD_q[PARAM_MC_MAX_PARAMETER_BANDS][PARAM_MC_SZ_ILD_MAP], const int16_t nchan_input, const int16_t nchan_transport ); +#endif static void ivas_param_mc_quantize_iccs( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], const int16_t freq_idx, const int16_t nchan_input, int16_t *ICC_idx_out ); static void ivas_param_mc_quantize_ilds( PARAM_MC_ENC_HANDLE hParamMC, float Cy[MAX_CICP_CHANNELS][MAX_CICP_CHANNELS], float Cx[PARAM_MC_MAX_TRANSPORT_CHANS][PARAM_MC_MAX_TRANSPORT_CHANS], const int16_t freq_idx, const int16_t nchan_input, const int16_t nchan_transport, int16_t *ILD_idx_out, float ILD_q[PARAM_MC_SZ_ILD_MAP] ); @@ -86,7 +88,10 @@ ivas_error ivas_param_mc_enc_open( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ) { - int16_t i, k, l; + int16_t i; +#ifndef FIX_901_PARAMMC_DEAD_CODE + int16_t k, l; +#endif IVAS_FB_CFG *fb_cfg; PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; @@ -152,8 +157,12 @@ ivas_error ivas_param_mc_enc_open( } /* open/init parameter coding */ +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); - +#else + ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); +#endif +#ifndef FIX_901_PARAMMC_DEAD_CODE /* init icc index states */ for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) { @@ -170,6 +179,7 @@ ivas_error ivas_param_mc_enc_open( } } } +#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) @@ -235,7 +245,10 @@ ivas_error ivas_param_mc_enc_reconfig( Encoder_Struct *st_ivas /* i/o: IVAS encoder handle */ ) { - int16_t i, k, l; + int16_t i; +#ifndef FIX_901_PARAMMC_DEAD_CODE + int16_t k, l; +#endif PARAM_MC_ENC_HANDLE hParamMC; uint16_t config_index; MC_LS_SETUP mc_input_setup; @@ -280,6 +293,7 @@ ivas_error ivas_param_mc_enc_reconfig( /* get dmx factors */ hParamMC->dmx_factors = ivas_param_mc_conf[config_index].dmx_fac; +#ifndef FIX_901_PARAMMC_DEAD_CODE /* deallocate the full icc map, gets newly allocated in the metadata open function */ for ( i = 0; i < 2; i++ ) { @@ -293,9 +307,15 @@ ivas_error ivas_param_mc_enc_reconfig( } } +#endif /* open/init parameter coding */ +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_open( mc_input_setup, hParamMC->lfe_index, ivas_total_brate, &hParamMC->hMetadataPMC ); +#else + ivas_param_mc_metadata_open( mc_input_setup, ivas_total_brate, &hParamMC->hMetadataPMC ); +#endif +#ifndef FIX_901_PARAMMC_DEAD_CODE /* init icc index states */ for ( i = 0; i < PARAM_MC_PARAMETER_FRAMES; i++ ) { @@ -313,6 +333,7 @@ ivas_error ivas_param_mc_enc_reconfig( } } +#endif /* Band Grouping */ if ( hParamMC->hMetadataPMC.num_parameter_bands == 20 ) { @@ -375,8 +396,9 @@ void ivas_param_mc_enc_close( return; } +#ifndef FIX_901_PARAMMC_DEAD_CODE ivas_param_mc_metadata_close( &( *hParamMC )->hMetadataPMC ); - +#endif ivas_FB_mixer_close( &( *hParamMC )->hFbMixer, sampling_rate, 0 ); free( ( *hParamMC ) ); @@ -510,6 +532,7 @@ void ivas_param_mc_enc( ivas_param_mc_quantize_ilds( hParamMC, Cy_sum[k], Cx_sum[k], k, nchan_inp, st_ivas->nchan_transport, ILD_idx, ILD_q[k] ); } +#ifndef FIX_901_PARAMMC_DEAD_CODE /* get icc map */ if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) { @@ -520,6 +543,7 @@ void ivas_param_mc_enc( ivas_param_mc_default_icc_map( hParamMC->hMetadataPMC.icc_mapping_conf, hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx] ); } +#endif /* ICC parameter quantization */ for ( k = 0; k < hParamMC->hMetadataPMC.nbands_coded; k += band_step ) { @@ -986,7 +1010,7 @@ static void ivas_param_mc_param_est_enc( return; } - +#ifndef FIX_901_PARAMMC_DEAD_CODE /*------------------------------------------------------------------------- * ivas_param_mc_enc_find_icc_map() * @@ -1209,7 +1233,7 @@ static void ivas_param_mc_enc_find_icc_map( return; } - +#endif /*------------------------------------------------------------------------- * ivas_param_mc_quantize_ilds() @@ -1447,8 +1471,13 @@ static void ivas_param_mc_quantize_iccs( /* Reduce set of parameters and quantize them */ for ( k = 0; k < num_iccs_to_code; ++k ) { +#ifndef FIX_901_PARAMMC_DEAD_CODE tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][0]; tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping[hParamMC->hMetadataPMC.param_frame_idx][k][1]; +#else + tmp_map[0] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][0]; + tmp_map[1] = hParamMC->hMetadataPMC.icc_mapping_conf->icc_mapping[k][1]; +#endif ICC_vect[k] = Cy[tmp_map[0]][tmp_map[1]]; } @@ -1626,6 +1655,7 @@ static void ivas_param_mc_write_bs( nbands = hParamMC->hMetadataPMC.nbands_coded / band_step + ( ( hParamMC->hMetadataPMC.nbands_coded % band_step ) ? 1 : 0 ); } +#ifndef FIX_901_PARAMMC_DEAD_CODE /* Encoding of the ICC mapping done as simple bitmap */ if ( hParamMC->hMetadataPMC.flag_use_adaptive_icc_map == 1 ) { @@ -1644,6 +1674,7 @@ static void ivas_param_mc_write_bs( *bit_pos += hParamMC->hMetadataPMC.icc_map_size_full - 1; } +#endif ivas_param_mc_encode_parameter( ICC_idx, &hParamMC->hMetadataPMC, &hParamMC->hMetadataPMC.icc_coding, nbands, band_step, icc_map_size_wo_lfe, icc_map_size, bit_buffer, bit_pos );