diff --git a/apps/decoder.c b/apps/decoder.c index 31d34ee4f010520d80a60b8698558fb18c0070d2..49a4028376f6bab6c4fa5c64bd5f6b2b9529ff83 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -150,9 +150,7 @@ typedef struct AcousticEnvironmentSequence aeSequence; bool dpidEnabled; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; -#ifdef OBJ_EDITING_COMMANDLINE bool objEditEnabled; -#endif } DecArguments; @@ -434,13 +432,8 @@ int main( asked_frame_size = arg.renderFramesize; uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535; -#ifdef OBJ_EDITING_COMMANDLINE if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain, - arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -1017,10 +1010,8 @@ static bool parseCmdlIVAS_dec( arg->directivityPatternId[i] = 65535; } -#ifdef OBJ_EDITING_COMMANDLINE arg->objEditEnabled = false; -#endif /*-----------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -1473,13 +1464,11 @@ static bool parseCmdlIVAS_dec( i += tmp; } -#ifdef OBJ_EDITING_COMMANDLINE else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 ) { arg->objEditEnabled = true; i++; } -#endif /*-----------------------------------------------------------------* * Option not recognized @@ -1681,9 +1670,7 @@ static void usage_dec( void ) fprintf( stdout, "-aeid ID | File : Acoustic environment ID (number > 0)\n" ); fprintf( stdout, " alternatively, it can be a text file where each line contains \"ID duration\"\n" ); fprintf( stdout, " for BINAURAL_ROOM_REVERB output configuration.\n" ); -#ifdef OBJ_EDITING_COMMANDLINE fprintf( stdout, "-obj_edit : Enable objects editing\n" ); -#endif fprintf( stdout, "-level level : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" ); fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 9dd281928367fb0c7dbd5fbaf2ef48c49ab859d3..1331d60b26ca5a6ea89e1597aadd44f348bc19bc 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -2624,11 +2624,6 @@ ivas_error preview_indices( case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; break; -#ifndef FIX_1209_SID_SIGNALING - case SID_MULTICHANNEL: - st_ivas->ivas_format = MC_FORMAT; - break; -#endif case SID_SBA_1TC: st_ivas->ivas_format = SBA_FORMAT; st_ivas->element_mode_init = IVAS_SCE; @@ -2653,9 +2648,6 @@ ivas_error preview_indices( } break; default: -#ifndef FIX_1209_SID_SIGNALING - /* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ -#endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format ); } } diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 4a56f13237d705f003845e39439d254ee578bda7..db01bdfe894233951cc49a8e2f8153a44f8cb5ac 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -233,11 +233,7 @@ typedef enum #define SID_MDCT_STEREO 0x1 /* 1| 0| 0 */ #define SID_ISM 0x2 /* 0| 1| 0 */ #define SID_MASA_1TC 0x3 /* 1| 1| 0 */ -#ifdef FIX_1209_SID_SIGNALING /*reserved*/ /*0x4*/ /* 0| 0| 1 */ -#else -#define SID_MULTICHANNEL 0x4 /* 0| 0| 1 */ -#endif #define SID_SBA_1TC 0x5 /* 1| 0| 1 */ #define SID_SBA_2TC 0x6 /* 0| 1| 1 */ #define SID_MASA_2TC 0x7 /* 1| 1| 1 */ diff --git a/lib_com/options.h b/lib_com/options.h index f7f4bc74e4a7c6207548663c4f4332e8e4650d35..51db29c99c91e00c1888a00c7fcb2ecc3cfadf4f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,15 +154,12 @@ /* ################## Start DEVELOPMENT switches ######################### */ -#define OBJ_EDITING_COMMANDLINE /* obj editing command-line option */ -#define FIX_BRATE_SWITCHING /* VA: fix bitrate switching cases in OMASA and OSBA */ /* ################### Start BE switches ################################# */ /* only BE switches wrt selection floating point code */ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1209_SID_SIGNALING /* VA: issue 1209: remove dead code in IVAS SID signaling */ /* #################### End BE switches ################################## */ @@ -173,11 +170,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ -#define NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT /* FhG: Fix issue 1212, zero IGF spec also in 1st concealed frame */ -#define NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING /* FhG: fixes for decoder-side noise level estimation in MDCT-Stereo to prevent noise bursts in stereo switching */ -#define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ -#define NONBE_FIX_1205_TD_STEREO_MOD_CT /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */ -#define NONBE_1203_MDCT2DFT_SWITCHING /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 11516f7963cdf031865796615f1fb34e50d43d1a..2c7e004342f348c15a5bb09eb046b444255158aa 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -108,9 +108,7 @@ ivas_error ivas_dec_get_format( int32_t ivas_total_brate; uint16_t *bit_stream_orig; AUDIO_CONFIG signaled_config; -#ifdef FIX_1209_SID_SIGNALING ivas_error error; -#endif num_bits_read = 0; element_mode_flag = 0; @@ -122,14 +120,10 @@ ivas_error ivas_dec_get_format( * Read IVAS format *-------------------------------------------------------------------*/ -#ifdef FIX_1209_SID_SIGNALING if ( ( error = ivas_read_format( st_ivas, &num_bits_read ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_read_format( st_ivas, &num_bits_read ); -#endif if ( st_ivas->ini_frame > 0 && st_ivas->ivas_format != st_ivas->last_ivas_format && !( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_ISM_FORMAT ) && @@ -487,14 +481,10 @@ ivas_error ivas_dec_setup( * Read IVAS format *-------------------------------------------------------------------*/ -#ifdef FIX_1209_SID_SIGNALING if ( ( error = ivas_read_format( st_ivas, &num_bits_read ) ) != IVAS_ERR_OK ) { return error; } -#else - ivas_read_format( st_ivas, &num_bits_read ); -#endif /*-------------------------------------------------------------------* * Read other signling (ISM/MC mode, number of channels, etc.) @@ -1016,11 +1006,6 @@ static ivas_error ivas_read_format( case SID_ISM: st_ivas->ivas_format = ISM_FORMAT; break; -#ifndef FIX_1209_SID_SIGNALING - case SID_MULTICHANNEL: - st_ivas->ivas_format = MC_FORMAT; - break; -#endif case SID_SBA_1TC: st_ivas->ivas_format = SBA_FORMAT; st_ivas->element_mode_init = IVAS_SCE; @@ -1045,9 +1030,6 @@ static ivas_error ivas_read_format( } break; default: -#ifndef FIX_1209_SID_SIGNALING - /* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */ -#endif return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format ); } @@ -3253,19 +3235,13 @@ static ivas_error doSanityChecks_IVAS( } } -#ifdef OBJ_EDITING_COMMANDLINE if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on ) { -#ifdef FIX_BRATE_SWITCHING if ( !( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) ) -#else - if ( !( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) ) -#endif { return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Wrong set-up: Obect editing is not supported in this IVAS format." ); } } -#endif #ifdef DEBUGGING if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) { diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index e66e1c9d434cd881bbdc948d00d4ecc1f0c82989..cdc130b191655ab1de30b583eb08556a4b268488 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -111,39 +111,33 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->hDecoderConfig->output_config ); } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH + /* transfer subframe info from DirAC or ParamMC to central tc buffer */ + /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ + if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) { -#endif - /* transfer subframe info from DirAC or ParamMC to central tc buffer */ - /* only do this if we are not having done everything already in the TC decoding part and having only played out from the TC buffer */ - if ( last_ism_mode == ISM_MODE_PARAM && st_ivas->hSpatParamRendCom != NULL && st_ivas->hTcBuffer->tc_buffer_mode != TC_BUFFER_MODE_BUFFER ) - { - st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; - st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; - st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; - st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; - mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } + st_ivas->hTcBuffer->nb_subframes = st_ivas->hSpatParamRendCom->nb_subframes; + st_ivas->hTcBuffer->subframes_rendered = st_ivas->hSpatParamRendCom->subframes_rendered; + st_ivas->hTcBuffer->num_slots = st_ivas->hSpatParamRendCom->num_slots; + st_ivas->hTcBuffer->slots_rendered = st_ivas->hSpatParamRendCom->slots_rendered; + mvs2s( st_ivas->hSpatParamRendCom->subframe_nbslots, st_ivas->hTcBuffer->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); + } - /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv - render what still fits in the new granularity */ - tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); + /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv + render what still fits in the new granularity */ + tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); - if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) - { - /* flush already done in IVAS_DEC_ReadFormat() */ - } - /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ - else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) + if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) + { + /* flush already done in IVAS_DEC_ReadFormat() */ + } + /* JBM: when granularity goes up set samples to discard at the beginning of the frame */ + else if ( tc_granularity_new > st_ivas->hTcBuffer->n_samples_granularity ) + { + if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) { - if ( ( error = ivas_jbm_dec_set_discard_samples( st_ivas ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH } -#endif if ( st_ivas->ism_mode != last_ism_mode ) { @@ -293,64 +287,52 @@ static ivas_error ivas_ism_bitrate_switching_dec( * floating-point output audio buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - { -#endif - nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); + nchan_out_buff = ivas_get_nchan_buffers_dec( st_ivas, -1, -1 ); - if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) - { - return error; - } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH + if ( ( error = ivas_output_buff_dec( st_ivas->p_output_f, nchan_out_buff_old, nchan_out_buff ) ) != IVAS_ERR_OK ) + { + return error; } -#endif /*-----------------------------------------------------------------* * JBM TC buffers *-----------------------------------------------------------------*/ -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH - { -#endif - int16_t tc_nchan_full_new; - DECODER_TC_BUFFER_HANDLE hTcBuffer; + int16_t tc_nchan_full_new; + DECODER_TC_BUFFER_HANDLE hTcBuffer; - hTcBuffer = st_ivas->hTcBuffer; - tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); - tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); - tc_nchan_allocate_new = tc_nchan_tc_new; - tc_nchan_full_new = tc_nchan_tc_new; + hTcBuffer = st_ivas->hTcBuffer; + tc_buffer_mode_new = ivas_jbm_dec_get_tc_buffer_mode( st_ivas ); + tc_nchan_tc_new = ivas_jbm_dec_get_num_tc_channels( st_ivas ); + tc_nchan_allocate_new = tc_nchan_tc_new; + tc_nchan_full_new = tc_nchan_tc_new; - if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) - { - tc_nchan_full_new = 0; - } + if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX && st_ivas->renderer_type != RENDERER_DISABLE && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM ) ) + { + tc_nchan_full_new = 0; + } - /* reconfigure buffer */ - if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_jbm != tc_nchan_tc_new || - hTcBuffer->nchan_buffer_full != tc_nchan_full_new || hTcBuffer->nchan_transport_internal != tc_nchan_allocate_new ) + /* reconfigure buffer */ + if ( hTcBuffer->tc_buffer_mode != tc_buffer_mode_new || hTcBuffer->nchan_transport_jbm != tc_nchan_tc_new || + hTcBuffer->nchan_buffer_full != tc_nchan_full_new || hTcBuffer->nchan_transport_internal != tc_nchan_allocate_new ) + { + if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode_new, tc_nchan_tc_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ) != IVAS_ERR_OK ) { - if ( ( error = ivas_jbm_dec_tc_buffer_reconfigure( st_ivas, tc_buffer_mode_new, tc_nchan_tc_new, tc_nchan_allocate_new, tc_nchan_full_new, tc_granularity_new ) ) != IVAS_ERR_OK ) - { - return error; - } + return error; } + } - /* transfer subframe info from central tc buffer to ParamMC or McMASA (DirAC) */ - if ( st_ivas->hSpatParamRendCom != NULL ) - { - st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes; - st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; - st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; - st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; + /* transfer subframe info from central tc buffer to ParamMC or McMASA (DirAC) */ + if ( st_ivas->hSpatParamRendCom != NULL ) + { + st_ivas->hSpatParamRendCom->nb_subframes = st_ivas->hTcBuffer->nb_subframes; + st_ivas->hSpatParamRendCom->subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; + st_ivas->hSpatParamRendCom->num_slots = st_ivas->hTcBuffer->num_slots; + st_ivas->hSpatParamRendCom->slots_rendered = st_ivas->hTcBuffer->slots_rendered; - mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); - } -#ifndef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH + mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS ); } -#endif return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 787802f9e73b1483ad6cad9709f01eb2d1950799..c4a146cb4568bc904dd15f4c5afee919b9efcae5 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1007,9 +1007,7 @@ typedef struct decoder_config_structure int16_t Opt_ExternalOrientation; /* indicates whether external orientations are used */ int16_t Opt_dpid_on; /* indicates whether Directivity pattern option is used */ int16_t Opt_aeid_on; /* indicates whether Acoustic environment option is used */ -#ifdef OBJ_EDITING_COMMANDLINE - int16_t Opt_ObjEdit_on; /* indicates whether object editing option is used */ -#endif + int16_t Opt_ObjEdit_on; /* indicates whether object editing option is used */ #ifdef DEBUGGING /* temp. development parameters */ int16_t force_rend; /* forced TD/CLDFB binaural renderer (for ISM and MC) */ diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index 20e4dcc8a07021f223ff0a4c74fdd69d1436d644..21817b7e02dafa5405bebafa535546194849107c 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -620,47 +620,27 @@ static void run_min_stats( computed only once (for ch == 0) and not again in the second run sive the outcome will be the same anyway */ if ( ( will_estimate_noise_on_channel[0] == will_estimate_noise_on_channel[1] ) || ch == 0 ) { -#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING float power_spec_scale_fac; /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */ power_spec_scale_fac = 1.f / (float) ( L_FRAME16k * L_FRAME16k ); power_spec[0] = spec_in[0] * spec_in[0] * power_spec_scale_fac; power_spec[L_FRAME16k - 1] = spec_in[L_FRAME16k - 1] * spec_in[L_FRAME16k - 1] * power_spec_scale_fac; -#else - /* calculate power spectrum from MDCT coefficients and estimated MDST coeffs */ - power_spec[0] = spec_in[0] * spec_in[0]; - power_spec[L_FRAME16k - 1] = spec_in[L_FRAME16k - 1] * spec_in[L_FRAME16k - 1]; -#endif for ( int16_t i = 1; i < L_FRAME16k - 1; i++ ) { float mdst; mdst = spec_in[i + 1] - spec_in[i - 1]; -#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING power_spec[i] = power_spec_scale_fac * ( spec_in[i] * spec_in[i] + mdst * mdst ); -#else - power_spec[i] = spec_in[i] * spec_in[i] + mdst * mdst; -#endif } } -#ifndef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING - - noisy_speech_detection( st->hFdCngDec, st->VAD && st->m_frame_type == ACTIVE_FRAME, power_spec ); - - st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = 0.99f * st->hFdCngDec->hFdCngCom->likelihood_noisy_speech + 0.01f * (float) st->hFdCngDec->hFdCngCom->flag_noisy_speech; - - st->lp_noise = st->hFdCngDec->lp_noise; -#endif } -#ifdef NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING if ( st->core == TCX_20_CORE ) { noisy_speech_detection( st->hFdCngDec, save_VAD[ch] && st->m_frame_type == ACTIVE_FRAME, x[ch][0] ); st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = 0.99f * st->hFdCngDec->hFdCngCom->likelihood_noisy_speech + 0.01f * (float) st->hFdCngDec->hFdCngCom->flag_noisy_speech; st->lp_noise = st->hFdCngDec->lp_noise; } -#endif if ( will_estimate_noise_on_channel[0] || will_estimate_noise_on_channel[1] || st->bfi ) { diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 9fe3a8132ebbc3fa58ed66379dc0d53a998c6206..1a5b990930213313765915fbc096734ac1638a0b 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -313,9 +313,7 @@ static void init_decoder_config( hDecoderConfig->Opt_ExternalOrientation = 0; hDecoderConfig->Opt_dpid_on = 0; hDecoderConfig->Opt_aeid_on = 0; -#ifdef OBJ_EDITING_COMMANDLINE hDecoderConfig->Opt_ObjEdit_on = 0; -#endif return; } @@ -430,10 +428,8 @@ ivas_error IVAS_DEC_Configure( const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ -#ifdef OBJ_EDITING_COMMANDLINE - const bool objEditEnabled, /* i : enable object editing */ -#endif - const bool delayCompensationEnabled /* i : enable delay compensation */ + const bool objEditEnabled, /* i : enable object editing */ + const bool delayCompensationEnabled /* i : enable delay compensation */ ) { Decoder_Struct *st_ivas; @@ -491,9 +487,7 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->Opt_ExternalOrientation = enableExternalOrientation; hDecoderConfig->Opt_dpid_on = (int16_t) dpidEnabled; hDecoderConfig->Opt_aeid_on = acousticEnvironmentId != 65535 ? TRUE : FALSE; -#ifdef OBJ_EDITING_COMMANDLINE hDecoderConfig->Opt_ObjEdit_on = (int16_t) objEditEnabled; -#endif if ( renderFramesize == IVAS_RENDER_FRAMESIZE_UNKNOWN ) { @@ -1006,11 +1000,7 @@ ivas_error IVAS_DEC_ReadFormat( /* JBM: when granularity goes down (e.g. Discrete ISM with TD Obj Renderer -> ParamISM with binaural fastconv render what still fits in the new granularity */ int16_t tc_granularity_new = ivas_jbm_dec_get_render_granularity( st_ivas->renderer_type, st_ivas->ivas_format, st_ivas->mc_mode, st_ivas->hDecoderConfig->output_Fs ); -#ifdef NONBE_1200_ISM_JBM_BRATE_SW_FLUSH st_ivas->nchan_transport = nchan_transport_old; -#else - // st_ivas->nchan_transport = nchan_transport_old; // ToDo: temporarily deactivated to keep FIX_HRTF_LOAD bit-exact but this is likely a bug in the main -> see issue #1200 -#endif if ( tc_granularity_new < st_ivas->hTcBuffer->n_samples_granularity ) { if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, tc_granularity_new, renderer_type_old, intern_config_old, &st_ivas->hIntSetup, mc_mode_old, ism_mode_old, &hIvasDec->nSamplesFlushed, pcm_type_API_to_internal( hIvasDec->pcmType ), hIvasDec->flushbuffer ) ) != IVAS_ERR_OK ) @@ -1189,16 +1179,10 @@ ivas_error IVAS_DEC_GetEditableParameters( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef FIX_BRATE_SWITCHING if ( !( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || ( hIvasDec->st_ivas->ivas_format == MASA_FORMAT && hIvasDec->st_ivas->nchan_ism > 0 ) ) ) -#else - if ( !( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || - ( hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT && hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) || - ( hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT && ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) ) -#endif { return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing is not supported in this operation mode." ); } @@ -1324,17 +1308,10 @@ ivas_error IVAS_DEC_SetEditableParameters( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } -#ifdef FIX_BRATE_SWITCHING if ( !( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT || ( hIvasDec->st_ivas->ivas_format == MASA_FORMAT && hIvasDec->st_ivas->nchan_ism > 0 ) ) ) -#else - if ( !( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || - ( hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT && hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) || - ( hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT && ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) ) || - hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) -#endif { return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing no supported in this operation mode." ); } @@ -4127,13 +4104,11 @@ static ivas_error printConfigInfo_dec( { fprintf( stdout, "Acoustic environment ID:ON\n" ); } -#ifdef OBJ_EDITING_COMMANDLINE if ( st_ivas->hDecoderConfig->Opt_ObjEdit_on ) { fprintf( stdout, "Objects editing : ON\n" ); } -#endif } /*-----------------------------------------------------------------* diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 1345602deecb9e1a7541eaa2365bc5bc188793aa..666a08bdb2a02ed95c8142d8ec67a4818566e048 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -134,9 +134,7 @@ ivas_error IVAS_DEC_Configure( const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ const bool dpidEnabled, /* i : enable directivity pattern option */ const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ -#ifdef OBJ_EDITING_COMMANDLINE const bool objEditEnabled, /* i : enable object editing */ -#endif const bool delayCompensationEnabled /* i : enable delay compensation */ ); diff --git a/lib_dec/tonalMDCTconcealment.c b/lib_dec/tonalMDCTconcealment.c index 12b5236964ac1c3f4f6f60bde8b9f0eef8700d05..9238a740b70aac3a0402e36044a0f04fd383ece5 100644 --- a/lib_dec/tonalMDCTconcealment.c +++ b/lib_dec/tonalMDCTconcealment.c @@ -545,11 +545,7 @@ void TonalMDCTConceal_InsertNoise( for ( l = crossOverFreq; l < hTonalMDCTConc->lastBlockData.nSamples; l++ ) { -#ifdef NONBE_FIX_1212_TONAL_MDCT_CONCEALMENT mdctSpectrum[l] = 0.0f; -#else - mdctSpectrum[l] = hTonalMDCTConc->lastBlockData.spectralData[l]; -#endif } } /* actual fadeout is done in this case */ diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index f302b71765cf30c4b352aa3f65cc6ce0fb6d42bf..306aaf74b6581a0f503e399273a457fc05cb709e 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -216,16 +216,12 @@ void ivas_decision_matrix_enc( { st->core = ACELP_CORE; -#ifdef NONBE_FIX_1205_TD_STEREO_MOD_CT /* In TD stereo below 24.4 kbps we cannot overwrite the `coder_type` when it is set to TRANSITION, */ /* as it is used for TD stereo bit allocation. To ensure consistent bit allocation, it must remain unchanged on the decoder side. */ if ( st->idchan == 0 && !( element_brate < IVAS_24k4 && st->coder_type == TRANSITION && st->element_mode == IVAS_CPE_TD ) ) { st->coder_type = AUDIO; } -#else - st->coder_type = AUDIO; -#endif st->sp_aud_decision2 = 0; @@ -476,7 +472,6 @@ void ivas_signaling_enc( if ( st->core == ACELP_CORE ) { -#ifdef NONBE_FIX_1205_TD_STEREO_MOD_CT /* write coder type */ push_indice( hBstr, IND_ACELP_SIGNALLING, st->coder_type, 3 ); @@ -485,20 +480,6 @@ void ivas_signaling_enc( /* write sharpening flag */ push_indice( hBstr, IND_SHARP_FLAG, st->sharpFlag, 1 ); } -#else - if ( element_brate < FRMT_SHP_MIN_BRATE_IVAS ) - { - push_indice( hBstr, IND_ACELP_SIGNALLING, st->coder_type, 3 ); - } - else - { - /* write coder type */ - push_indice( hBstr, IND_ACELP_SIGNALLING, st->coder_type, 3 ); - - /* write sharpening flag */ - push_indice( hBstr, IND_SHARP_FLAG, st->sharpFlag, 1 ); - } -#endif /* write extension layer flag to distinguish between TBE (0) and BWE (1) */ if ( st->extl_brate > 0 ) diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index c4ad5e3c9cadae7f1c40fcf244126a462d78312b..5726126900208467608d9d2993f38eefffb89073 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -161,11 +161,6 @@ void ivas_write_format_sid( case ISM_FORMAT: ind = SID_ISM; break; -#ifndef FIX_1209_SID_SIGNALING - case MC_FORMAT: - ind = SID_MULTICHANNEL; - break; -#endif case SBA_FORMAT: switch ( element_mode ) { diff --git a/lib_enc/ivas_stereo_dft_td_itd.c b/lib_enc/ivas_stereo_dft_td_itd.c index bab1b1d6fd6f520a4827ff1721419116a3272c94..f9bb6ef5e3d8ea7947026c0e7c9212b6379b0153 100755 --- a/lib_enc/ivas_stereo_dft_td_itd.c +++ b/lib_enc/ivas_stereo_dft_td_itd.c @@ -399,9 +399,7 @@ void stereo_td_itd_mdct_stereo( float bin_nrgR[STEREO_DFT_N_32k_ENC]; float DFT[CPE_CHANNELS][STEREO_DFT_N_MAX_ENC]; STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct; -#ifdef NONBE_1203_MDCT2DFT_SWITCHING int16_t dft_ovl; -#endif if ( hCPE->hStereoMdct != NULL && hCPE->hStereoMdct->hItd != NULL ) { @@ -430,7 +428,6 @@ void stereo_td_itd_mdct_stereo( stereo_td_itd( hStereoMdct->hItd, NULL, 1, hStereoMdct->hDft_ana->dft_ovl, hCPE->hCoreCoder, input_frame, hCPE->input_mem ); #endif } -#ifdef NONBE_1203_MDCT2DFT_SWITCHING else if ( hCPE->input_mem[0] != NULL ) { dft_ovl = STEREO_DFT_OVL_MAX * input_frame / L_FRAME48k; @@ -440,7 +437,6 @@ void stereo_td_itd_mdct_stereo( mvr2r( hCPE->hCoreCoder[i]->input + input_frame - dft_ovl, hCPE->input_mem[i], dft_ovl ); } } -#endif return; } diff --git a/lib_enc/ivas_stereo_switching_enc.c b/lib_enc/ivas_stereo_switching_enc.c index d5cf09e509899845c29fe6a23c5221a221129e71..9ca3a8bd86d2b9aff8e8ffa9b695649de56210eb 100644 --- a/lib_enc/ivas_stereo_switching_enc.c +++ b/lib_enc/ivas_stereo_switching_enc.c @@ -625,9 +625,7 @@ void stereo_switching_enc( dft_ovl = STEREO_DFT_OVL_MAX * input_frame / L_FRAME48k; /* update DFT analysis overlap memory */ -#ifdef NONBE_1203_MDCT2DFT_SWITCHING /* note: in MDCT stereo, the update is done in stereo_td_itd_mdct_stereo() */ -#endif if ( hCPE->element_mode > IVAS_CPE_DFT && hCPE->input_mem[0] != NULL && hCPE->element_mode != IVAS_CPE_MDCT ) { for ( n = 0; n < CPE_CHANNELS; n++ ) diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index 5ba900a6aa9f44f6ab2a4fd94a148db63a603d26..d599a51ef10d6b106ead26b2ce8af0357ef85b6e 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -449,7 +449,6 @@ void tdm_configure_enc( } mod_ct = AUDIO; -#ifdef NONBE_FIX_1205_TD_STEREO_MOD_CT if ( hCPE->element_brate < IVAS_24k4 ) { /* In TD stereo, the TRANSITION mode has a specific bit allocation. All other formats share the same bit allocation. For these other formats, `mod_ct` is set to AUDIO to aid in debugging, though it does not have any functional impact. */ @@ -464,21 +463,6 @@ void tdm_configure_enc( mod_ct = TRANSITION; } } -#else - if ( hCPE->element_brate < IVAS_24k4 ) - { - mod_ct = sts[0]->coder_type; - /* Only sure TRANSITION coding modes are important for bit allocation, otherwise mod_ct is set to AUDIO only to easy debugging if needed */ - if ( ( ( sts[0]->last_L_frame >= L_FRAME16k && sts[0]->flag_ACELP16k == 0 ) || ( sts[0]->last_L_frame == L_FRAME && sts[0]->flag_ACELP16k == 1 ) ) && sts[0]->last_core_brate != FRAME_NO_DATA && sts[0]->last_core_brate != SID_2k40 && sts[0]->coder_type_raw != VOICED /*in case of CNG, this code is not reached sts[0]->core_brate != FRAME_NO_DATA && sts[0]->core_brate != SID_2k40 &&*/ ) - { - mod_ct = TRANSITION; - } - else if ( sts[0]->sp_aud_decision1 == 1 || sts[0]->sp_aud_decision2 == 1 || mod_ct != TRANSITION ) - { - mod_ct = AUDIO; - } - } -#endif /* Correction of tdm_inst_ratio_idx in case of TC in the seecondary channel */ if ( hStereoTD->flag_skip_DMX == 0 && hStereoTD->tdm_LRTD_flag == 1 && sts[1]->tc_cnt > 1 /*&& abs(hStereoTD->tdm_inst_ratio_idx-LRTD_STEREO_MID_IS_PRIM) > 5*/ )