From 0d803d80386fd3ba5f2a16669549f63652cf4711 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 8 Nov 2024 13:13:28 +0100 Subject: [PATCH 01/40] issue 1211: fix crash in MASA DTX bitrate switching - possible fix, under NONBE_1211_DTX_BR_SWITCHING --- lib_com/ivas_prot.h | 5 ++++- lib_com/options.h | 2 +- lib_com/prot.h | 7 +++++-- lib_enc/amr_wb_enc.c | 6 ++++++ lib_enc/dtx.c | 30 +++++++++++++++++++++++++++++- lib_enc/ivas_core_pre_proc_front.c | 11 +++++++++-- lib_enc/ivas_cpe_enc.c | 4 ++++ lib_enc/ivas_front_vad.c | 5 +++++ lib_enc/ivas_ism_enc.c | 4 ++++ lib_enc/ivas_sce_enc.c | 4 ++++ lib_enc/pre_proc.c | 6 ++++++ 11 files changed, 77 insertions(+), 7 deletions(-) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 847cb924f4..127e55cb91 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -202,7 +202,10 @@ ivas_error pre_proc_front_ivas( const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision*/ const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ + const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif const int32_t ivas_total_brate /* i : IVAS total bitrate */ ); diff --git a/lib_com/options.h b/lib_com/options.h index b82706a7eb..6ae4320197 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -198,7 +198,7 @@ #define FIX_1206_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */ #define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */ #define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ - +#define NONBE_1211_DTX_BR_SWITCHING /* VA: issue 1211: fix crash in MASA DTX bitrate switching */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_com/prot.h b/lib_com/prot.h index 1df0eb7838..f5cdd2a039 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -3918,8 +3918,11 @@ void td_cng_enc_init( ); void dtx( - Encoder_State *st, /* i/o: encoder state structure */ - const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + Encoder_State *st, /* i/o: encoder state structure */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t vad, /* i : VAD flag for DTX */ const float speech[] /* i : Pointer to the speech frame */ ); diff --git a/lib_enc/amr_wb_enc.c b/lib_enc/amr_wb_enc.c index 07f6cb221f..1791daf851 100644 --- a/lib_enc/amr_wb_enc.c +++ b/lib_enc/amr_wb_enc.c @@ -310,7 +310,13 @@ void amr_wb_enc( { st->fd_cng_reset_flag = 0; } + +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, -1, -1, vad_flag_dtx, inp ); +#else dtx( st, -1, vad_flag_dtx, inp ); +#endif + /*----------------------------------------------------------------* * Noise energy down-ward update and total noise energy estimation * Long-term energies and relative frame energy updates diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 721cec90c3..c1f3abf40c 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -78,7 +78,10 @@ static void update_SID_cnt( DTX_ENC_HANDLE hDtxEnc, const int32_t core_brate, co *-------------------------------------------------------------------*/ void dtx( - Encoder_State *st, /* i/o: encoder state structure */ + Encoder_State *st, /* i/o: encoder state structure */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif const int32_t ivas_total_brate, /* i : IVAS total bitrate */ const int16_t vad, /* i : VAD flag for DTX */ const float speech[] /* i : Pointer to the speech frame */ @@ -87,6 +90,12 @@ void dtx( float alpha; DTX_ENC_HANDLE hDtxEnc = st->hDtxEnc; int16_t last_br_cng_flag, last_br_flag, br_dtx_flag; +#ifdef NONBE_1211_DTX_BR_SWITCHING + int32_t total_brate_ref; + + total_brate_ref = st->total_brate; +#endif + if ( st->dtx_sce_sba != 0 ) { last_br_cng_flag = 1; @@ -96,7 +105,13 @@ void dtx( else { last_br_cng_flag = st->last_total_brate_cng <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate_cng <= MAX_BRATE_DTX_IVAS ); +#ifdef NONBE_1211_DTX_BR_SWITCHING + last_br_flag = ( st->element_mode == EVS_MONO && st->last_total_brate <= MAX_BRATE_DTX_EVS ) || + ( st->element_mode != EVS_MONO && last_ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || + st->lp_noise < 15; +#else last_br_flag = st->last_total_brate <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate <= MAX_BRATE_DTX_IVAS ); +#endif br_dtx_flag = 0; } @@ -142,6 +157,7 @@ void dtx( last_br_flag ) { st->total_brate = st->last_total_brate; + if ( !( st->total_brate == ACELP_7k20 && st->Opt_SC_VBR ) ) { st->Opt_SC_VBR = 0; @@ -172,9 +188,15 @@ void dtx( if ( st->dtx_sce_sba == 0 ) { +#ifdef NONBE_1211_DTX_BR_SWITCHING br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) || ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || st->lp_noise < 15; +#else + br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) || + ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || + st->lp_noise < 15; +#endif } if ( st->Opt_DTX_ON && vad == 0 && @@ -258,6 +280,12 @@ void dtx( reset_indices_enc( st->hBstr, st->hBstr->nb_ind_tot ); } } +#ifdef NONBE_1211_DTX_BR_SWITCHING + else if ( st->element_mode != EVS_MONO ) + { + st->total_brate = total_brate_ref; + } +#endif /*------------------------------------------------------------------------* * Reset counters when in active frame (neither SID nor FRAME_NO_DATA frame) diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index 2703c79fe7..39e0cb110b 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -108,8 +108,11 @@ ivas_error pre_proc_front_ivas( const int16_t force_front_vad, /* i : flag to force VAD decision */ const int16_t front_vad_dtx_flag, /* i : front-VAD DTX flag to overwrite VAD decision*/ const IVAS_FORMAT ivas_format, /* i : IVAS format */ - const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ - const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ + const int16_t MCT_flag, /* i : hMCT handle allocated (1) or not (0) */ +#ifdef NONBE_1211_DTX_BR_SWITCHING + const int32_t last_ivas_total_brate, /* i : last IVAS total bitrate */ +#endif + const int32_t ivas_total_brate /* i : IVAS total bitrate - for setting the DTX */ ) { float *inp_12k8, *new_inp_12k8; /* pointers to current frame and new data */ @@ -544,7 +547,11 @@ ivas_error pre_proc_front_ivas( st->cng_type = LP_CNG; } +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, last_ivas_total_brate, ivas_total_brate, *vad_flag_dtx, inp_12k8 ); +#else dtx( st, ivas_total_brate, *vad_flag_dtx, inp_12k8 ); +#endif if ( hCPE != NULL && hCPE->hStereoDft != NULL && st->core_brate == SID_2k40 ) { diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 292cbd6a5f..f1e0cebd28 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -478,7 +478,11 @@ ivas_error ivas_cpe_enc( error = pre_proc_front_ivas( NULL, hCPE, hCPE->element_brate, nb_bits_metadata, input_frame, n, old_inp_12k8[n], old_inp_16k[n], &ener[n], &relE[n], A[n], Aw[n], epsP[n], lsp_new[n], lsp_mid[n], &vad_hover_flag[n], &attack_flag[n], realBuffer[n], imagBuffer[n], old_wsp[n], pitch_fr[n], voicing_fr[n], &loc_harm[n], &cor_map_sum[n], &vad_flag_dtx[n], enerBuffer[n], +#ifdef NONBE_1211_DTX_BR_SWITCHING + fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, st_ivas->hEncoderConfig->last_ivas_total_brate, ivas_total_brate ); +#else fft_buff[n], A[0], lsp_new[0], currFlatness[n], tdm_ratio_idx, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, band_energies_LR, 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, 0, 0, ivas_format, st_ivas->hMCT != NULL, ivas_total_brate ); +#endif if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index e19211f19a..02e767d7d9 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -423,7 +423,12 @@ ivas_error front_vad_spar( noise_est_down( fr_bands[0], hFrontVad->hNoiseEst->bckr, tmpN, tmpE, st->min_band, st->max_band, &hFrontVad->hNoiseEst->totalNoise, Etot[0], &hFrontVad->hNoiseEst->Etot_last, &hFrontVad->hNoiseEst->Etot_v_h2 ); corr_shift = correlation_shift( hFrontVad->hNoiseEst->totalNoise ); +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, hEncoderConfig->last_ivas_total_brate, hEncoderConfig->ivas_total_brate, vad_flag_dtx[0], inp_12k8 ); +#else dtx( st, hEncoderConfig->ivas_total_brate, vad_flag_dtx[0], inp_12k8 ); +#endif + /* linear prediction analysis */ alw_pitch_lag_12k8[0] = st->old_pitch_la; alw_pitch_lag_12k8[1] = st->old_pitch_la; diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index c72431bd0b..da0fe388dd 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -179,7 +179,11 @@ ivas_error ivas_ism_enc( error = pre_proc_front_ivas( hSCE, NULL, hSCE->element_brate, nb_bits_metadata[sce_id], input_frame, 0, old_inp_12k8[sce_id][0], old_inp_16k[sce_id][0], &ener[sce_id][0], &relE[sce_id][0], A[sce_id][0], Aw[sce_id][0], epsP[sce_id][0], lsp_new[sce_id][0], lsp_mid[sce_id][0], &vad_hover_flag[sce_id][0], &attack_flag[sce_id][0], realBuffer[sce_id][0], imagBuffer[sce_id][0], old_wsp[sce_id][0], pitch_fr[sce_id][0], voicing_fr[sce_id][0], &loc_harm[sce_id][0], &cor_map_sum[sce_id][0], &vad_flag_dtx[sce_id][0], enerBuffer[sce_id][0], +#ifdef NONBE_1211_DTX_BR_SWITCHING + fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->last_ivas_total_brate, st_ivas->hEncoderConfig->ivas_total_brate ); +#else fft_buff[sce_id][0], A[sce_id][0], lsp_new[sce_id][0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, 0, 0, 0, 0, ISM_FORMAT, 0, st_ivas->hEncoderConfig->ivas_total_brate ); +#endif if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index 257e806195..df1d804f34 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -188,7 +188,11 @@ ivas_error ivas_sce_enc( &ener[0], &relE[0], A[0], Aw[0], epsP[0], lsp_new[0], lsp_mid[0], &vad_hover_flag[0], &attack_flag[0], realBuffer[0], imagBuffer[0], old_wsp[0], pitch_fr[0], voicing_fr[0], &loc_harm[0], &cor_map_sum[0], &vad_flag_dtx[0], enerBuffer[0], fft_buff[0], A[0], lsp_new[0], currFlatness[0], 0, fr_bands, Etot_LR, lf_E, localVAD_HE_SAD, NULL, flag_16k_smc, +#ifdef NONBE_1211_DTX_BR_SWITCHING + st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->last_ivas_total_brate, st_ivas->hEncoderConfig->ivas_total_brate ); +#else st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_flag : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->force_front_vad : 0, st_ivas->hSpar != NULL ? st_ivas->hSpar->front_vad_dtx_flag : 0, ivas_format, 0, st_ivas->hEncoderConfig->ivas_total_brate ); +#endif if ( error != IVAS_ERR_OK ) { return error; diff --git a/lib_enc/pre_proc.c b/lib_enc/pre_proc.c index 513a94b627..7db0c9c433 100644 --- a/lib_enc/pre_proc.c +++ b/lib_enc/pre_proc.c @@ -252,7 +252,13 @@ void pre_proc( /*-----------------------------------------------------------------* * Select SID or FRAME_NO_DATA frame if DTX enabled *-----------------------------------------------------------------*/ + +#ifdef NONBE_1211_DTX_BR_SWITCHING + dtx( st, -1, -1, vad_flag_dtx, inp_12k8 ); +#else dtx( st, -1, vad_flag_dtx, inp_12k8 ); +#endif + /*----------------------------------------------------------------* * Adjust FD-CNG Noise Estimator *----------------------------------------------------------------*/ -- GitLab From 21322c85257534e262ed683d357f8259ab8ce711 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 8 Nov 2024 13:41:05 +0100 Subject: [PATCH 02/40] set the 'last_br_flag' parameter only where it is needed --- lib_enc/dtx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index c1f3abf40c..452f1cf5cc 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -100,7 +100,9 @@ void dtx( { last_br_cng_flag = 1; last_br_flag = 1; +#ifndef NONBE_1211_DTX_BR_SWITCHING br_dtx_flag = 1; +#endif } else { @@ -111,8 +113,8 @@ void dtx( st->lp_noise < 15; #else last_br_flag = st->last_total_brate <= MAX_BRATE_DTX_EVS || st->lp_noise < 15 || ( st->element_mode == IVAS_SCE && st->last_total_brate <= MAX_BRATE_DTX_IVAS ); -#endif br_dtx_flag = 0; +#endif } /* Initialization */ @@ -186,6 +188,9 @@ void dtx( * Select SID or FRAME_NO_DATA frame if DTX is enabled *------------------------------------------------------------------------*/ +#ifdef NONBE_1211_DTX_BR_SWITCHING + br_dtx_flag = 1; +#endif if ( st->dtx_sce_sba == 0 ) { #ifdef NONBE_1211_DTX_BR_SWITCHING -- GitLab From b815a28d25266cb42865b050ce98794c9fb1bd75 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 18:40:26 +0100 Subject: [PATCH 03/40] issue 1225: Add disclaimer for renderer application + Add info about IVAS reference version; under FIX_1225_DISCLAIMER --- apps/renderer.c | 49 +++++++++++++++- lib_com/disclaimer.c | 3 + lib_com/options.h | 2 +- lib_dec/lib_dec.c | 4 +- lib_rend/ivas_output_init.c | 108 ++++++++++++++++++++++++++++++++++++ lib_rend/ivas_prot_rend.h | 6 ++ lib_rend/lib_rend.c | 91 ++++++++++++++++++++++++++++++ lib_rend/lib_rend.h | 16 ++++++ 8 files changed, 275 insertions(+), 4 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index f90ec711f6..4833e70943 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -737,6 +737,10 @@ int main( lfeRoutingConfigs[i] = NULL; } +#ifdef FIX_1225_DISCLAIMER + IVAS_REND_PrintDisclaimer(); + +#endif CmdlnArgs args = parseCmdlnArgs( argc, argv ); if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) || @@ -894,6 +898,49 @@ int main( exit( -1 ); } +#ifdef FIX_1225_DISCLAIMER + fprintf( stdout, "Input audio file: %s\n", args.inputFilePath ); + fprintf( stdout, "Output audio file: %s\n\n", args.outputFilePath ); + + if ( args.inConfig.numAudioObjects > 0 ) + { + if ( args.inConfig.numAudioObjects == 1 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM1 ); + } + else if ( args.inConfig.numAudioObjects == 2 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM2 ); + } + else if ( args.inConfig.numAudioObjects == 3 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM3 ); + } + else if ( args.inConfig.numAudioObjects == 4 ) + { + IVAS_REND_PrintInputConfig( IVAS_AUDIO_CONFIG_ISM4 ); + } + } + for ( i = 0; i < args.inConfig.numMultiChannelBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.multiChannelBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numMasaBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.masaBuses[i].audioConfig ); + } + for ( i = 0; i < args.inConfig.numAmbisonicsBuses; i++ ) + { + IVAS_REND_PrintInputConfig( args.inConfig.ambisonicsBuses[i].audioConfig ); + } + + if ( ( error = IVAS_REND_PrintConfig( hIvasRend ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\n IVAS_REND_PrintConfig failed: %s\n\n", ivas_error_to_string( error ) ); + goto cleanup; + } + +#endif if ( !isEmptyString( args.customHrtfFilePath ) ) { if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK ) @@ -3687,7 +3734,7 @@ static ivas_error parseLfePanMtxFile( } /* set default panning matrix to all zeros - any subsequent issue in file reading will gracefully exit the function */ + any subsequent issue in file reading will gracefully exit the function */ for ( lfe_in = 0; lfe_in < RENDERER_MAX_INPUT_LFE_CHANNELS; lfe_in++ ) { for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ ) diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 5d23ba1549..71aded4b87 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -48,6 +48,9 @@ int16_t print_disclaimer( FILE *fPtr ) fprintf( fPtr, "\n==================================================================================================\n" ); fprintf( fPtr, " IVAS Codec Baseline\n" ); +#ifdef FIX_1225_DISCLAIMER + fprintf( fPtr, " \n Initial IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); +#endif fprintf( fPtr, " \n" ); fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" ); fprintf( fPtr, " Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0\n" ); diff --git a/lib_com/options.h b/lib_com/options.h index 484de232aa..588c895397 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,7 +163,7 @@ #define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */ #define FIX_1227_Crend_HRTF_LOADING_OPTIM /* VA: issue 1227: for Crend binaural renderer in decoder, load only HTRT coefficient set that is needed */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ - +#define FIX_1225_DISCLAIMER /* VA: issue 1225: Add disclaimer for external renderer + Add info about IVAS reference version */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index a71d801ae7..796ed18ad5 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -3934,7 +3934,7 @@ const char *IVAS_DEC_GetErrorMessage( return ivas_error_to_string( error ); } - +#ifndef FIX_1225_DISCLAIMER /*---------------------------------------------------------------------* * get_channel_config() * @@ -4020,7 +4020,7 @@ static ivas_error get_channel_config( return IVAS_ERR_OK; } - +#endif /*---------------------------------------------------------------------* * printConfigInfo_dec( ) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 46025d4829..32acac0a1e 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -37,6 +37,9 @@ #include "ivas_prot_rend.h" #include "ivas_rom_com.h" #include "ivas_prot.h" +#ifdef FIX_1225_DISCLAIMER +#include +#endif #ifdef DEBUGGING #include "debug.h" #include @@ -480,3 +483,108 @@ int16_t is_split_rendering_enabled( return 0; } } + +#ifdef FIX_1225_DISCLAIMER + +/*---------------------------------------------------------------------* + * get_channel_config() + * + * Gets a str related to input config + *---------------------------------------------------------------------*/ + +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str ) +{ + if ( config == IVAS_AUDIO_CONFIG_MONO ) + { + strcpy( str, "Mono" ); + } + else if ( config == IVAS_AUDIO_CONFIG_STEREO ) + { + strcpy( str, "Stereo" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM1 ) + { + strcpy( str, "Object-based audio (1 object)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM2 ) + { + strcpy( str, "Object-based audio (2 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM3 ) + { + strcpy( str, "Object-based audio (3 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_ISM4 ) + { + strcpy( str, "Object-based audio (4 objects)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1 ) + { + strcpy( str, "Multichannel 5.1 (CICP6)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1 ) + { + strcpy( str, "Multichannel 7.1 (CICP12)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_2 ) + { + strcpy( str, "Multichannel 5.1+2 (CICP14)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_5_1_4 ) + { + strcpy( str, "Multichannel 5.1+4 (CICP16)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_7_1_4 ) + { + strcpy( str, "Multichannel 7.1+4 (CICP19)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) + { + strcpy( str, "Multichannel (custom loudspeaker layout)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_FOA ) + { + strcpy( str, "Ambisonics: First Order (FOA)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA2 ) + { + strcpy( str, "Ambisonics: Second Order (HOA2)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_HOA3 ) + { + strcpy( str, "Ambisonics: Third Order (HOA3)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL ) + { + strcpy( str, "Binaural: no room" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + { + strcpy( str, "Binaural: room with impulse responses" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + { + strcpy( str, "Binaural: room with reverb" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + { + strcpy( str, "BINAURAL_SPLIT_CODED" ); + } + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + strcpy( str, "Binaural_Split_PCM" ); + } + else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL ) + { + strcpy( str, "External renderer" ); + } + else + { + return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Incorrect Input/Output Configuration" ); + } + + return IVAS_ERR_OK; +} +#endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d4a75254a3..98d1d5ae7d 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -83,6 +83,12 @@ int16_t is_split_rendering_enabled( const IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* i : Render config data structure */ ); +#ifdef FIX_1225_DISCLAIMER +ivas_error get_channel_config( + const AUDIO_CONFIG config, + char *str +); +#endif /*----------------------------------------------------------------------------------* * TD decorr. function prototypes diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e9a13a9aa0..641e77576c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8723,3 +8723,94 @@ static void freeMasaExtRenderer( return; } + + +#ifdef FIX_1225_DISCLAIMER +static ivas_error printConfigInfo_rend( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + ivas_error error; + char config_str[50]; + + /*-----------------------------------------------------------------* + * Print output audio configuration + *-----------------------------------------------------------------*/ + + error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ); + fprintf( stdout, "Output configuration: %s\n", config_str ); + + /*-----------------------------------------------------------------* + * Print renderer configurations + *-----------------------------------------------------------------*/ + + fprintf( stdout, "Input sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); + + if ( hIvasRend->headRotData.headRotEnabled == 1 ) + { + fprintf( stdout, "Head-tracking: ON\n" ); + } + + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + { + fprintf( stdout, "Render framesize: %dms\n", hIvasRend->num_subframes * 5 ); + } + + return IVAS_ERR_OK; +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintInputConfig() + * + * + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintInputConfig( + const AUDIO_CONFIG inputConfig /* i : input audio configuration */ +) +{ + char config_str[50]; + + get_channel_config( inputConfig, &config_str[0] ); + fprintf( stdout, "Input configuration: %s\n", config_str ); + + return; +} + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintConfig() + * + * + *---------------------------------------------------------------------*/ + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +) +{ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + return printConfigInfo_rend( hIvasRend ); +} + + +/*---------------------------------------------------------------------* + * IVAS_REND_PrintDisclaimer() + * + * Print IVAS disclaimer to console + *---------------------------------------------------------------------*/ + +void IVAS_REND_PrintDisclaimer( void ) +{ + print_disclaimer( stderr ); + + return; +} +#endif diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 5886ad769c..2e8f2f444c 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -420,6 +420,22 @@ int32_t IVAS_REND_GetCntFramesLimited( ); #endif + +#ifdef FIX_1225_DISCLAIMER +/* Disclaimer and info printing */ + +void IVAS_REND_PrintInputConfig( + const AUDIO_CONFIG inputConfig /* i : input audio configuration */ +); + +ivas_error IVAS_REND_PrintConfig( + IVAS_REND_HANDLE hIvasRend /* i : IVAS renderer handle */ +); + +void IVAS_REND_PrintDisclaimer( + void +); +#endif /* clang-format on */ #endif -- GitLab From e87ef7ea57fe0e8560fda9dd72b9dec9098e077b Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 18:50:56 +0100 Subject: [PATCH 04/40] fix error return --- lib_rend/lib_rend.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 641e77576c..c6adf2889e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8737,14 +8737,18 @@ static ivas_error printConfigInfo_rend( * Print output audio configuration *-----------------------------------------------------------------*/ - error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ); + if ( ( error = get_channel_config( hIvasRend->outputConfig, &config_str[0] ) ) != IVAS_ERR_OK ) + { + return error; + } + fprintf( stdout, "Output configuration: %s\n", config_str ); /*-----------------------------------------------------------------* * Print renderer configurations *-----------------------------------------------------------------*/ - fprintf( stdout, "Input sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); + fprintf( stdout, "Output sampling rate: %d Hz\n", hIvasRend->sampleRateOut ); if ( hIvasRend->headRotData.headRotEnabled == 1 ) { -- GitLab From db9cf2a863e69b4dcc464b59e9353ffe4fc75430 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 18:51:40 +0100 Subject: [PATCH 05/40] fix error return --- lib_rend/lib_rend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c6adf2889e..343fdc05e1 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8786,6 +8786,7 @@ void IVAS_REND_PrintInputConfig( return; } + /*---------------------------------------------------------------------* * IVAS_REND_PrintConfig() * -- GitLab From 4371bc6b6b43eedce24bcedb85f9955afdc845c4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 6 Dec 2024 19:51:46 +0100 Subject: [PATCH 06/40] add MASA cases to get_channel_config() --- lib_rend/ivas_output_init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 32acac0a1e..82f298d6e3 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -544,6 +544,14 @@ ivas_error get_channel_config( { strcpy( str, "Multichannel (custom loudspeaker layout)" ); } + else if ( config == IVAS_AUDIO_CONFIG_MASA1 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio mono (MASA1)" ); + } + else if ( config == IVAS_AUDIO_CONFIG_MASA2 ) + { + strcpy( str, "Metadata-Assisted Spatial Audio stereo (MASA2)" ); + } else if ( config == IVAS_AUDIO_CONFIG_FOA ) { strcpy( str, "Ambisonics: First Order (FOA)" ); -- GitLab From 73ac6d04bb0f08dcafd046e9c97f10bf2191e5b8 Mon Sep 17 00:00:00 2001 From: Arnaud Lefort Date: Mon, 9 Dec 2024 17:24:45 +0100 Subject: [PATCH 07/40] Bug fixed - Left and right channels inverted. --- lib_enc/ivas_stereo_dmx_evs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index d4f280fb84..36d477fbe9 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -605,11 +605,11 @@ static void calc_poc( /* Channel selection based on ILD */ if ( hPHA->trns_aux_energy[0] > hPHA->trns_aux_energy[1] * hPHA->pha_ipd_ild_thresh ) { - pha_ipd_ild_chan2rephase = 0; + pha_ipd_ild_chan2rephase = 1; } else if ( hPHA->trns_aux_energy[1] > hPHA->trns_aux_energy[0] * hPHA->pha_ipd_ild_thresh ) { - pha_ipd_ild_chan2rephase = 1; + pha_ipd_ild_chan2rephase = 0; } else { -- GitLab From 22369edf77ef9147f63bc1fb34716b1c4de77ac4 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Dec 2024 12:26:33 +0100 Subject: [PATCH 08/40] - Reenable stereo switching conditions in the self-test - synchronize STV and LTV param. files --- scripts/config/self_test.prm | 25 +++++++--- scripts/config/self_test_ltv.prm | 78 +++++++++++++++++--------------- 2 files changed, 59 insertions(+), 44 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index ce1b05b845..5d941b1ca8 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -294,12 +294,13 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec STEREO 32 bit testv/stvST32c.wav_stereo_sw_32-32.tst // stereo bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, MONO out -//../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stvST48n.wav bit -//../IVAS_dec MONO 48 bit testv/stvST48n.wav_stereo_sw_48-48_DTX_MONO.tst +../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stvST48n.wav bit +../IVAS_dec MONO 48 bit testv/stvST48n.wav_stereo_sw_48-48_DTX_MONO.tst // stereo bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, EXT out -//../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stvST48c.wav bit -//../IVAS_dec EXT 48 bit testv/stvST48c.wav_stereo_sw_48-48_DTX_EXT.tst +../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/stvST48c.wav bit +../IVAS_dec EXT 48 bit testv/stvST48c.wav_stereo_sw_48-48_DTX_EXT.tst + // 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, EXT out @@ -953,6 +954,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_ROOM_REVERB 48 bit testv/stv3OA48c.wav_BINAURAL_ROOM_REVERB_96000_48-48_custom_configuration.tst + // MASA 1dir 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -masa 1 testv/stv1MASA1TC48c.met 13200 48 testv/stv1MASA1TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stv1MASA1TC48c.wav_13200_48-48_BINAURAL.tst @@ -1097,6 +1099,14 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom_Subframe.tst + + + + + + + + // MASA 2dir 2TC at 512 kbps, 48kHz in, 48kHz out, 5_1 out ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 512000 48 testv/stv2MASA2TC48c.wav bit ../IVAS_dec 5_1 48 bit testv/stv2MASA2TC48c.wav_512000_48-48_5_1.tst @@ -1240,6 +1250,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -render_config testv/rend_config_combined.cfg -t testv/headrot.csv BINAURAL_ROOM_REVERB 48 bit testv/stv1MASA1TC48c.wav_BINAURAL_ROOM_REVERB_256000_48-48_Headrot_custom_config.tst + // Multi-channel 5_1 at 13.2 kbps, 48kHz in, 48kHz out ../IVAS_cod -mc 5_1 13200 48 testv/stv51MC48c.wav bit ../IVAS_dec 5_1 48 bit testv/stv51MC48c.wav_MC51_13200_48-48_5_1.tst @@ -1562,6 +1573,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/stv714MC48c.wav_sw_48-48_EXT.tst + // Stereo downmix to bit-exact EVS at 13200 kbps, 32kHz in, 32kHz out ../IVAS_cod -stereo_dmx_evs 13200 32 testv/stvST32c.wav bit ../IVAS_dec 32 bit testv/stvST32c.wav_StereoDmxEVS_13200_32-32.tst @@ -1677,6 +1689,8 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_256000_48-48_JBM5.tst + + // OMASA 1Dir1TC 4ISM 48 kbps 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out custom configuration ../IVAS_cod -ism_masa 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA1TC48c.met 48000 48 testv/stvOMASA_4ISM_1MASA1TC48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_1MASA1TC48c.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst @@ -1707,7 +1721,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 7_1_4 48 bit_error testv/stvOMASA_1ISM_2MASA1TC32c.wav_7_1_4_512000_32-48_FER5.tst - // OMASA 1Dir1TC 2ISM at 16.4 kbps, 16kHz in, 48kHz out, 5.1 out ../IVAS_cod -ism_masa 2 1 testv/stvISM1.csv testv/stvISM2.csv testv/stv1MASA1TC48c.met 16400 16 testv/stvOMASA_2ISM_1MASA1TC16c.wav bit ../IVAS_dec 5_1 48 bit testv/stvOMASA_2ISM_1MASA1TC16c.wav_5_1_16400_16-48.tst @@ -1721,7 +1734,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 2 2 testv/stvISM1.csv NULL testv/stv1MASA2TC48c.met 256000 48 testv/stvOMASA_2ISM_1MASA2TC48c.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/stvOMASA_2ISM_1MASA2TC48c.wav_BINAURAL_ROOM_IR_256000_48-32.tst - // OMASA 2Dir1TC 3ISM at 24.4 kbps, 48kHz in, 16kHz out, FOA out, FER at 10% ../IVAS_cod -ism_masa 3 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA1TC48c.met 24400 48 testv/stvOMASA_3ISM_2MASA1TC48c.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error @@ -1755,7 +1767,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv1MASA2TC48c.met 160000 16 testv/stvOMASA_3ISM_1MASA2TC16c.wav bit ../IVAS_dec HOA3 32 bit testv/stvOMASA_3ISM_1MASA2TC16c.wav_HOA3_160000_16-32.tst - // OMASA 2Dir2TC 4ISM at 13.2 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met 13200 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec MONO 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_MONO_13200_48-48.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 55ab4fb49e..3a726d09bd 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -249,6 +249,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // stereo at 48 kbps, 32kHz in, 32kHz out, MONO out ../IVAS_cod -stereo 48000 32 testv/ltv32_STEREO.wav bit ../IVAS_dec MONO 32 bit testv/ltv32_STEREO.wav_stereo_48000_32-32_MONO.tst + // stereo at 13.2 kbps, 48kHz in, 48kHz out ../IVAS_cod -stereo 13200 48 testv/ltv48_STEREO.wav bit ../IVAS_dec STEREO 48 bit testv/ltv48_STEREO.wav_stereo_13200_48-48.tst @@ -293,12 +294,13 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec STEREO 32 bit testv/ltv32_STEREO.wav_stereo_sw_32-32.tst // stereo bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, MONO out -//../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/ltv48_STEREO.wav bit -//../IVAS_dec MONO 48 bit testv/ltv48_STEREO.wav_stereo_sw_48-48_DTX_MONO.tst +../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/ltv48_STEREO.wav bit +../IVAS_dec MONO 48 bit testv/ltv48_STEREO.wav_stereo_sw_48-48_DTX_MONO.tst // stereo bitrate switching from 13.2 kbps to 128 kbps, 48kHz in, 48kHz out, DTX on, EXT out -//../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/ltv48_STEREO.wav bit -//../IVAS_dec EXT 48 bit testv/ltv48_STEREO.wav_stereo_sw_48-48_DTX_EXT.tst +../IVAS_cod -dtx -stereo ../scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 testv/ltv48_STEREO.wav bit +../IVAS_dec EXT 48 bit testv/ltv48_STEREO.wav_stereo_sw_48-48_DTX_EXT.tst + // 1 ISM with metadata at 13.2 kbps, 48 kHz in, 48 kHz out, EXT out @@ -550,16 +552,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst +../IVAS_dec -render_config testv/config_directivity_txt.cfg -t testv/headrot_case04_3000_q.csv BINAURAL 48 bit_error testv/ltv48+4ISM.wav_256000_48-48_binaural_file_TDHR_DirConfig_FER5.tst // 4 ISM with extended metadata at 256 kbps, 48 kHz in, 48 kHz out, BINAURAL out, HR, exo, directivity configuration, random FER at 5% ../IVAS_cod -ism +4 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/stv+4ISM48s.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst +../IVAS_dec -render_config testv/config_directivity.cfg -t testv/headrot_case04_3000_q.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv BINAURAL 48 bit_error testv/ltv48+4ISM.wav_256000_48-48_binaural_file_TDHR_EXOF_DirConfig_FER5.tst // 4 ISM with and without extended metadata bitrate switching from 24.4 kbps to 256 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out ../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM3.csv testv/ltvISM4.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_4ISM.wav bit -../IVAS_dec EXT 48 bit testv/stv+4ISM48s.wav_brate_sw_48-48_DTX_EXT.tst +../IVAS_dec EXT 48 bit testv/ltv48+4ISM.wav_brate_sw_48-48_DTX_EXT.tst // 4 ISM with extended metadata and non diegetic pan object switching bitrate 256 kbps, 48 kHz in, 48 kHz out, DTX on, BINAURAL out ../IVAS_cod -dtx -ism +4 testv/ltvISM1.csv NULL testv/ltvISM3.csv testv/ltvISM4.csv 256000 48 testv/ltv48_4ISM.wav bit @@ -574,6 +576,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_4ISM.wav_BINAURAL_ROOM_REVERB_128000-48-48.tst + // SBA at 13.2 kbps, 32kHz in, 32kHz out, HOA3 out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -sba 3 13200 32 testv/ltv32_HOA3.wav bit ../IVAS_dec HOA3 32 bit testv/ltv32_HOA3.wav_SBA_13200_32-32_HOA3.tst @@ -676,27 +679,27 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrAvg.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrAvg.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPos.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-4s-Vector3.csv -otr ref_vec BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPos.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_OtrRefPosLev.tst // SBA at 48 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, reference vector tracking in level mode, exo ../IVAS_cod -sba 3 48000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst +../IVAS_dec -t ../scripts/trajectories/full-circle-with-up-and-down-4s.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -rvf ../scripts/trajectories/full-circle-with-up-and-down-4s-Vector3.csv -otr ref_vec_lev BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_48000_32-32_BinauralRoom_Headrot_EXOF_OtrRefPosLev.tst // SBA at 48 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, random FER at 5% ../IVAS_cod -sba 3 -dtx 48000 32 testv/ltv32_HOA3.wav bit @@ -771,11 +774,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_128000_32-32_Binaural_room_Headrot_OtrAvg.tst // SBA at 128 kbps, 32kHz in, 32kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -sba 3 128000 32 testv/ltv32_HOA3.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/stv3OA32c.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 32 bit testv/ltv32_HOA3.pcm_SBA_128000_32-32_Binaural_room_Headrot_EXOF_OtrAvg.tst // SBA at 192 kbps, 48kHz in, 48kHz out, HOA2 out, random FER at 5% ../IVAS_cod -sba 3 192000 48 testv/ltv48_HOA3.wav bit @@ -950,6 +953,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -sba 3 96000 48 testv/ltv48_HOA3.wav bit ../IVAS_dec -render_config testv/rend_config_recreation.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_HOA3.wav_BINAURAL_ROOM_REVERB_96000_48-48_custom_configuration.tst + + // MASA 1TC at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -masa 1 testv/ltv48_MASA1TC.met 13200 48 testv/ltv48_MASA1TC.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_MASA1TC.wav_13200_48-48_BINAURAL.tst @@ -1032,11 +1037,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // MASA 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.pcm_32000_48-48_BinauralRoom_Headrot_OtrAvg.tst // MASA 2TC at 32 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 32000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv_IVASMASA_1dir2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.pcm_32000_48-48_BinauralRoom_Headrot_EXOF_OtrAvg.tst // MASA 2TC at 48 kbps, 48kHz in, 48kHz out, 7_1_4 out, random FER at 5% ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 48000 48 testv/ltv48_MASA2TC.wav bit @@ -1091,8 +1096,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom.tst // MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching -../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom_Subframe.tst +../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom_Subframe.tst // MASA 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit @@ -1231,7 +1236,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/ltv48_MASA2TC.wav_sw_48-48_DTX_BINAURAL_FER5.tst - // MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out default configuration, random FER at 5% ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error @@ -1333,11 +1337,11 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit -../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_Headrot_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.pcm_MC51_256000_48-48_BinauralRoom_Headrot_OtrAvg.tst // Multi-channel 5_1 at 256 kbps, 48kHz in, 48kHz out, BINAURAL ROOM IR out, HR, OT, exo ../IVAS_cod -mc 5_1 256000 48 testv/ltv48_MC51.wav bit -../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/stv51MC48c.pcm_MC51_256000_48-48_BinauralRoom_EXOF_OtrAvg.tst +../IVAS_dec -t testv/headrot.csv -exof testv/headrot_case00_3000_q_combinedRotationTest.csv -otr avg BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.pcm_MC51_256000_48-48_BinauralRoom_EXOF_OtrAvg.tst // Multi-channel 5_1 at 384 kbps, 48kHz in, 48kHz out ../IVAS_cod -mc 5_1 384000 48 testv/ltv48_MC51.wav bit @@ -1379,8 +1383,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -mc 7_1_4 512000 48 testv/ltv48_MC714.wav bit ../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MC714.wav_BINAURAL_ROOM_REVERB_512000_48-48.tst - - // Multi-channel 7_1_4 at 48 kbps, 48kHz in, 48kHz out, MONO out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_SWB.txt -mc 7_1_4 48000 48 testv/ltv48_MC714.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_MC714.wav_MC714_48000_48-48_Mono_bwsw.tst @@ -1501,8 +1503,12 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec 7_1_4 48 bit testv/ltv48_MC51.wav_sw_48-48_7_1_4.tst // Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM_REVERB out -../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/stv51MC48c.wav bit -../IVAS_dec BINAURAL_ROOM_REVERB 16 bit testv/stv51MC48c.wav_sw_48-16_Binaural_room.tst +../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/ltv48_MC51.wav bit +../IVAS_dec BINAURAL_ROOM_REVERB 16 bit testv/ltv48_MC51.wav_sw_48-16_Binaural_room.tst + +// Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_IR out +../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 32 testv/ltv48_MC51.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_sw_32-48_Binaural_room.tst // Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_MC51.wav bit @@ -1515,7 +1521,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // Multi-channel 7_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, BINAURAL out (model from file), head rotation ../IVAS_cod -mc 7_1 ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MC71.wav bit -../IVAS_dec -t testv/headrot.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/stv71C48c.wav_sw_48-48_Binaural_model_file_headrot.tst +../IVAS_dec -t testv/headrot.csv -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin BINAURAL 48 bit testv/ltv48_MC71.wav_sw_48-48_Binaural_model_file_headrot.tst // Multi-channel 7_1_4 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, HOA3 out ../IVAS_cod -mc 7_1_4 ../scripts/switchPaths/sw_mctech_5fr.bin 48 testv/ltv48_MC714.wav bit @@ -1567,6 +1573,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec EXT 48 bit testv/ltv48_MC714.wav_sw_48-48_EXT.tst + // Stereo downmix to bit-exact EVS at 13200 kbps, 32kHz in, 32kHz out ../IVAS_cod -stereo_dmx_evs 13200 32 testv/ltv32_STEREO.wav bit ../IVAS_dec 32 bit testv/ltv32_STEREO.wav_StereoDmxEVS_13200_32-32.tst @@ -1683,6 +1690,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/ltv48_OMASA_4ISM_2TC.wav_EXT_256000_48-48_JBM5.tst + // OMASA 1Dir1TC 4ISM 48 kbps 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out custom configuration ../IVAS_cod -ism_masa 4 1 testv/ltv48_OMASA_4ISM_1TC_ISM1.csv testv/ltv48_OMASA_4ISM_1TC_ISM2.csv testv/ltv48_OMASA_4ISM_1TC_ISM3.csv testv/ltv48_OMASA_4ISM_1TC_ISM4.csv testv/ltv48_OMASA_4ISM_1TC.met 48000 48 testv/ltv48_OMASA_4ISM_1TC.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_1TC.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst @@ -1714,7 +1722,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 7_1_4 48 bit_error testv/ltv32_OMASA_1ISM_1TC.wav_7_1_4_512000_32-48.tst - // OMASA 1Dir1TC 2ISM at 16.4 kbps, 16kHz in, 48kHz out, 5.1 out ../IVAS_cod -ism_masa 2 1 testv/ltv48_OMASA_2ISM_1TC_ISM1.csv testv/ltv48_OMASA_2ISM_1TC_ISM2.csv testv/ltv48_OMASA_2ISM_1TC.met 16400 16 testv/ltv16_OMASA_2ISM_1TC.wav bit ../IVAS_dec 5_1 48 bit testv/ltv16_OMASA_2ISM_1TC.wav_5_1_16400_16-48.tst @@ -1728,7 +1735,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv NULL testv/ltv48_OMASA_2ISM_2TC.met 256000 48 testv/ltv48_OMASA_2ISM_2TC.wav bit ../IVAS_dec BINAURAL_ROOM_IR 32 bit testv/ltv48_OMASA_2ISM_2TC.wav_BINAURAL_ROOM_IR_256000_48-32.tst - // OMASA 2Dir1TC 3ISM at 24.4 kbps, 48kHz in, 16kHz out, FOA out, FER at 10% ../IVAS_cod -ism_masa 3 1 testv/ltv48_OMASA_3ISM_1TC_ISM1.csv testv/ltv48_OMASA_3ISM_1TC_ISM2.csv testv/ltv48_OMASA_3ISM_1TC_ISM3.csv testv/ltv48_OMASA_3ISM_1TC.met 24400 48 testv/ltv48_OMASA_3ISM_1TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g192 bit_error @@ -1762,7 +1768,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met 160000 16 testv/ltv16_OMASA_3ISM_2TC.wav bit ../IVAS_dec HOA3 32 bit testv/ltv16_OMASA_3ISM_2TC.wav_HOA3_160000_16-32.tst - // OMASA 2Dir2TC 4ISM at 13.2 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 13200 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_MONO_13200_48-48.tst @@ -1772,9 +1777,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_dec STEREO 48 bit testv/ltv48_OMASA_4ISM_1TC.wav_STEREO_24400_48-48.tst // OMASA 1Dir2TC 4ISM at 32 kbps, 48kHz in, 48kHz out, FOA out, FER at 5% -../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/stv1MASA2TC48c.met 32000 48 testv/stvOMASA_4ISM_1MASA2TC48c.wav bit +../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 32000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error -../IVAS_dec FOA 48 bit_error testv/stvOMASA_4ISM_1MASA2TC48c.wav_FOA_32000_48-48_FER5.tst +../IVAS_dec FOA 48 bit_error testv/ltv48_OMASA_4ISM_2TC.wav_FOA_32000_48-48_FER5.tst // OMASA 1Dir1TC 4ISM at 48 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out ../IVAS_cod -ism_masa 4 1 testv/ltv48_OMASA_4ISM_1TC_ISM1.csv testv/ltv48_OMASA_4ISM_1TC_ISM2.csv testv/ltv48_OMASA_4ISM_1TC_ISM3.csv testv/ltv48_OMASA_4ISM_1TC_ISM4.csv testv/ltv48_OMASA_4ISM_1TC.met 48000 48 testv/ltv48_OMASA_4ISM_1TC.wav bit @@ -1785,8 +1790,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec HOA2 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_HOA2_64000_48-48.tst // OMASA 1Dir2TC 4ISM at 80 kbps, 48kHz in, 48kHz out, MONO out -../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/stv1MASA2TC48c.met 80000 48 testv/stvOMASA_4ISM_1MASA2TC48c.wav bit -../IVAS_dec MONO 48 bit testv/stvOMASA_4ISM_1MASA2TC48c.wav_MONO_80000_48-48.tst +../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 80000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit +../IVAS_dec MONO 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_MONO_80000_48-48.tst // OMASA 2Dir2TC 4ISM at 192 kbps, 48kHz in, 48kHz out, STEREO out ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 192000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit @@ -1796,7 +1801,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 384000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec EXT 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_EXT_384000_48-48.tst - // OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/ltv48_OMASA_3ISM_2TC_ISM1.csv testv/ltv48_OMASA_3ISM_2TC_ISM2.csv testv/ltv48_OMASA_3ISM_2TC_ISM3.csv testv/ltv48_OMASA_3ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/ltv48_OMASA_3ISM_2TC.wav bit ../IVAS_dec MONO 48 bit testv/ltv48_OMASA_3ISM_2TC.wav_MONO_sw_48-48.tst @@ -1838,7 +1842,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_1ISM_FOA.wav_BINAURAL_32000_48-48.tst // OSBA FOA 1ISM at 48 kbps, 16kHz in, 16kHz out, BINAURAL_ROOM_REVERB (Model from file) out -../IVAS_cod -ism_sba 1 1 testv/stvISM1.csv 32000 16 testv/ltv16_OSBA_1ISM_FOA.wav bit +../IVAS_cod -ism_sba 1 1 testv/ltvISM1.csv 32000 16 testv/ltv16_OSBA_1ISM_FOA.wav bit ../IVAS_dec -hrtf ../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin BINAURAL_ROOM_REVERB 16 bit testv/ltv16_OSBA_1ISM_FOA.wav_BINAURAL_ROOM_REVERB_32000_16-16.tst // OSBA FOA 2ISM at 64 kbps, 48kHz in, 48kHz out, HOA3 out, bandwidth switching @@ -1944,7 +1948,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_pFOA.wav_BINAURAL_256000_48-48.tst // OSBA planar FOA 2ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL out -../IVAS_cod -ism_sba 2 -1 testv/ltvISM1.csv testv/ltvISM2.csv 512000 48 testv/stvOSBA_2ISM_FOA48c.wav bit +../IVAS_cod -ism_sba 2 -1 testv/ltvISM1.csv testv/ltvISM2.csv 512000 48 testv/ltv48_OSBA_2ISM_FOA.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_OSBA_4ISM_pHOA2.wav_BINAURAL_512000_48-48.tst // OSBA planar 3OA 4ISM at 512 kbps, 48 kHz in, 48 kHz out, BINAURAL ROOM IR out -- GitLab From a70256f90b6b57062f72e25f91ad96030dca1a0e Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Dec 2024 14:23:51 +0100 Subject: [PATCH 09/40] issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one; under NONBE_1240_FIX_CORE_SELECCITON_ISM_SW --- lib_com/options.h | 1 + lib_enc/ivas_decision_matrix_enc.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 484de232aa..b4f87bb5e4 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,6 +177,7 @@ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ +#define NONBE_1240_FIX_CORE_SELECCITON_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 306aaf74b6..7d7f49220c 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -172,7 +172,12 @@ void ivas_decision_matrix_enc( st->core = ACELP_CORE; } +#ifdef NONBE_1240_FIX_CORE_SELECCITON_ISM_SW + /* sanity check: highest bitrates in ISM */ + if ( st->is_ism_format && st->total_brate > MAX_ACELP_BRATE_ISM ) +#else if ( st->is_ism_format && st->tcxonly ) +#endif { st->core = TCX_20_CORE; } -- GitLab From ff9f1b750afba2d7fad34afdeb5ea9fc899697cf Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Dec 2024 15:18:41 +0100 Subject: [PATCH 10/40] fix input file sampling rate in LTV --- scripts/config/self_test_ltv.prm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 3a726d09bd..3ce48a9b18 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1507,8 +1507,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec BINAURAL_ROOM_REVERB 16 bit testv/ltv48_MC51.wav_sw_48-16_Binaural_room.tst // Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 32kHz in, 48kHz out, BINAURAL_ROOM_IR out -../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 32 testv/ltv48_MC51.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MC51.wav_sw_32-48_Binaural_room.tst +../IVAS_cod -mc 5_1 ../scripts/switchPaths/sw_mctech_5fr.bin 32 testv/ltv32_MC51.wav bit +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv32_MC51.wav_sw_32-48_Binaural_room.tst // Multi-channel 5_1 bitrate switching from 24.4 kbps to 256 kbps, 48kHz in, 48kHz out, BINAURAL out, FER at 10%, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -mc 5_1 ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_MC51.wav bit -- GitLab From 6c8478309168be82ff06e5e9ee4d18b9d765a543 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 10 Dec 2024 15:40:04 +0100 Subject: [PATCH 11/40] fix within NONBE_1240_FIX_CORE_SELECTION_ISM_SW to not affect constant bitrate operations --- lib_com/options.h | 2 +- lib_enc/ivas_decision_matrix_enc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b4f87bb5e4..29fd77327e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,7 +177,7 @@ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ -#define NONBE_1240_FIX_CORE_SELECCITON_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ +#define NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index 7d7f49220c..2b0f688226 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -172,9 +172,9 @@ void ivas_decision_matrix_enc( st->core = ACELP_CORE; } -#ifdef NONBE_1240_FIX_CORE_SELECCITON_ISM_SW +#ifdef NONBE_1240_FIX_CORE_SELECTION_ISM_SW /* sanity check: highest bitrates in ISM */ - if ( st->is_ism_format && st->total_brate > MAX_ACELP_BRATE_ISM ) + if ( st->is_ism_format && st->tcxonly && st->total_brate > MAX_ACELP_BRATE_ISM ) #else if ( st->is_ism_format && st->tcxonly ) #endif -- GitLab From a7ece629cfdc96087af4e58d557f0faab6422e59 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Tue, 10 Dec 2024 16:13:36 +0100 Subject: [PATCH 12/40] no need to include string.h --- lib_dec/lib_dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 796ed18ad5..a8e3c6aa6e 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -43,7 +43,9 @@ #include "jbm_pcmdsp_fifo.h" #include #include +#ifndef FIX_1225_DISCLAIMER #include +#endif #ifdef DEBUGGING #include "debug.h" #endif -- GitLab From 78a129a68f184408eaddf386d5c07d8c4b0adc49 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Dec 2024 10:57:55 +0100 Subject: [PATCH 13/40] simplify disclaimer text --- lib_com/disclaimer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 71aded4b87..01710fba15 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -47,9 +47,10 @@ int16_t print_disclaimer( FILE *fPtr ) { fprintf( fPtr, "\n==================================================================================================\n" ); - fprintf( fPtr, " IVAS Codec Baseline\n" ); #ifdef FIX_1225_DISCLAIMER - fprintf( fPtr, " \n Initial IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); + fprintf( fPtr, " \n IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); +#else + fprintf( fPtr, " IVAS Codec Baseline\n" ); #endif fprintf( fPtr, " \n" ); fprintf( fPtr, " Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,\n" ); -- GitLab From bb4bc81852a42886dbbda16bf23065cdf7bffc96 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Dec 2024 10:59:37 +0100 Subject: [PATCH 14/40] simplify disclaimer text --- lib_com/disclaimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 01710fba15..f49f043ca6 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -48,7 +48,7 @@ int16_t print_disclaimer( FILE *fPtr ) fprintf( fPtr, "\n==================================================================================================\n" ); #ifdef FIX_1225_DISCLAIMER - fprintf( fPtr, " \n IVAS Codec (Floating Point) 3GPP TS26.258 version IVAS-FLP-2.0\n" ); + fprintf( fPtr, " \n IVAS Codec Version IVAS-FL-2.0\n" ); #else fprintf( fPtr, " IVAS Codec Baseline\n" ); #endif -- GitLab From 2e3c706ab7342f0b135011563a1f31daade4b58a Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 12 Dec 2024 15:07:52 +0100 Subject: [PATCH 15/40] add OSBA/OMASA support to IVAS_rend --- apps/renderer.c | 57 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 22ffa4838d..746b56fc7e 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -397,6 +397,8 @@ static IVAS_AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ); static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs ); +static void parseCombinedFormatInput( InputConfig *inConfig, char **configString ); + static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom ); static CmdlnArgs parseCmdlnArgs( const int argc, char **argv ); @@ -2093,16 +2095,11 @@ static bool parseInConfig( inConfig->masaBuses[0].gain_dB = 0.0f; break; case IVAS_AUDIO_CONFIG_OBA: - /* If input format is objects, parse the characters after "ISM" to get number of objects */ + /* If input format is objects, parse the characters after "ISM" to get + * number of objects and check for combined formats. */ { char *ptr = NULL; inConfig->numAudioObjects = (uint16_t) strtol( inFormatStr + 3, &ptr, 10 ); - if ( ptr == NULL || *ptr != '\0' ) - { - /* Failed to parse string as a number */ - fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr ); - return false; - } if ( inConfig->numAudioObjects > RENDERER_MAX_ISM_INPUTS ) { fprintf( stderr, "Too many objects at input. Max %d supported.", RENDERER_MAX_ISM_INPUTS ); @@ -2114,6 +2111,17 @@ static bool parseInConfig( inConfig->audioObjects[i].inputChannelIndex = i; inConfig->audioObjects[i].gain_dB = 0.0f; } + if ( *ptr != '\0' ) + { + /* Try to parse combined format */ + parseCombinedFormatInput( inConfig, &ptr ); + } + if ( ptr == NULL || *ptr != '\0' ) + { + /* Failed to parse string as a number */ + fprintf( stderr, "Cannot parse string \"%s\" as a valid input format", inFormatStr ); + return false; + } } break; case IVAS_AUDIO_CONFIG_INVALID: @@ -3436,6 +3444,41 @@ static void parseMasa( return; } +static void parseCombinedFormatInput( + InputConfig *inConfig, + char **configString ) +{ + IVAS_AUDIO_CONFIG audioConfig; + audioConfig = parseAudioConfig( *configString ); + + if ( audioConfig == IVAS_AUDIO_CONFIG_FOA || audioConfig == IVAS_AUDIO_CONFIG_HOA2 || audioConfig == IVAS_AUDIO_CONFIG_HOA3 ) + { + /* OSBA */ + inConfig->numAmbisonicsBuses = 1; + inConfig->ambisonicsBuses[0].audioConfig = audioConfig; + inConfig->ambisonicsBuses[0].inputChannelIndex = inConfig->numAudioObjects; + inConfig->ambisonicsBuses[0].gain_dB = -6.f; + *configString += 4; + + /* Modify input gain for objects too */ + for ( int16_t i = 0; i < inConfig->numAudioObjects; ++i ) + { + inConfig->audioObjects[i].gain_dB = -6.f; + } + } + else if ( audioConfig == IVAS_AUDIO_CONFIG_MASA1 || audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) + { + /* OMASA */ + inConfig->numMasaBuses = 1; + inConfig->masaBuses[0].audioConfig = audioConfig; + inConfig->masaBuses[0].inputChannelIndex = inConfig->numAudioObjects; + inConfig->masaBuses[0].gain_dB = 0.0f; + *configString += 5; + } + + return; +} + static ivas_error parseCustomLayoutFile( const char *filePath, IVAS_CUSTOM_LS_DATA *pLsSetupCustom ) -- GitLab From b3779fa232c3c06a0dd01670b7240eaf23fb5026 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 12 Dec 2024 15:10:58 +0100 Subject: [PATCH 16/40] update printout for supported formats --- apps/renderer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/renderer.c b/apps/renderer.c index 746b56fc7e..ffed1cbeac 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -3695,6 +3695,8 @@ static void printSupportedAudioConfigs( void ) "HOA2", "HOA3", "ISMx (input only)", + "ISMxSBAy (OSBA, input only)", + "ISMxMASAy (OMASA, input only)", "MASAx", "BINAURAL (output only)", "BINAURAL_SPLIT_PCM", -- GitLab From 18b54f170e77a51acc4462246b82adf0f6a1fea2 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 13 Dec 2024 11:13:11 +0100 Subject: [PATCH 17/40] [fix] OMASA metadata files not consumed due to limit to RENDERER_MAX_ISM_INPUTS --- apps/renderer.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index ffed1cbeac..05f62cab5c 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -158,7 +158,7 @@ typedef struct int32_t sampleRate; InputConfig inConfig; OutputConfig outConfig; - char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; + char inMetadataFilePaths[RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS][RENDERER_MAX_CLI_ARG_LENGTH]; int16_t numInMetadataFiles; char outMetadataFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; char headRotationFilePath[RENDERER_MAX_CLI_ARG_LENGTH]; @@ -238,7 +238,7 @@ static const CmdLnParser_Option cliOptions[] = { .id = CmdLnOptionId_inputMetadata, .match = "input_metadata", .matchShort = "im", - .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode", + .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode. For OMASA, ISM files must be specified first.", }, { .id = CmdLnOptionId_outputFile, @@ -557,25 +557,7 @@ static void setupWithSingleFormatInput( strncpy( audioFilePath, args.inputFilePath, FILENAME_MAX - 1 ); /* Depending on input format, prepare metadata reading for ISM or MASA */ - if ( args.inConfig.numMasaBuses != 0 ) - { - if ( args.inConfig.numMasaBuses != args.numInMetadataFiles ) - { - fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" ); - exit( -1 ); - } - - for ( int16_t i = 0; i < args.numInMetadataFiles; ++i ) - { - masaReaders[i] = MasaFileReader_open( args.inMetadataFilePaths[i] ); - if ( masaReaders[i] == NULL ) - { - fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] ); - exit( -1 ); - } - } - } - else if ( args.inConfig.numAudioObjects != 0 ) + if ( args.inConfig.numAudioObjects != 0 ) { positionProvider->numObjects = args.inConfig.numAudioObjects; for ( int16_t i = 0; i < positionProvider->numObjects; ++i ) @@ -598,6 +580,26 @@ static void setupWithSingleFormatInput( } } } + if ( args.inConfig.numMasaBuses != 0 ) + { + if ( args.inConfig.numMasaBuses != ( args.numInMetadataFiles - args.inConfig.numAudioObjects ) ) + { + fprintf( stderr, "Error: all MASA inputs must have a corresponding metadata file" ); + exit( -1 ); + } + + int16_t reader_idx = 0; + for ( int16_t i = args.inConfig.numAudioObjects; i < args.numInMetadataFiles; ++i ) + { + reader_idx = i - args.inConfig.numAudioObjects; + masaReaders[reader_idx] = MasaFileReader_open( args.inMetadataFilePaths[i] ); + if ( masaReaders[reader_idx] == NULL ) + { + fprintf( stderr, "Could not open MASA metadata file %s\n", args.inMetadataFilePaths[i] ); + exit( -1 ); + } + } + } return; } @@ -2616,7 +2618,7 @@ static void parseOption( } break; case CmdLnOptionId_inputMetadata: - assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS ); + assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS + RENDERER_MAX_MASA_INPUTS ); for ( int16_t i = 0; i < numOptionValues; ++i ) { strncpy( args->inMetadataFilePaths[i], optionValues[i], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); -- GitLab From 1d2f7b9692367b3267985e71e5d033d2c9780f02 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 14 Dec 2024 00:39:44 +0100 Subject: [PATCH 18/40] accept FIX_1226_FASTCONV_HRTF_LOADING_OPTIM, FIX_1227_Crend_HRTF_LOADING_OPTIM --- apps/decoder.c | 75 ---- apps/renderer.c | 25 -- lib_com/common_api_types.h | 4 - lib_com/ivas_cnst.h | 13 - lib_com/ivas_prot.h | 6 - lib_com/options.h | 2 - lib_dec/ivas_binRenderer_internal.c | 441 --------------------- lib_dec/ivas_init_dec.c | 13 - lib_dec/ivas_ism_dec.c | 4 - lib_dec/ivas_mct_dec.c | 4 - lib_dec/ivas_stat_dec.h | 4 - lib_dec/lib_dec.c | 55 --- lib_dec/lib_dec.h | 9 - lib_rend/ivas_crend.c | 247 ------------ lib_rend/ivas_hrtf.c | 39 -- lib_rend/ivas_prot_rend.h | 22 -- lib_rend/ivas_stat_rend.h | 60 --- lib_rend/lib_rend.c | 19 - lib_util/hrtf_file_reader.c | 573 ---------------------------- lib_util/hrtf_file_reader.h | 27 -- 20 files changed, 1642 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 4db62d0f1e..ed7f614df7 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -160,9 +160,6 @@ typedef struct char *hrtfFileName; IVAS_DEC_HRTF_HANDLE *hHrtfTD; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF; -#endif IVAS_DEC_HRTF_STATISTICS_HANDLE *hHrtfStatistics; @@ -171,12 +168,7 @@ typedef struct IVAS_BIN_RENDERER_TYPE binaural_renderer_sec; IVAS_BIN_RENDERER_TYPE binaural_renderer_sec_old; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG hrtf_set_audio_cfg; -#else - IVAS_AUDIO_CONFIG intern_audio_config; - int16_t room_reverb_flag; -#endif } IVAS_DEC_HRTF_BINARY_WRAPPER; @@ -189,11 +181,7 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs ); -#else -static ivas_error IVAS_DEC_LoadHrtfFromFile( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const int32_t output_Fs ); -#endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); @@ -248,9 +236,6 @@ int main( #endif hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - hHrtfBinary.hSetOfHRTF = NULL; /* just to avoid compilation warning */ -#endif hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ splitRendBits.bits_buf = splitRendBitsBuf; @@ -734,12 +719,7 @@ int main( hHrtfBinary.hrtfFileName = arg.hrtfFileName; hHrtfBinary.binaural_renderer = IVAS_BIN_RENDERER_TYPE_NONE; hHrtfBinary.binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; -#else - hHrtfBinary.room_reverb_flag = 0; - hHrtfBinary.intern_audio_config = IVAS_AUDIO_CONFIG_INVALID; -#endif } /*------------------------------------------------------------------------------------------* @@ -818,9 +798,6 @@ cleanup: if ( arg.hrtfReaderEnabled ) { destroy_td_hrtf( hHrtfBinary.hHrtfTD ); -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - destroy_SetOfHRTF( hHrtfBinary.hSetOfHRTF ); -#endif destroy_hrtf_statistics( hHrtfBinary.hHrtfStatistics ); } @@ -2372,11 +2349,7 @@ static ivas_error decodeG192( /* Read main parameters from the bitstream to set-up the decoder */ hHrtfBinary->binaural_renderer_old = hHrtfBinary->binaural_renderer; hHrtfBinary->binaural_renderer_sec_old = hHrtfBinary->binaural_renderer_sec; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->room_reverb_flag, &hHrtfBinary->intern_audio_config ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2387,11 +2360,7 @@ static ivas_error decodeG192( /* Load HRTF binary file data */ if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_hrtf_from_file( hHrtfBinary, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtfBinary, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3287,11 +3256,7 @@ static ivas_error decodeVoIP( /* Read main parameters from the bitstream to set-up the decoder */ hHrtf->binaural_renderer_old = hHrtf->binaural_renderer; hHrtf->binaural_renderer_sec_old = hHrtf->binaural_renderer_sec; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->room_reverb_flag, &hHrtf->intern_audio_config ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -3302,11 +3267,7 @@ static ivas_error decodeVoIP( /* Load HRTF binary file data */ if ( arg.hrtfReaderEnabled ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_hrtf_from_file( hHrtf, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtf, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); goto cleanup; @@ -3697,7 +3658,6 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( #endif -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * load_hrtf_from_file() * @@ -3710,18 +3670,6 @@ static ivas_error load_hrtf_from_file( const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ const int32_t output_Fs /* i : output sampling rate */ ) -#else -/*---------------------------------------------------------------------* - * IVAS_DEC_LoadHrtfFromFile() - * - * - *---------------------------------------------------------------------*/ - -static ivas_error IVAS_DEC_LoadHrtfFromFile( - IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, - IVAS_DEC_HANDLE hIvasDec, - const int32_t output_Fs ) -#endif { ivas_error error; IVAS_BIN_RENDERER_TYPE binaural_renderer, binaural_renderer_sec; @@ -3747,13 +3695,6 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( destroy_td_hrtf( hHrtfBinary->hHrtfTD ); } -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - if ( !( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && hHrtfBinary->hSetOfHRTF != NULL ) - { - destroy_SetOfHRTF( hHrtfBinary->hSetOfHRTF ); - } - -#endif if ( ( error = IVAS_DEC_HRTF_binary_close( hIvasDec, hHrtfBinary->binaural_renderer_old ) ) != IVAS_ERR_OK ) { return error; @@ -3801,22 +3742,14 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( if ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hHrtfCrend ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hHrtfBinary->hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); return error; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hHrtfBinary->hrtfReader, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = create_SetOfHRTF_from_binary( *hHrtfBinary->hSetOfHRTF, hHrtfBinary->hrtfReader, output_Fs ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -3825,11 +3758,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM destroy_crend_hrtf( hHrtfCrend ); -#else - destroy_SetOfHRTF( hHrtfBinary->hSetOfHRTF ); -#endif } } } @@ -3843,11 +3772,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hHrtfBinary->room_reverb_flag, hHrtfBinary->intern_audio_config, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { diff --git a/apps/renderer.c b/apps/renderer.c index 22ffa4838d..5df4cc9b4f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -665,11 +665,7 @@ int main( SplitRendBFIFileReader *splitRendBFIReader = NULL; Vector3PairFileReader *referenceVectorReader = NULL; hrtfFileReader *hrtfFileReader = NULL; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend = NULL; -#else - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF = NULL; -#endif IVAS_DEC_HRTF_FASTCONV_HANDLE *hHrtfFastConv = NULL; IVAS_DEC_HRTF_PARAMBIN_HANDLE *hHrtfParambin = NULL; IVAS_DEC_HRTF_HANDLE *hHrtfTD = NULL; @@ -928,17 +924,12 @@ int main( } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hHrtfCrend ) ) != IVAS_ERR_OK ) -#else - if ( ( error = IVAS_REND_GetHrtfCRendHandle( hIvasRend, &hSetOfHRTF ) ) != IVAS_ERR_OK ) -#endif { fprintf( stderr, "\nIVAS_Rend_GetHrtfCRendHandle failed: %s\n\n", ivas_error_to_string( error ) ); goto cleanup; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_7_1_4; if ( args.inConfig.ambisonicsBuses->audioConfig != IVAS_AUDIO_CONFIG_INVALID && args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { @@ -946,9 +937,6 @@ int main( } if ( ( error = load_Crend_HRTF_from_binary( *hHrtfCrend, hrtfFileReader, args.outConfig.audioConfig, hrtf_set_audio_cfg, args.sampleRate ) ) != IVAS_ERR_OK ) -#else - if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -957,11 +945,7 @@ int main( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM destroy_crend_hrtf( hHrtfCrend ); -#else - destroy_SetOfHRTF( hSetOfHRTF ); -#endif } } @@ -971,11 +955,7 @@ int main( goto cleanup; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, args.outConfig.audioConfig, args.inConfig.ambisonicsBuses->audioConfig, hrtfFileReader ) ) != IVAS_ERR_OK ) -#else - if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, 0, IVAS_AUDIO_CONFIG_INVALID, hrtfFileReader ) ) != IVAS_ERR_OK ) -#endif { if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA ) { @@ -1982,9 +1962,6 @@ cleanup: Vector3PairFileReader_close( &referenceVectorReader ); destroy_td_hrtf( hHrtfTD ); -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - destroy_SetOfHRTF( hSetOfHRTF ); -#endif destroy_hrtf_statistics( hHrtfStatistics ); IVAS_REND_Close( &hIvasRend ); IsmPositionProvider_close( positionProvider ); @@ -2527,9 +2504,7 @@ static CmdlnArgs defaultArgs( args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM args.inConfig.ambisonicsBuses->audioConfig = IVAS_AUDIO_CONFIG_INVALID; -#endif for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 16614a929a..aeeb3dda6a 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -175,11 +175,7 @@ typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM typedef struct ivas_hrtf_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; -#else -typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; -#endif typedef struct ivas_hrtfs_fastconv_struct *IVAS_DEC_HRTF_FASTCONV_HANDLE; typedef struct ivas_hrtfs_parambin_struct *IVAS_DEC_HRTF_PARAMBIN_HANDLE; typedef struct ivas_hrtfs_statistics_struct *IVAS_DEC_HRTF_STATISTICS_HANDLE; diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 786a6d436b..f12ee0330a 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1495,19 +1495,6 @@ typedef enum #define BINAURAL_COHERENCE_DIFFERENCE_BINS 9 /* Number of bins for direction-dependent diffuse-field binaural coherence */ -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM -typedef enum -{ - BINAURAL_INPUT_AUDIO_CONFIG_INVALID, - BINAURAL_INPUT_AUDIO_CONFIG_COMBINED, /* 5_1, 5_1_2, 5_1_4, 7_1, 7_1_4 */ - BINAURAL_INPUT_AUDIO_CONFIG_HOA3, /* HOA3 */ - BINAURAL_INPUT_AUDIO_CONFIG_HOA2, /* HOA2 */ - BINAURAL_INPUT_AUDIO_CONFIG_FOA, /* FOA */ - BINAURAL_INPUT_AUDIO_CONFIG_UNDEFINED /* Not used */ - -} BINAURAL_INPUT_AUDIO_CONFIG; - -#endif #define HEADROT_ORDER 3 #define HEADROT_SHMAT_DIM ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) ) #define HEADROT_SHMAT_DIM2 ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM ) diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 3513df00a4..6fea944d4f 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -5136,13 +5136,7 @@ void ivas_init_binaural_hrtf( ivas_error ivas_allocate_binaural_hrtf( HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM const int16_t n_channels, /* i : number of input channels */ -#else - const AUDIO_CONFIG input_config, /* i : input audio configuration */ - const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */ - const RENDERER_TYPE renderer_type, /* i : renderer type */ -#endif const int16_t allocate_init_flag /* i : Memory allocation flag */ ); diff --git a/lib_com/options.h b/lib_com/options.h index 059877b9b2..7c10950b47 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,8 +160,6 @@ /*#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_1226_FASTCONV_HRTF_LOADING_OPTIM /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */ -#define FIX_1227_Crend_HRTF_LOADING_OPTIM /* VA: issue 1227: for Crend binaural renderer in decoder, load only HTRT coefficient set that is needed */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE /* VA: issue 1228: Exit the processing when a HRTF binary file with wrong sampling rate is provided */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index a9075b1f0d..d5eda9907d 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -165,16 +165,10 @@ static ivas_error ivas_binRenderer_convModuleOpen( hBinRenderer->nInChannels = ( audioCfg2channels( input_config ) - isLoudspeaker ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hBinRenConvModule->numTaps = hHrtf->ntaps; -#endif if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - hBinRenConvModule->numTaps = hHrtf->ntaps_brir; - -#endif /* Use variable order filtering */ bandIdx = 0; for ( ; bandIdx < 5; bandIdx++ ) @@ -200,32 +194,6 @@ static ivas_error ivas_binRenderer_convModuleOpen( } else { -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - if ( hBinRenderer->ivas_format == SBA_FORMAT ) - { - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_hoa3; - } - else if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_hoa2; - } - else if ( input_config == IVAS_AUDIO_CONFIG_FOA ) - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir_foa; - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - else - { - hBinRenConvModule->numTaps = hHrtf->ntaps_hrir; - } - -#endif /* Use fixed order filtering */ bandIdx = 0; for ( ; bandIdx < hBinRenderer->conv_band; bandIdx++ ) @@ -334,9 +302,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( { int16_t tmp = 0; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM tmp = chIdx; -#endif if ( isLoudspeaker ) { if ( input_config == IVAS_AUDIO_CONFIG_5_1 ) @@ -367,72 +333,10 @@ static ivas_error ivas_binRenderer_convModuleOpen( #endif } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftReal[bandIdx][tmp]; hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftImag[bandIdx][tmp]; hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightReal[bandIdx][tmp]; hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightImag[bandIdx][tmp]; -#else - if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) - { - - if ( isLoudspeaker ) - { - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftBRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftBRIRImag[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightBRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightBRIRImag[bandIdx][tmp]; - } -#ifdef DEBUGGING - else - { - /* HOA3 filter coefficients */ - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: The tables corresponding to HOA3 for BRIR are missing \n\n" ); - } -#endif - } - else - { - if ( isLoudspeaker ) - { - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal[bandIdx][tmp]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag[bandIdx][tmp]; - } - else - { - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) - { - /* HOA3 filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA3[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA3[bandIdx][chIdx]; - } - else if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) - { - /* HOA2 filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA2[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA2[bandIdx][chIdx]; - } - else if ( input_config == IVAS_AUDIO_CONFIG_FOA ) - { - /* FOA filter coefficients */ - hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsLeftImag[bandIdx][chIdx] = hHrtf->leftHRIRImag_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_FOA[bandIdx][chIdx]; - hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_FOA[bandIdx][chIdx]; - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - } -#endif } } @@ -467,7 +371,6 @@ void ivas_init_binaural_hrtf( { int16_t i; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal = NULL; HrtfFastConv->leftImag = NULL; HrtfFastConv->rightReal = NULL; @@ -477,44 +380,6 @@ void ivas_init_binaural_hrtf( HrtfFastConv->n_channels = 0; HrtfFastConv->allocate_init_flag = 0x00; HrtfFastConv->ntaps = 0; -#else - HrtfFastConv->leftHRIRReal_HOA3 = NULL; - HrtfFastConv->leftHRIRImag_HOA3 = NULL; - HrtfFastConv->rightHRIRReal_HOA3 = NULL; - HrtfFastConv->rightHRIRImag_HOA3 = NULL; - HrtfFastConv->FASTCONV_HOA3_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal = NULL; - HrtfFastConv->leftHRIRImag = NULL; - HrtfFastConv->rightHRIRReal = NULL; - HrtfFastConv->rightHRIRImag = NULL; - HrtfFastConv->FASTCONV_HRIR_latency_s = 0x00; - - HrtfFastConv->leftBRIRReal = NULL; - HrtfFastConv->leftBRIRImag = NULL; - HrtfFastConv->rightBRIRReal = NULL; - HrtfFastConv->rightBRIRImag = NULL; - HrtfFastConv->FASTCONV_BRIR_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal_HOA2 = NULL; - HrtfFastConv->leftHRIRImag_HOA2 = NULL; - HrtfFastConv->rightHRIRReal_HOA2 = NULL; - HrtfFastConv->rightHRIRImag_HOA2 = NULL; - HrtfFastConv->FASTCONV_HOA2_latency_s = 0x00; - - HrtfFastConv->leftHRIRReal_FOA = NULL; - HrtfFastConv->leftHRIRImag_FOA = NULL; - HrtfFastConv->rightHRIRReal_FOA = NULL; - HrtfFastConv->rightHRIRImag_FOA = NULL; - HrtfFastConv->FASTCONV_FOA_latency_s = 0x00; - - HrtfFastConv->allocate_init_flag = 0x00; - HrtfFastConv->ntaps_hrir = BINAURAL_NTAPS; - HrtfFastConv->ntaps_hrir_foa = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_hrir_hoa2 = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_hrir_hoa3 = BINAURAL_NTAPS_SBA; - HrtfFastConv->ntaps_brir = BINAURAL_NTAPS_MAX; -#endif for ( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) { @@ -579,17 +444,10 @@ static ivas_error ivas_alloc_pppMem( ivas_error ivas_allocate_binaural_hrtf( HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM const int16_t n_channels, /* i : number of input channels */ -#else - const AUDIO_CONFIG input_config, /* i : input audio configuration */ - const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config, /* i : binaural input audio config */ - const RENDERER_TYPE renderer_type, /* i : renderer type */ -#endif const int16_t allocate_init_flag /* i : Memory allocation flag */ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->n_channels = n_channels; if ( ( HrtfFastConv->leftReal != NULL ) && ( HrtfFastConv->leftImag != NULL ) && ( HrtfFastConv->rightReal != NULL ) && ( HrtfFastConv->rightImag != NULL ) ) @@ -615,134 +473,6 @@ ivas_error ivas_allocate_binaural_hrtf( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HrtfFastConv->rightImag" ); } } -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - if ( ( HrtfFastConv->leftHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA3 != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_HOA3" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_HOA3, BINAURAL_CONVBANDS, HOA3_CHANNELS, HrtfFastConv->ntaps_hrir_hoa3, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_HOA3" ); - } - } - } - - if ( input_config == IVAS_AUDIO_CONFIG_HOA2 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - if ( ( HrtfFastConv->leftHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA2 != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_HOA2" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_HOA2, BINAURAL_CONVBANDS, HOA2_CHANNELS, HrtfFastConv->ntaps_hrir_hoa2, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_HOA2" ); - } - } - } - - if ( input_config == IVAS_AUDIO_CONFIG_FOA || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - if ( ( HrtfFastConv->leftHRIRReal_FOA != NULL ) && ( HrtfFastConv->leftHRIRImag_FOA != NULL ) && ( HrtfFastConv->rightHRIRReal_FOA != NULL ) && ( HrtfFastConv->rightHRIRImag_FOA != NULL ) ) - { - return IVAS_ERR_OK; - } - else - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal_FOA" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag_FOA, BINAURAL_CONVBANDS, FOA_CHANNELS, HrtfFastConv->ntaps_hrir_foa, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag_FOA" ); - } - } - } - - else if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) || ( renderer_type == RENDERER_BINAURAL_FASTCONV && input_config != IVAS_AUDIO_CONFIG_INVALID ) ) - { - if ( ( HrtfFastConv->leftHRIRReal == NULL ) && ( HrtfFastConv->leftHRIRImag == NULL ) && ( HrtfFastConv->rightHRIRReal == NULL ) && ( HrtfFastConv->rightHRIRImag == NULL ) ) - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftHRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftHRIRImag" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightHRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_hrir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightHRIRImag" ); - } - } - } - - else if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) || ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && input_config != IVAS_AUDIO_CONFIG_INVALID ) ) - { - if ( ( HrtfFastConv->leftBRIRReal == NULL ) && ( HrtfFastConv->leftBRIRImag == NULL ) && ( HrtfFastConv->rightBRIRReal == NULL ) && ( HrtfFastConv->rightBRIRImag == NULL ) ) - { - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftBRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->leftBRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for leftBRIRImag" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightBRIRReal, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightBRIRReal" ); - } - if ( IVAS_ERR_OK != ivas_alloc_pppMem( &HrtfFastConv->rightBRIRImag, BINAURAL_CONVBANDS, HRTF_LS_CHANNELS, HrtfFastConv->ntaps_brir, allocate_init_flag ) ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for rightBRIRImag" ); - } - } - } -#endif return IVAS_ERR_OK; } @@ -762,9 +492,7 @@ static ivas_error ivas_binaural_hrtf_open( { int16_t i, j; ivas_error error; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM int16_t n_channels; -#endif if ( hHrtfFastConv != NULL && *hHrtfFastConv != NULL ) { @@ -785,53 +513,32 @@ static ivas_error ivas_binaural_hrtf_open( if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HRIR_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS; -#else - HrtfFastConv->FASTCONV_HRIR_latency_s = FASTCONV_HRIR_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HOA2_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_HOA2_latency_s = FASTCONV_HOA2_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_HOA3_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_HOA3_latency_s = FASTCONV_HOA3_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_FOA ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_FOA_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_SBA; -#else - HrtfFastConv->FASTCONV_FOA_latency_s = FASTCONV_FOA_latency_s; -#endif } if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->FASTCONV_latency_s = FASTCONV_BRIR_latency_s; HrtfFastConv->ntaps = BINAURAL_NTAPS_MAX; -#else - HrtfFastConv->FASTCONV_BRIR_latency_s = FASTCONV_BRIR_latency_s; -#endif } HrtfFastConv->allocate_init_flag = 1; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM n_channels = 0; if ( ( renderer_type == RENDERER_BINAURAL_FASTCONV || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && input_config != IVAS_AUDIO_CONFIG_INVALID ) { @@ -855,125 +562,65 @@ static ivas_error ivas_binaural_hrtf_open( } if ( ( error = ivas_allocate_binaural_hrtf( HrtfFastConv, n_channels, HrtfFastConv->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( HrtfFastConv, input_config, BINAURAL_INPUT_AUDIO_CONFIG_INVALID, renderer_type, HrtfFastConv->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( renderer_type == RENDERER_BINAURAL_FASTCONV && HrtfFastConv->n_channels == HRTF_LS_CHANNELS ) -#else - if ( renderer_type == RENDERER_BINAURAL_FASTCONV ) -#endif { for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag[i][j]; -#else - HrtfFastConv->leftHRIRReal[i][j] = leftHRIRReal[i][j]; - HrtfFastConv->leftHRIRImag[i][j] = leftHRIRImag[i][j]; - HrtfFastConv->rightHRIRReal[i][j] = rightHRIRReal[i][j]; - HrtfFastConv->rightHRIRImag[i][j] = rightHRIRImag[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && HrtfFastConv->n_channels == HRTF_LS_CHANNELS ) -#else - else if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) -#endif { for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftBRIRReal[i][j]; HrtfFastConv->leftImag[i][j] = leftBRIRImag[i][j]; HrtfFastConv->rightReal[i][j] = rightBRIRReal[i][j]; HrtfFastConv->rightImag[i][j] = rightBRIRImag[i][j]; -#else - HrtfFastConv->leftBRIRReal[i][j] = leftBRIRReal[i][j]; - HrtfFastConv->leftBRIRImag[i][j] = leftBRIRImag[i][j]; - HrtfFastConv->rightBRIRReal[i][j] = rightBRIRReal[i][j]; - HrtfFastConv->rightBRIRImag[i][j] = rightBRIRImag[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_HOA3 && HrtfFastConv->n_channels == HOA3_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) -#endif { for ( j = 0; j < HOA3_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_HOA3[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_HOA3[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_HOA3[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_HOA3[i][j]; -#else - HrtfFastConv->leftHRIRReal_HOA3[i][j] = leftHRIRReal_HOA3[i][j]; - HrtfFastConv->leftHRIRImag_HOA3[i][j] = leftHRIRImag_HOA3[i][j]; - HrtfFastConv->rightHRIRReal_HOA3[i][j] = rightHRIRReal_HOA3[i][j]; - HrtfFastConv->rightHRIRImag_HOA3[i][j] = rightHRIRImag_HOA3[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* Note: IVAS_AUDIO_CONFIG_HOA2 and IVAS_AUDIO_CONFIG_FOA input configs. are not relevant in internal renderer as SBA to binaural always synthesizes HOA3 output for binauralization. However, the external renderer can use them. */ -#endif -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_HOA2 && HrtfFastConv->n_channels == HOA2_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) -#endif { for ( j = 0; j < HOA2_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_HOA2[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_HOA2[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_HOA2[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_HOA2[i][j]; -#else - HrtfFastConv->leftHRIRReal_HOA2[i][j] = leftHRIRReal_HOA2[i][j]; - HrtfFastConv->leftHRIRImag_HOA2[i][j] = leftHRIRImag_HOA2[i][j]; - HrtfFastConv->rightHRIRReal_HOA2[i][j] = rightHRIRReal_HOA2[i][j]; - HrtfFastConv->rightHRIRImag_HOA2[i][j] = rightHRIRImag_HOA2[i][j]; -#endif } } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( input_config == IVAS_AUDIO_CONFIG_FOA && HrtfFastConv->n_channels == FOA_CHANNELS ) -#else - if ( input_config == IVAS_AUDIO_CONFIG_FOA ) -#endif { for ( j = 0; j < FOA_CHANNELS; j++ ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM HrtfFastConv->leftReal[i][j] = leftHRIRReal_FOA[i][j]; HrtfFastConv->leftImag[i][j] = leftHRIRImag_FOA[i][j]; HrtfFastConv->rightReal[i][j] = rightHRIRReal_FOA[i][j]; HrtfFastConv->rightImag[i][j] = rightHRIRImag_FOA[i][j]; -#else - HrtfFastConv->leftHRIRReal_FOA[i][j] = leftHRIRReal_FOA[i][j]; - HrtfFastConv->leftHRIRImag_FOA[i][j] = leftHRIRImag_FOA[i][j]; - HrtfFastConv->rightHRIRReal_FOA[i][j] = rightHRIRReal_FOA[i][j]; - HrtfFastConv->rightHRIRImag_FOA[i][j] = rightHRIRImag_FOA[i][j]; -#endif } } } @@ -1212,27 +859,7 @@ ivas_error ivas_rend_openCldfbRend( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_HOA2_latency_s * 1000000000.f ); - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) - { - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); - } - else - { - /* should never happen for SBA */ - return IVAS_ERR_INVALID_OUTPUT_FORMAT; - } -#endif hBinRenderer->hReverb = NULL; hBinRenderer->hEFAPdata = NULL; @@ -1355,11 +982,7 @@ ivas_error ivas_binRenderer_open( } hBinRenderer->hoa_dec_mtx = st_ivas->hoa_dec_mtx; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_BRIR_latency_s * 1000000000.f ); -#endif } else { @@ -1369,41 +992,7 @@ ivas_error ivas_binRenderer_open( return error; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_latency_s * 1000000000.f ); -#else - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) - { - if ( hBinRenderer->ivas_format == MC_FORMAT ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HRIR_latency_s * 1000000000.f ); - } - else - { - if ( hBinRenderer->nInChannels == HOA3_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); - } - else if ( hBinRenderer->nInChannels == HOA2_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA2_latency_s * 1000000000.f ); - } - else if ( hBinRenderer->nInChannels == FOA_CHANNELS ) - { - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); - } - else - { - return IVAS_ERR_INVALID_INPUT_FORMAT; - } - } - } - else - { - /* same value for MC or HOA both use MC BRIR*/ - st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_BRIR_latency_s * 1000000000.f ); - } -#endif } /* Allocate memories needed for reverb module */ @@ -1625,9 +1214,7 @@ void ivas_binaural_hrtf_close( ) { int16_t allocate_init_flag; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM int16_t n_channels; -#endif if ( hHrtfFastConv == NULL || *hHrtfFastConv == NULL ) { @@ -1635,40 +1222,12 @@ void ivas_binaural_hrtf_close( } allocate_init_flag = ( *hHrtfFastConv )->allocate_init_flag; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM n_channels = ( *hHrtfFastConv )->n_channels; ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftReal, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftImag, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightReal, n_channels, allocate_init_flag ); ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightImag, n_channels, allocate_init_flag ); -#else - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftBRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftBRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightBRIRReal, HRTF_LS_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightBRIRImag, HRTF_LS_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_HOA3, HOA3_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_HOA3, HOA3_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_HOA2, HOA2_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_HOA2, HOA2_CHANNELS, allocate_init_flag ); - - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRReal_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->leftHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRReal_FOA, FOA_CHANNELS, allocate_init_flag ); - ivas_free_pppHrtfMem( &( *hHrtfFastConv )->rightHRIRImag_FOA, FOA_CHANNELS, allocate_init_flag ); -#endif return; } diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index fff019e028..cb5dfc379a 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2175,13 +2175,8 @@ ivas_error ivas_init_decoder( } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, - st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2661,11 +2656,7 @@ void ivas_initialize_handles_dec( st_ivas->hMonoDmxRenderer = NULL; st_ivas->hCrendWrapper = NULL; st_ivas->hReverb = NULL; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM st_ivas->hHrtfCrend = NULL; -#else - st_ivas->hSetOfHRTF = NULL; -#endif st_ivas->hHrtfFastConv = NULL; st_ivas->hHrtfParambin = NULL; st_ivas->hHrtfStatistics = NULL; @@ -2883,11 +2874,7 @@ void ivas_destroy_dec( } /* CRend binaural renderer handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend ); -#else - ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); -#endif /* Fastconv HRTF memories */ ivas_binaural_hrtf_close( &st_ivas->hHrtfFastConv ); diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index cf215d34c7..73730532c7 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -199,11 +199,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( ivas_omasa_data_close( &st_ivas->hMasaIsmData ); /* Open Crend Binaural renderer */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hOutSetup.output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index b7c5393013..1479ba3c25 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -1241,11 +1241,7 @@ static ivas_error ivas_mc_dec_reconfig( } else if ( st_ivas->hCrendWrapper == NULL && ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hHrtfCrend, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, 0, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &( st_ivas->hCrendWrapper ), st_ivas->intern_config, st_ivas->hDecoderConfig->output_config, st_ivas->hRenderConfig, st_ivas->hSetOfHRTF, st_ivas->hHrtfStatistics, st_ivas->hDecoderConfig->output_Fs, ( st_ivas->hSplitBinRend == NULL ) ? 1 : st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4dce5c64ce..ae68c9abca 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1100,11 +1100,7 @@ typedef struct Decoder_Struct MONO_DOWNMIX_RENDERER_HANDLE hMonoDmxRenderer; /* Mono downmix structure */ CREND_WRAPPER_HANDLE hCrendWrapper; /* Crend handle */ REVERB_HANDLE hReverb; /* Reverb handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend; /* HRTF tables for CRend binaural renderer */ -#else - HRTFS_CREND_HANDLE hSetOfHRTF; /* Set of HRTFs handle (CRend) */ -#endif HRTFS_FASTCONV_HANDLE hHrtfFastConv; /* FASTCONV HRTF tables for binaural rendering */ HRTFS_PARAMBIN_HANDLE hHrtfParambin; /* HRTF tables for parametric binauralizer */ HRTFS_STATISTICS_HANDLE hHrtfStatistics; /* HRTF statistics handle */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 8ac62b87c3..c364494200 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -909,12 +909,7 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec, /* o : secondary binaural renderer type */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ -#else - int16_t *room_reverb_flag, /* o : room reverb flag */ - IVAS_AUDIO_CONFIG *intern_audio_config /* o : internal audio configuration */ -#endif ) { ivas_error error; @@ -923,11 +918,7 @@ ivas_error IVAS_DEC_ReadFormat( ISM_MODE ism_mode_old; MC_MODE mc_mode_old; int16_t nchan_transport_old; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM AUDIO_CONFIG intern_config_old, transport_config_old, output_config; -#else - AUDIO_CONFIG intern_config_old, transport_config_old; -#endif RENDERER_TYPE renderer_type_old; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) @@ -944,10 +935,8 @@ ivas_error IVAS_DEC_ReadFormat( transport_config_old = st_ivas->transport_config; renderer_type_old = st_ivas->renderer_type; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM output_config = st_ivas->hDecoderConfig->output_config; -#endif if ( st_ivas->ivas_format == MONO_FORMAT ) { @@ -979,18 +968,9 @@ ivas_error IVAS_DEC_ReadFormat( break; case RENDERER_BINAURAL_FASTCONV: *binaural_renderer = IVAS_BIN_RENDERER_TYPE_FASTCONV; -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - *room_reverb_flag = 1; - } -#endif break; case RENDERER_BINAURAL_FASTCONV_ROOM: *binaural_renderer = IVAS_BIN_RENDERER_TYPE_FASTCONV; -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - *room_reverb_flag = 1; -#endif break; case RENDERER_BINAURAL_PARAMETRIC: case RENDERER_BINAURAL_PARAMETRIC_ROOM: @@ -1002,16 +982,11 @@ ivas_error IVAS_DEC_ReadFormat( } *binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_BINAURAL ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->ism_mode == ISM_MASA_MODE_DISC && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL ) -#endif { *binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_TDREND; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM *hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID; if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_FASTCONV ) { @@ -1039,7 +1014,6 @@ ivas_error IVAS_DEC_ReadFormat( } } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM else if ( *binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND ) { if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -1059,10 +1033,6 @@ ivas_error IVAS_DEC_ReadFormat( } } } -#endif -#else - *intern_audio_config = st_ivas->intern_config; -#endif if ( ( renderer_type_old != st_ivas->renderer_type && renderer_type_old != RENDERER_DISABLE ) || ( st_ivas->ini_active_frame > 0 && ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->ism_mode != ISM_MASA_MODE_DISC ) ) @@ -2708,28 +2678,15 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#endif ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hHrtfCrend == NULL ) { return IVAS_ERR_WRONG_PARAMS; } *hHrtfCrend = &hIvasDec->st_ivas->hHrtfCrend; -#else - if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hSetOfHRTF == NULL ) - { - return IVAS_ERR_WRONG_PARAMS; - } - - *hSetOfHRTF = &hIvasDec->st_ivas->hSetOfHRTF; -#endif return IVAS_ERR_OK; } @@ -2833,17 +2790,9 @@ ivas_error IVAS_DEC_HRTF_binary_open( } /* Crend binaural renderer */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hHrtfCrend == NULL ) -#else - if ( ( binaural_renderer == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer == IVAS_BIN_RENDERER_TYPE_DEFAULT ) && st_ivas->hSetOfHRTF == NULL ) -#endif { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open( &( st_ivas->hHrtfCrend ) ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_HRTF_CRend_binary_open( &( st_ivas->hSetOfHRTF ) ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2916,11 +2865,7 @@ ivas_error IVAS_DEC_HRTF_binary_close( if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_CREND || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) { /* CRend binaural renderer handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_HRTF_CRend_binary_close( &st_ivas->hHrtfCrend ); -#else - ivas_HRTF_CRend_binary_close( &st_ivas->hSetOfHRTF ); -#endif } if ( !( binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_FASTCONV || binaural_renderer_old == IVAS_BIN_RENDERER_TYPE_DEFAULT ) ) diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 43dcfb33ba..0fa179768a 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -157,12 +157,7 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec,/* o: secondary binaural renderer type */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ -#else - int16_t *room_reverb_flag, /* o : room reverb flag */ - IVAS_AUDIO_CONFIG *intern_audio_config /* o : internal audio configuration */ -#endif ); /*! r: decoder error code */ @@ -444,11 +439,7 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( /*! r: error code */ ivas_error IVAS_DEC_GetHrtfCRendHandle( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ -#else - IVAS_DEC_HRTF_CREND_HANDLE **hSetOfHRTF /* o : Set of HRTF handle */ -#endif ); ivas_error IVAS_DEC_GetHrtfFastConvHandle( diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 555351a985..6ff135bbd3 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -53,15 +53,9 @@ * Initialize hHrtf handle *------------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_Crend_hrtf_init( HRTFS_CREND_DATA *hHrtf /* i/o: HRTF handle */ ) -#else -ivas_error ivas_hrtf_init( - HRTFS_DATA *hHrtf /* i/o: HRTF handle */ -) -#endif { int16_t i, j; @@ -123,11 +117,7 @@ static ivas_error ivas_hrtf_open( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend HRTFS Handle\n" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_Crend_hrtf_init( hHrtf ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_hrtf_init( hHrtf ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -175,19 +165,11 @@ static ivas_error ivas_rend_initCrend( CREND_WRAPPER *pCrend, const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, const int16_t ext_rend_flag, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif const int32_t output_Fs ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM int16_t i, j, tmp, tmp2; -#else - int16_t i, j, tmp; -#endif int16_t nchan_in; IVAS_REND_AudioConfigType inConfigType; HRTFS_HANDLE hHrtf; @@ -209,7 +191,6 @@ static ivas_error ivas_rend_initCrend( if ( hHrtf == NULL ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtfCrend != NULL && ext_rend_flag == 0 ) { /* HRTF set loaded from binary file */ @@ -230,13 +211,6 @@ static ivas_error ivas_rend_initCrend( hHrtf->init_from_rom = 0; } } -#else - if ( ivas_hrtf_open( &hHrtf ) != IVAS_ERR_OK ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for HRTF handle" ); - } - -#endif } if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) @@ -250,21 +224,8 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERR_INTERNAL_FATAL; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtf->init_from_rom ) -#else - if ( ( hSetOfHRTF == NULL ) || - ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL ) ) || - ( ( hSetOfHRTF->hHRTF_brir_combined == NULL ) && ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) && ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_FOA ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) ) || - ( ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) && ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) ) ) -#endif { -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - hHrtf->init_from_rom = 1; -#endif if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -740,7 +701,6 @@ static ivas_error ivas_rend_initCrend( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { hHrtf->max_num_ir -= 1; /* subtract LFE */ @@ -848,195 +808,6 @@ static ivas_error ivas_rend_initCrend( } } } -#else - hHrtf->init_from_rom = 0; - if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) - { - hHrtf->max_num_ir -= 1; /* subtract LFE */ - hHrtf->gain_lfe = GAIN_LFE; - - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - if ( hSetOfHRTF->hHRTF_brir_combined == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters " ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_brir_combined->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_brir_combined->index_frequency_max_diffuse; - } - else - { - if ( hSetOfHRTF->hHRTF_hrir_combined == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_combined->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_combined->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_combined->index_frequency_max_diffuse; - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_diffuse_im[j]; - } - else - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_diffuse_im[j]; - } - } - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - if ( inConfig == IVAS_AUDIO_CONFIG_5_1 ) - { - tmp = channelIndex_CICP6[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_7_1 ) - { - tmp = channelIndex_CICP12[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_2 ) - { - tmp = channelIndex_CICP14[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) - { - tmp = channelIndex_CICP16[i]; - } - else if ( inConfig == IVAS_AUDIO_CONFIG_7_1_4 ) - { - tmp = channelIndex_CICP19[i]; - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); - } - - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[j][tmp]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_re[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_brir_combined->pOut_to_bin_im[tmp][j]; - } - else - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_combined->inv_diffuse_weight[j][tmp]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_combined->num_iterations[tmp][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pIndex_frequency_max[tmp][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_re[tmp][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_combined->pOut_to_bin_im[tmp][j]; - } - } - } - } - else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) - { - if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) - { - if ( hSetOfHRTF->hHRTF_hrir_hoa3 == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa3->index_frequency_max_diffuse; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa3->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa3->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_im[j]; - } - } - else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) - { - if ( hSetOfHRTF->hHRTF_hrir_hoa2 == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_hoa2->index_frequency_max_diffuse; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_hoa2->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa2->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_im[j]; - } - } - else if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) - { - if ( hSetOfHRTF->hHRTF_hrir_foa == NULL ) - { - return IVAS_ERROR( IVAS_ERR_UNEXPECTED_NULL_POINTER, "Invalid function parameters" ); - } - hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s; - hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations; - hHrtf->index_frequency_max_diffuse = hSetOfHRTF->hHRTF_hrir_foa->index_frequency_max_diffuse; - - for ( i = 0; i < hHrtf->max_num_ir; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->inv_diffuse_weight[j][i] = hSetOfHRTF->hHRTF_hrir_foa->inv_diffuse_weight[j][i]; - hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations[i][j]; - hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max[i][j]; - hHrtf->pOut_to_bin_re[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_re[i][j]; - hHrtf->pOut_to_bin_im[i][j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_im[i][j]; - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_hrir_foa->num_iterations_diffuse[j]; - hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_hrir_foa->pIndex_frequency_max_diffuse[j]; - hHrtf->pOut_to_bin_diffuse_re[j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_diffuse_re[j]; - hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_foa->pOut_to_bin_diffuse_im[j]; - } - } - else - { - return IVAS_ERROR( IVAS_ERR_INTERNAL, "Unsupported renderer type in Crend" ); - } - } -#endif } hHrtf->same_inv_diffuse_weight = 1; @@ -1359,11 +1130,7 @@ ivas_error ivas_rend_openMultiBinCrend( const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM return ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, 0, pMultiBinPoseData->num_poses ); -#else - return ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, NULL /* hHrtfStatistics */, output_Fs, pMultiBinPoseData->num_poses ); -#endif } @@ -1378,16 +1145,10 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM const int16_t ext_rend_flag, -#endif const int16_t num_poses ) { int16_t i, subframe_length; @@ -1408,11 +1169,7 @@ ivas_error ivas_rend_openCrend( if ( ( *pCrend )->hHrtfCrend == NULL ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hHrtfCrend, ext_rend_flag, output_Fs ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_initCrend( *pCrend, inConfig, outConfig, hSetOfHRTF, output_Fs ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1595,11 +1352,7 @@ void ivas_rend_closeCrend( return; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( *pCrend )->hHrtfCrend != NULL && ( *pCrend )->hHrtfCrend->init_from_rom ) -#else - if ( ( *pCrend )->hHrtfCrend != NULL && ( *pCrend )->hHrtfCrend->init_from_rom ) -#endif { ivas_hrtf_close( &( *pCrend )->hHrtfCrend ); } diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 815ff89ea4..58fdf3dc10 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -88,7 +88,6 @@ void ivas_HRTF_binary_close( * Allocate HRTF binary handle for Crend renderer *-----------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_HRTF_CRend_binary_open( HRTFS_CREND_DATA **hHrtfCrend ) { @@ -106,28 +105,7 @@ ivas_error ivas_HRTF_CRend_binary_open( return IVAS_ERR_OK; } -#else -ivas_error ivas_HRTF_CRend_binary_open( - HRTFS_CREND **hSetOfHRTF ) -{ - /* Allocate HR filter set for headphones configuration */ - *hSetOfHRTF = (HRTFS_CREND *) malloc( sizeof( HRTFS_CREND ) ); - if ( *hSetOfHRTF == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for set of HRTF binary!" ); - } - - ( *hSetOfHRTF )->hHRTF_hrir_combined = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_hoa3 = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_hoa2 = NULL; - ( *hSetOfHRTF )->hHRTF_hrir_foa = NULL; - ( *hSetOfHRTF )->hHRTF_brir_combined = NULL; - - return IVAS_ERR_OK; -} -#endif -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*-----------------------------------------------------------------------* * ivas_HRTF_CRend_binary_open_buffers_uint16() @@ -172,7 +150,6 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( return IVAS_ERR_OK; } -#endif /*-------------------------------------------------------------------* * ivas_HRTF_CRend_binary_close() @@ -180,7 +157,6 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( * Close HRTF CRend binary handle for Crend renderer *-------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM void ivas_HRTF_CRend_binary_close( HRTFS_CREND_DATA **hHrtfCrend ) { @@ -230,21 +206,6 @@ void ivas_HRTF_CRend_binary_close( return; } -#else -void ivas_HRTF_CRend_binary_close( - HRTFS_CREND **hSetOfHRTF ) -{ - if ( hSetOfHRTF == NULL || *hSetOfHRTF == NULL ) - { - return; - } - - free( *hSetOfHRTF ); - *hSetOfHRTF = NULL; - - return; -} -#endif /*-----------------------------------------------------------------------* diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index d4a75254a3..282ec9bd6a 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -576,14 +576,9 @@ void ivas_HRTF_parambin_binary_close( ); ivas_error ivas_HRTF_CRend_binary_open( -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ -#else - HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ -#endif ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_HRTF_CRend_binary_open_buffers_uint16( uint16_t **buffer, /* o : buffer to allocate */ const uint32_t mem_size /* i : size of buffer */ @@ -594,13 +589,8 @@ ivas_error ivas_HRTF_CRend_binary_open_buffers_float( const uint32_t mem_size /* i : size of buffer */ ); -#endif void ivas_HRTF_CRend_binary_close( -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_DATA **hHrtfCrend /* i/o: Crend HRTF handle */ -#else - HRTFS_CREND **hSetOfHRTF /* i/o: Set of HRTF handle */ -#endif ); ivas_error ivas_HRTF_statistics_init( @@ -912,16 +902,10 @@ ivas_error ivas_rend_openCrend( const AUDIO_CONFIG inConfig, const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM HRTFS_CREND_HANDLE hHrtfCrend, -#else - HRTFS_CREND_HANDLE hSetOfHRTF, -#endif HRTFS_STATISTICS_HANDLE hHrtfStatistics, const int32_t output_Fs, -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM const int16_t ext_rend_flag, -#endif const int16_t num_poses ); @@ -930,15 +914,9 @@ void ivas_rend_closeCrend( const int16_t num_poses ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error ivas_Crend_hrtf_init( HRTFS_CREND_DATA *hHrtf /* i/o: Crend HRTF handle */ ); -#else -ivas_error ivas_hrtf_init( - HRTFS_DATA *hHrtf /* i/o: HRTF handle */ -); -#endif ivas_error ivas_rend_initCrendWrapper( CREND_WRAPPER_HANDLE *pCrend, diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index eaa1dcad36..e737d4a7e2 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1157,11 +1157,7 @@ typedef struct * Crend structures *------------------------------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM typedef struct ivas_hrtf_crend_structure -#else -typedef struct ivas_hrtfs_structure -#endif { const float *pOut_to_bin_re[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; const float *pOut_to_bin_im[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; @@ -1186,11 +1182,7 @@ typedef struct ivas_hrtfs_structure uint16_t *pIndex_frequency_max_dyn[MAX_INTERN_CHANNELS][BINAURAL_CHANNELS]; uint16_t *pIndex_frequency_max_diffuse_dyn[BINAURAL_CHANNELS]; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM } HRTFS_DATA, *HRTFS_HANDLE, HRTFS_CREND_DATA, *HRTFS_CREND_HANDLE; // VE: all instance of HRTFS_DATAand *HRTFS_HANDLE should be renamed to HRTFS_CREND_DATA and *HRTFS_CREND_HANDLE -#else -} HRTFS_DATA, *HRTFS_HANDLE; -#endif /* Main Crend structure */ typedef struct ivas_crend_state_t @@ -1252,70 +1244,18 @@ typedef struct ivas_binaural_rendering_struct * HRTF structures - hrtfs from binary files *------------------------------------------------------------------------------------------*/ -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM -typedef struct ivas_hrtfs_crend_structure -{ - HRTFS_DATA *hHRTF_hrir_combined; - HRTFS_DATA *hHRTF_hrir_hoa3; - HRTFS_DATA *hHRTF_hrir_hoa2; - HRTFS_DATA *hHRTF_hrir_foa; - HRTFS_DATA *hHRTF_brir_combined; - -} HRTFS_CREND, *HRTFS_CREND_HANDLE; - -#endif /* Fastconv binaural data structure */ typedef struct ivas_hrtfs_fastconv_struct { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM float FASTCONV_latency_s; float ***leftReal; float ***leftImag; float ***rightReal; float ***rightImag; int16_t n_channels; -#else - float FASTCONV_HOA3_latency_s; - float ***leftHRIRReal_HOA3; - float ***leftHRIRImag_HOA3; - float ***rightHRIRReal_HOA3; - float ***rightHRIRImag_HOA3; - - float FASTCONV_HRIR_latency_s; - float ***leftHRIRReal; - float ***leftHRIRImag; - float ***rightHRIRReal; - float ***rightHRIRImag; - - float ***leftBRIRReal; - float ***leftBRIRImag; - float ***rightBRIRReal; - float ***rightBRIRImag; - float FASTCONV_BRIR_latency_s; - - float ***leftHRIRReal_HOA2; - float ***leftHRIRImag_HOA2; - float ***rightHRIRReal_HOA2; - float ***rightHRIRImag_HOA2; - float FASTCONV_HOA2_latency_s; - - float ***leftHRIRReal_FOA; - float ***leftHRIRImag_FOA; - float ***rightHRIRReal_FOA; - float ***rightHRIRImag_FOA; - float FASTCONV_FOA_latency_s; -#endif int16_t allocate_init_flag; /*Memory allocation flag 0: if the hrtf pointers are allocated at application level , 1: of allocated at ivas_binaural_hrtf_open() */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM uint16_t ntaps; -#else - uint16_t ntaps_hrir; - uint16_t ntaps_hrir_hoa3; - uint16_t ntaps_hrir_hoa2; - uint16_t ntaps_hrir_foa; - uint16_t ntaps_brir; -#endif float fastconvReverberationTimes[CLDFB_NO_CHANNELS_MAX]; float fastconvReverberationEneCorrections[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e9a13a9aa0..e73dfd9001 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1367,11 +1367,7 @@ static ivas_error setRendInputActiveIsm( } else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hrtfs->hSetOfHRTF, hrtfs->hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2143,13 +2139,8 @@ static ivas_error initMcBinauralRendering( else if ( !useTDRend && inputMc->crendWrapper == NULL ) { /* open CREND */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, outSampleRate, 1, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, - outSampleRate, ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2547,11 +2538,7 @@ static ivas_error updateSbaPanGains( } else { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -2563,11 +2550,7 @@ static ivas_error updateSbaPanGains( return error; } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, 1, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, hMixconv, hHrtfStatistics, *rendCtx.pOutSampleRate, rendCtx.pSplitRendWrapper != NULL ? rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -7669,9 +7652,7 @@ void IVAS_REND_Close( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { clearInputSba( &hIvasRend->inputsSba[i] ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM hIvasRend->hHrtfs.hHrtfFastConv = NULL; -#endif } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index f3517edd30..e29f829df4 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -242,7 +242,6 @@ static ivas_error read_hrtf_binary_header( return IVAS_ERR_END_OF_FILE; } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /*-------------------------------------------------------------------* * audio_cfg_2_binaural_cfg() @@ -278,7 +277,6 @@ static BINAURAL_INPUT_AUDIO_CONFIG audio_cfg_2_binaural_cfg( return hrtf_set_binaural_cfg; } -#endif /*-------------------------------------------------------------------* * TDREND_LoadBSplineBinaryITD() @@ -1120,11 +1118,7 @@ void destroy_td_hrtf( * Create HRTF from the raw data (to the HRTF CRend handle) *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM static ivas_error create_Crend_HRTF_from_rawdata( -#else -static ivas_error create_HRTF_from_rawdata( -#endif HRTFS_HANDLE *hHRTF, /* i/o: HRTF CRend handle */ char *hrtf_data /* i : pointer to binary file */ ) @@ -1132,34 +1126,12 @@ static ivas_error create_HRTF_from_rawdata( int16_t i, j, k; int16_t max_num_iterations_diffuse; uint32_t max_total_num_fsamp_per_iteration, max_total_num_fsamp_per_iteration_diff; -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM uint32_t mem_size, mem_size_buf, l; -#else - uint32_t mem_size, l; -#endif char *hrtf_data_rptr; float *pOut_to_bin_wptr; ivas_error error; Word16 factorQ; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - if ( *hHRTF == NULL ) - { - if ( ( ( *hHRTF ) = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" ); - } - - if ( ( error = ivas_hrtf_init( *hHRTF ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - return IVAS_ERR_INTERNAL; - } -#endif if ( hrtf_data == NULL ) { @@ -1202,28 +1174,17 @@ static ivas_error create_HRTF_from_rawdata( } } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size = ( *hHRTF )->max_num_iterations * sizeof( uint16_t ); -#endif /* pIndex_frequency_max */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_dyn[i][j], mem_size ) ) != IVAS_ERR_OK ) { return error; } -#else - mem_size = ( *hHRTF )->max_num_iterations * sizeof( uint16_t ); - ( *hHRTF )->pIndex_frequency_max_dyn[i][j] = (uint16_t *) malloc( mem_size ); - if ( ( *hHRTF )->pIndex_frequency_max_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pIndex_frequency_max" ); - } -#endif memcpy( ( *hHRTF )->pIndex_frequency_max_dyn[i][j], hrtf_data_rptr, mem_size ); ( *hHRTF )->pIndex_frequency_max[i][j] = ( *hHRTF )->pIndex_frequency_max_dyn[i][j]; hrtf_data_rptr += mem_size; @@ -1247,18 +1208,10 @@ static ivas_error create_HRTF_from_rawdata( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { mem_size = ( *hHRTF )->num_iterations_diffuse[j] * sizeof( uint16_t ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_uint16( &( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], mem_size ) ) != IVAS_ERR_OK ) { return error; } -#else - ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] = (uint16_t *) malloc( mem_size ); - if ( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pIndex_frequency_max_diffuse" ); - } -#endif memcpy( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j], hrtf_data_rptr, mem_size ); ( *hHRTF )->pIndex_frequency_max_diffuse[j] = ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j]; hrtf_data_rptr += mem_size; @@ -1292,30 +1245,18 @@ static ivas_error create_HRTF_from_rawdata( factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( Word16 ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size_buf = max_total_num_fsamp_per_iteration * sizeof( float ); -#endif /* coeff_re (the size depends on pIndex_frequency_max) */ for ( i = 0; i < ( *hHRTF )->max_num_ir; i++ ) { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_re_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_re_dyn[i][j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration * sizeof( float ); - ( *hHRTF )->pOut_to_bin_re_dyn[i][j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_re_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for Out_to_bin_re" ); - } - memset( ( *hHRTF )->pOut_to_bin_re_dyn[i][j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_re[i][j] = ( *hHRTF )->pOut_to_bin_re_dyn[i][j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_re_dyn[i][j]; @@ -1339,21 +1280,11 @@ static ivas_error create_HRTF_from_rawdata( { for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_im_dyn[i][j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_im_dyn[i][j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration * sizeof( float ); - ( *hHRTF )->pOut_to_bin_im_dyn[i][j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_im_dyn[i][j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for Out_to_bin_im" ); - } - memset( ( *hHRTF )->pOut_to_bin_im_dyn[i][j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_im[i][j] = ( *hHRTF )->pOut_to_bin_im_dyn[i][j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_im_dyn[i][j]; @@ -1375,10 +1306,8 @@ static ivas_error create_HRTF_from_rawdata( max_total_num_fsamp_per_iteration_diff = *( (uint32_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint32_t ); -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM mem_size_buf = max_total_num_fsamp_per_iteration_diff * sizeof( float ); -#endif if ( max_total_num_fsamp_per_iteration_diff != 0 ) { /* factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); */ @@ -1386,21 +1315,11 @@ static ivas_error create_HRTF_from_rawdata( /* coeff_diffuse_re : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration_diff * sizeof( float ); - ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pOut_to_bin_diffuse_re" ); - } - memset( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_diffuse_re[j] = ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j]; @@ -1421,21 +1340,11 @@ static ivas_error create_HRTF_from_rawdata( /* coeff_diffuse_im : The size depends on pIndex_frequency_max_diffuse */ for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( error = ivas_HRTF_CRend_binary_open_buffers_float( &( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], mem_size_buf ) ) != IVAS_ERR_OK ) { return error; } memset( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], 0x00, mem_size_buf ); -#else - mem_size = max_total_num_fsamp_per_iteration_diff * sizeof( float ); - ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] = (float *) malloc( mem_size ); - if ( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] == NULL ) - { - return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate memory for pOut_to_bin_diffuse_im" ); - } - memset( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j], 0x00, mem_size ); -#endif ( *hHRTF )->pOut_to_bin_diffuse_im[j] = ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j]; pOut_to_bin_wptr = ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j]; @@ -1509,12 +1418,10 @@ static ivas_error create_fastconv_HRTF_from_rawdata( ntaps = *( (uint16_t *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( uint16_t ); -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM ( *hHRTF )->ntaps = ntaps; ( *hHRTF )->FASTCONV_latency_s = latency_s; ( *hHRTF )->n_channels = nbchan; -#endif if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1522,10 +1429,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_LS_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir = ntaps; - ( *hHRTF )->FASTCONV_HRIR_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) { @@ -1533,10 +1436,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA3_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_hoa3 = ntaps; - ( *hHRTF )->FASTCONV_HOA3_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) { @@ -1544,10 +1443,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HOA2_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_hoa2 = ntaps; - ( *hHRTF )->FASTCONV_HOA2_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) { @@ -1555,10 +1450,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (FOA_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_hrir_foa = ntaps; - ( *hHRTF )->FASTCONV_FOA_latency_s = latency_s; -#endif } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { @@ -1566,10 +1457,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( { return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "HRTF binary file not compliant (HRTF_LS_CHANNELS)" ); } -#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM - ( *hHRTF )->ntaps_brir = ntaps; - ( *hHRTF )->FASTCONV_BRIR_latency_s = latency_s; -#endif } else { @@ -1578,22 +1465,14 @@ static ivas_error create_fastconv_HRTF_from_rawdata( if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, nbchan, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, IVAS_AUDIO_CONFIG_INVALID, input_cfg, RENDERER_BINAURAL_FASTCONV, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } } else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) { -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, nbchan, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#else - if ( ( error = ivas_allocate_binaural_hrtf( *hHRTF, IVAS_AUDIO_CONFIG_INVALID, input_cfg, RENDERER_BINAURAL_FASTCONV_ROOM, ( *hHRTF )->allocate_init_flag ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -1603,7 +1482,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "renderer type not compliant" ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM /* HRIR/BRIR Q factor*/ factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); hrtf_data_rptr += sizeof( Word16 ); @@ -1661,294 +1539,6 @@ static ivas_error create_fastconv_HRTF_from_rawdata( /* BRIR */ if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) { -#else - /* HRIR */ - if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->leftHRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->leftHRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->rightHRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir; k++ ) - { - ( *hHRTF )->rightHRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->leftHRIRReal_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->leftHRIRImag_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->rightHRIRReal_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA3_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa3; k++ ) - { - ( *hHRTF )->rightHRIRImag_HOA3[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa3 * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->leftHRIRReal_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->leftHRIRImag_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->rightHRIRReal_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HOA2_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_hoa2; k++ ) - { - ( *hHRTF )->rightHRIRImag_HOA2[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_hoa2 * sizeof( Word16 ); - } - } - } - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - - /* HRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->leftHRIRReal_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->leftHRIRImag_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->rightHRIRReal_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < FOA_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_hrir_foa; k++ ) - { - ( *hHRTF )->rightHRIRImag_FOA[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_hrir_foa * sizeof( Word16 ); - } - } - } - /* BRIR */ - else if ( rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - - /* BRIR Q factor*/ - factorQ = *( (Word16 *) ( hrtf_data_rptr ) ); - hrtf_data_rptr += sizeof( Word16 ); - scaleFactor = powf( 2.f, -1.f * factorQ ); - - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->leftBRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->leftBRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->rightBRIRReal[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } - for ( i = 0; i < BINAURAL_CONVBANDS; i++ ) - { - for ( j = 0; j < HRTF_LS_CHANNELS; j++ ) - { - ptW16 = (Word16 *) hrtf_data_rptr; - for ( k = 0; k < ( *hHRTF )->ntaps_brir; k++ ) - { - ( *hHRTF )->rightBRIRImag[i][j][k] = ptW16[k] * scaleFactor; - } - hrtf_data_rptr += ( *hHRTF )->ntaps_brir * sizeof( Word16 ); - } - } -#endif /* Reverb Parameters */ if ( CLDFB_NO_CHANNELS_MAX != *( (uint16_t *) ( hrtf_data_rptr ) ) ) @@ -2112,13 +1702,8 @@ static ivas_error create_parambin_HRTF_from_rawdata( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ -#else - const int16_t room_reverb_flag, /* i : room reverb flag */ - const IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) { @@ -2130,13 +1715,11 @@ ivas_error load_fastconv_HRTF_from_binary( ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; int16_t asFastconv = 0; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM bool load = false; BINAURAL_INPUT_AUDIO_CONFIG hrtf_set_binaural_cfg; /* convert audio config. to HRTF binaural config */ hrtf_set_binaural_cfg = audio_cfg_2_binaural_cfg( hrtf_set_audio_cfg ); -#endif if ( hrtfReader == NULL || hrtfReader->file == NULL ) { @@ -2174,7 +1757,6 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && /* HRIRs */ ( OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL || OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM && /* BRIRs */ @@ -2185,15 +1767,6 @@ ivas_error load_fastconv_HRTF_from_binary( } if ( load ) -#else - if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV && - ( ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 && intern_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA && intern_audio_config == IVAS_AUDIO_CONFIG_FOA ) || - ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) ) ) || - ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && room_reverb_flag == 1 ) || - ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV || hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_FASTCONV_ROOM ) && intern_audio_config == IVAS_AUDIO_CONFIG_INVALID ) ) -#endif { #ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != 48000 ) /* note: Parametric renderer data are always stored at 48 kHz */ @@ -2214,9 +1787,7 @@ ivas_error load_fastconv_HRTF_from_binary( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create FastConv HRTF from binary file" ); } asFastconv = 1; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM break; /* read just one set */ -#endif } else { @@ -2341,7 +1912,6 @@ ivas_error load_parambin_HRTF_from_binary( * Create the Crend HRTF data set from the binary file *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error load_Crend_HRTF_from_binary( IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend, /* i/o: HRTF CRend handle */ const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ @@ -2349,31 +1919,19 @@ ivas_error load_Crend_HRTF_from_binary( const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ const int32_t sampleRate /* i : sample rate */ ) -#else -ivas_error create_SetOfHRTF_from_binary( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF, /* i/o: HRTF CRend handle */ - const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ - const int32_t output_Fs /* i : Output sampling frequency */ -) -#endif { FILE *f_hrtf; int32_t hrtf_data_size_max; char *hrtf_data; ivas_hrtfs_header_t hrtf_header; -#ifndef FIX_1227_Crend_HRTF_LOADING_OPTIM - HRTFS_DATA **hHRTF; -#endif ivas_error header_check_result; ivas_hrtfs_file_header_t hrtfs_file_header; int16_t hrtf_id; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM bool load = false; BINAURAL_INPUT_AUDIO_CONFIG hrtf_set_binaural_cfg; /* convert audio config. to HRTF binaural config */ hrtf_set_binaural_cfg = audio_cfg_2_binaural_cfg( hrtf_set_audio_cfg ); -#endif if ( hrtfReader == NULL || hrtfReader->file == NULL ) { @@ -2404,14 +1962,10 @@ ivas_error create_SetOfHRTF_from_binary( /* Read & load */ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( hHrtfCrend == NULL ) { return IVAS_ERROR( IVAS_ERR_INTERNAL, "Crend HRTF binary handle not allocated!\n" ); } -#else - memset( hSetOfHRTF, 0x00, sizeof( HRTFS_CREND ) ); -#endif for ( hrtf_id = 0; hrtf_id < hrtfs_file_header.nb_hrtf; hrtf_id++ ) { @@ -2421,7 +1975,6 @@ ivas_error create_SetOfHRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "HRTF binary file not compliant (number of HRTF)" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM if ( ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV && /* HRIRs */ ( OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL || OutputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) || ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM && /* BRIRs */ @@ -2433,39 +1986,6 @@ ivas_error create_SetOfHRTF_from_binary( if ( load ) { -#else - hHRTF = NULL; - - if ( hrtf_header.frequency == output_Fs ) - { - if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV ) - { - if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_combined ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_hoa3 ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_hoa2 ); - } - else if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_hrir_foa ); - } - } - else if ( hrtf_header.rend_type == HRTF_READER_RENDERER_BINAURAL_MIXER_CONV_ROOM ) - { - if ( hrtf_header.input_cfg == BINAURAL_INPUT_AUDIO_CONFIG_COMBINED ) - { - hHRTF = &( ( *hSetOfHRTF ).hHRTF_brir_combined ); - } - } - } -#endif #ifdef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != sampleRate ) { @@ -2479,7 +1999,6 @@ ivas_error create_SetOfHRTF_from_binary( return IVAS_ERROR( IVAS_ERR_FAILED_FILE_READ, "Error in HRTF file reading" ); } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM #ifndef FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE if ( hrtf_header.frequency != output_Fs ) { @@ -2499,16 +2018,6 @@ ivas_error create_SetOfHRTF_from_binary( { fseek( f_hrtf, hrtf_header.data_size, SEEK_CUR ); } -#else - if ( hHRTF != NULL ) - { - if ( ( create_HRTF_from_rawdata( hHRTF, hrtf_data ) ) != IVAS_ERR_OK ) - { - free( hrtf_data ); - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Could not create HRTF from binary file" ); - } - } -#endif } free( hrtf_data ); @@ -2517,7 +2026,6 @@ ivas_error create_SetOfHRTF_from_binary( } -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * destroy_crend_hrtf() * @@ -2572,87 +2080,6 @@ void destroy_crend_hrtf( return; } -#else -/*---------------------------------------------------------------------* - * destroy_HRTF() - * - * Destroy the HRTF CRend handle - *---------------------------------------------------------------------*/ - -static void destroy_HRTF( - HRTFS_HANDLE *hHRTF /* i/o: HRTF CRend handle */ -) -{ - uint16_t i, j; - - if ( *hHRTF != NULL && hHRTF != NULL && ( *hHRTF )->init_from_rom == 0 ) - { - for ( i = 0; i < MAX_INTERN_CHANNELS; i++ ) - { - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHRTF )->pIndex_frequency_max[i][j] != NULL ) - { - free( ( *hHRTF )->pIndex_frequency_max_dyn[i][j] ); - } - if ( ( *hHRTF )->pOut_to_bin_re[i][j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_re_dyn[i][j] ); - } - if ( ( *hHRTF )->pOut_to_bin_im[i][j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_im_dyn[i][j] ); - } - } - } - for ( j = 0; j < BINAURAL_CHANNELS; j++ ) - { - if ( ( *hHRTF )->pIndex_frequency_max_diffuse[j] != NULL ) - { - free( ( *hHRTF )->pIndex_frequency_max_diffuse_dyn[j] ); - } - if ( ( *hHRTF )->pOut_to_bin_diffuse_re[j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_diffuse_re_dyn[j] ); - } - if ( ( *hHRTF )->pOut_to_bin_diffuse_im[j] != NULL ) - { - free( ( *hHRTF )->pOut_to_bin_diffuse_im_dyn[j] ); - } - } - - free( *hHRTF ); - *hHRTF = NULL; - } - - return; -} - - -/*---------------------------------------------------------------------* - * destroy_SetOfHRTF() - * - * Destroy the HRTF data set for Crend renderer - *---------------------------------------------------------------------*/ - -void destroy_SetOfHRTF( - HRTFS_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -) -{ - if ( ( hSetOfHRTF != NULL ) && ( *hSetOfHRTF != NULL ) ) - { - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_combined ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa3 ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_hoa2 ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_hrir_foa ) ); - destroy_HRTF( &( ( *hSetOfHRTF )->hHRTF_brir_combined ) ); - } - - ivas_HRTF_CRend_binary_close( hSetOfHRTF ); - - return; -} -#endif /*---------------------------------------------------------------------* diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index b27a42cf9f..4037c01885 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -51,7 +51,6 @@ typedef enum } HRTF_READER_RENDERER_TYPE; -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM typedef enum { BINAURAL_INPUT_AUDIO_CONFIG_INVALID, @@ -63,7 +62,6 @@ typedef enum } BINAURAL_INPUT_AUDIO_CONFIG; -#endif typedef struct ivas_hrtfs_header_t { int32_t rend_type; @@ -130,7 +128,6 @@ ivas_error load_reverb_binary( * Create the Crend HRTF data set from the binary file *---------------------------------------------------------------------*/ -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM ivas_error load_Crend_HRTF_from_binary( IVAS_DEC_HRTF_CREND_HANDLE hHrtfCrend, /* i/o: HRTF CRend handle */ const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ @@ -138,15 +135,7 @@ ivas_error load_Crend_HRTF_from_binary( const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ const int32_t sampleRate /* i : sample rate */ ); -#else -ivas_error create_SetOfHRTF_from_binary( - IVAS_DEC_HRTF_CREND_HANDLE hSetOfHRTF, /* i/o: Set of HRTF CRend handle */ - const hrtfFileReader *hrtfReader, /* i : pointer to hrtfFileReader handle */ - const int32_t output_Fs /* i : Output sampling frequency */ -); -#endif -#ifdef FIX_1227_Crend_HRTF_LOADING_OPTIM /*---------------------------------------------------------------------* * destroy_crend_hrtf() * @@ -156,17 +145,6 @@ ivas_error create_SetOfHRTF_from_binary( void destroy_crend_hrtf( IVAS_DEC_HRTF_CREND_HANDLE *hHrtfCrend /* i/o: Crend HRTF handle */ ); -#else -/*---------------------------------------------------------------------* - * destroy_SetOfHRTF() - * - * Destroy the HRTF data set. - *---------------------------------------------------------------------*/ - -void destroy_SetOfHRTF( - IVAS_DEC_HRTF_CREND_HANDLE *hSetOfHRTF /* i/o: Set of HRTF CRend handle */ -); -#endif /*---------------------------------------------------------------------* * load_fastconv_HRTF_from_binary() @@ -176,13 +154,8 @@ void destroy_SetOfHRTF( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ -#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ -#else - const int16_t room_reverb_flag, /* i : room reverb flag */ - IVAS_AUDIO_CONFIG intern_audio_config, /* i : internal audio configuration */ -#endif const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); -- GitLab From 59c7f1b2b652c6bba8e50d54e97197e24be05ed8 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 14 Dec 2024 00:40:45 +0100 Subject: [PATCH 19/40] [cleanup] accept FIX_1222_OMASA_DEC_CHANNEL_BUFFERS --- lib_com/options.h | 1 - lib_dec/ivas_masa_dec.c | 4 ---- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 ---- lib_rend/ivas_output_init.c | 4 ---- 4 files changed, 13 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7c10950b47..6c27bc293b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /*#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_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ #define FIX_1228_SAMPLING_RATE_MISMATCH_IN_HRTF_FILE /* VA: issue 1228: Exit the processing when a HRTF binary file with wrong sampling rate is provided */ diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index e0b12fd962..f0cb1b4563 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -1483,11 +1483,7 @@ ivas_error ivas_masa_dec_reconfigure( { if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS tc_nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - tc_nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } else { diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index dc61748545..cad8923ce2 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -321,11 +321,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( nchan_to_allocate = 2 * BINAURAL_CHANNELS; if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_to_allocate = BINAURAL_CHANNELS + st_ivas->nchan_ism; -#else - nchan_to_allocate = 2 * BINAURAL_CHANNELS + 2; -#endif } n_samples_granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS ); diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 46025d4829..939c13b93b 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -344,11 +344,7 @@ int16_t ivas_get_nchan_buffers_dec( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { -#ifdef FIX_1222_OMASA_DEC_CHANNEL_BUFFERS nchan_out_buff = max( nchan_out_buff, BINAURAL_CHANNELS + st_ivas->nchan_ism ); -#else - nchan_out_buff = max( nchan_out_buff, 2 * BINAURAL_CHANNELS + 2 ); -#endif } else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { -- GitLab From acc32b4a9f759a1796e909860ae882f72acbc27a Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 14 Dec 2024 00:41:38 +0100 Subject: [PATCH 20/40] [cleanup] accept NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION --- lib_com/options.h | 1 - lib_dec/ivas_objectRenderer_internal.c | 4 ---- lib_rend/ivas_objectRenderer.c | 19 ------------------- lib_rend/ivas_objectRenderer_sources.c | 9 --------- lib_rend/ivas_prot_rend.h | 10 ---------- 5 files changed, 43 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6c27bc293b..af25e7066c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,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_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 4dc1732dbe..9bc206e635 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -235,11 +235,7 @@ ivas_error ivas_td_binaural_renderer_sf( /* Render subframe */ /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) -#endif { return error; } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 0a44305f06..2a05512d0b 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -384,11 +384,7 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Render subframe */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK ) -#else - if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK ) -#endif { return error; } @@ -429,12 +425,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ -#endif ) { int16_t i; @@ -446,11 +437,6 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; -#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION - int16_t subframe_update_flag; - - subframe_update_flag = subframe_idx == ism_md_subframe_update; -#endif error = IVAS_ERR_OK; @@ -474,13 +460,8 @@ ivas_error TDREND_GetMix( /* Update rendering params if needed */ if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); -#else - TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, - Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_update_flag ); -#endif } /* Render source if needed */ diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 0307a058eb..c903841a60 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -305,13 +305,8 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_t *Src_p /* i/o: Source pointer */ ) -#else - TDREND_SRC_t *Src_p, /* i/o: Source pointer */ - const int16_t subframe_update_flag ) -#endif { TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; @@ -402,11 +397,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */ } -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION if ( ( *intp_count > 0 ) ) -#else - if ( ( *intp_count > 0 ) && subframe_update_flag ) -#endif { /* Set deltas for interpolation */ v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 282ec9bd6a..5c488c88c2 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -668,12 +668,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth/rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ -#else - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay metadata to sync with audio */ -#endif ); ivas_error TDREND_Update_listener_orientation( @@ -774,12 +769,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ -#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION TDREND_SRC_t *Src_p /* i/o: Source pointer */ -#else - TDREND_SRC_t *Src_p, - const int16_t subframe_update_flag /* i : Flag to determine update subframe idx */ -#endif ); ivas_error TDREND_SRC_Alloc( -- GitLab From c20e4f8e7bc7f917b4513bd5cd35a94031443857 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 14 Dec 2024 00:42:37 +0100 Subject: [PATCH 21/40] [cleanup] accept NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH --- lib_com/options.h | 1 - lib_dec/ivas_jbm_dec.c | 23 ----------------------- lib_dec/ivas_objectRenderer_internal.c | 4 ---- lib_dec/ivas_omasa_dec.c | 12 ------------ 4 files changed, 40 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index af25e7066c..c018eb7fa3 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,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_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 462ee2ad32..3fd629a685 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -1517,11 +1517,7 @@ ivas_error ivas_jbm_dec_flush_renderer( { if ( ism_mode_old == ISM_MASA_MODE_DISC ) { -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *tc_local[MAX_NUM_OBJECTS]; -#else - float *tc_local[MAX_TRANSPORT_CHANNELS]; -#endif for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ ) { @@ -1529,29 +1525,10 @@ ivas_error ivas_jbm_dec_flush_renderer( mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size ); } -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) { return error; } -#else - if ( st_ivas->nchan_ism > 0 ) - { - if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK ) - { - return error; - } - } - else - { - for ( ch_idx = 0; ch_idx < st_ivas->hDecoderConfig->nchan_out; ch_idx++ ) - { - set_zero( p_output[ch_idx], (int16_t) ( *nSamplesRendered ) ); - } - st_ivas->hTcBuffer->slots_rendered += 1; - st_ivas->hTcBuffer->subframes_rendered += 1; - } -#endif } } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 9bc206e635..9d19ab44f6 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -99,11 +99,7 @@ ivas_error ivas_td_binaural_renderer_sf( int16_t nchan_ism_internal, nchan_ism, ch_offset; /* Set the number of ISMs */ -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) -#else - if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) -#endif { nchan_ism_internal = st_ivas->nchan_ism; nchan_ism = st_ivas->nchan_ism; diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index c673172044..27ce47fbba 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -748,26 +748,14 @@ ivas_error ivas_omasa_dirac_td_binaural_jbm( ) { int16_t n; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float data_separated_objects[BINAURAL_CHANNELS][L_FRAME48k]; -#else - float data_separated_objects[MAX_NUM_OBJECTS][L_FRAME48k]; -#endif ivas_error error; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH float *p_sepobj[BINAURAL_CHANNELS]; -#else - float *p_sepobj[MAX_NUM_OBJECTS]; -#endif int16_t slot_idx_start; slot_idx_start = st_ivas->hSpatParamRendCom->slots_rendered; -#ifdef NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH for ( n = 0; n < BINAURAL_CHANNELS; n++ ) -#else - for ( n = 0; n < MAX_NUM_OBJECTS; n++ ) -#endif { p_sepobj[n] = &data_separated_objects[n][0]; } -- GitLab From 997961badae5d07bef5c120b9a8c207cfb491e16 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 14 Dec 2024 00:43:28 +0100 Subject: [PATCH 22/40] [cleanup] accept NONBE_1229_FIX_ISM1_DPID --- lib_com/options.h | 1 - lib_util/render_config_reader.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c018eb7fa3..16abf20da9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,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_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ #define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index 2e8b426ca6..14ec980eee 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -3034,11 +3034,7 @@ ivas_error RenderConfigReader_getDirectivity( } } /* case when -dpid is not specified, select first directivity pattern from config file */ -#ifdef NONBE_1229_FIX_ISM1_DPID if ( last_specified_id == 65535 ) -#else - if ( n == 0 ) -#endif { last_specified_id = (uint16_t) pRenderConfigReader->pDP[0].id; } -- GitLab From 46fc355e0305f8151aabfbc6eb0d638ad4d3a6b3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 14 Dec 2024 00:44:12 +0100 Subject: [PATCH 23/40] [cleanup] accept NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO --- lib_com/options.h | 1 - lib_enc/hq_classifier_enc.c | 45 ------------------------------------- 2 files changed, 46 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 16abf20da9..e31bf15805 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,7 +171,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_1233_HQ_CLASSIFIER_DIV_BY_ZERO /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/hq_classifier_enc.c b/lib_enc/hq_classifier_enc.c index b0ef15969b..d895cbc707 100644 --- a/lib_enc/hq_classifier_enc.c +++ b/lib_enc/hq_classifier_enc.c @@ -573,7 +573,6 @@ static int16_t hf_spectrum_sparseness( inv_rms = 0.0f; crest_mod = 0.0f; maximum( A, L_SPEC_HB, &Amax ); -#ifdef NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO if ( Amax == 0 ) { /* For all-zero input the crest is 1.0 */ @@ -626,50 +625,6 @@ static int16_t hf_spectrum_sparseness( crest = Amax * inv_rms; crest_mod = crest_mod * inv_rms; } -#else - thr = Amax * PEAK_THRESHOLD; - movmean = 0.0f; /* avoid uninitialized warning */ - p_num = &inv_tbl[HALF_WIN_LENGTH + 1]; /* Table for division 1./(11:21) */ - for ( i = 0; i < L_SPEC_HB; i++ ) - { - inv_rms += A[i] * A[i]; - if ( A[i] < thr ) - { - low_count += 1; - } - if ( i <= HALF_WIN_LENGTH ) - { - if ( i == 0 ) - { - movmean = sum_f( &A[0], i + HALF_WIN_LENGTH + 1 ) * ( *p_num ); - } - else - { - p_num++; - movmean = movmean + ( A[i + HALF_WIN_LENGTH] - movmean ) * ( *p_num ); - } - } - else - { - if ( L_SPEC_HB <= i + HALF_WIN_LENGTH ) - { - p_num--; - movmean = movmean + ( movmean - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num ); - } - else - { - movmean = movmean + ( A[i + HALF_WIN_LENGTH] - A[i - HALF_WIN_LENGTH - 1] ) * ( *p_num ); - } - } - if ( crest_mod < movmean ) - { - crest_mod = movmean; - } - } - inv_rms = 1.0f / (float) sqrtf( inv_rms / L_SPEC_HB ); - crest = Amax * inv_rms; - crest_mod = crest_mod * inv_rms; -#endif *crest_lp = HQ_CREST_FAC_SM * ( *crest_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest; *crest_mod_lp = HQ_CREST_FAC_SM * ( *crest_mod_lp ) + ( 1.0f - HQ_CREST_FAC_SM ) * crest_mod; -- GitLab From 17140ec407153e405dafd48cd7e8fd8ebe8f8db4 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 14 Dec 2024 00:53:30 +0100 Subject: [PATCH 24/40] formatting --- apps/decoder.c | 2 +- lib_dec/ivas_binRenderer_internal.c | 4 ++-- lib_dec/lib_dec.c | 4 ++-- lib_rend/ivas_objectRenderer.c | 2 +- lib_rend/ivas_objectRenderer_sources.c | 2 +- lib_util/hrtf_file_reader.c | 6 +++--- lib_util/hrtf_file_reader.h | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ed7f614df7..e0d4ab22c6 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -235,7 +235,7 @@ int main( reset_mem( USE_BYTES ); #endif - hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ + hHrtfBinary.hHrtfTD = NULL; /* just to avoid compilation warning */ hHrtfBinary.hHrtfStatistics = NULL; /* just to avoid compilation warning */ splitRendBits.bits_buf = splitRendBitsBuf; diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index d5eda9907d..0f195330a0 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -443,8 +443,8 @@ static ivas_error ivas_alloc_pppMem( *-------------------------------------------------------------------------*/ ivas_error ivas_allocate_binaural_hrtf( - HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ - const int16_t n_channels, /* i : number of input channels */ + HRTFS_FASTCONV *HrtfFastConv, /* i/o: FASTCONV HRTF structure */ + const int16_t n_channels, /* i : number of input channels */ const int16_t allocate_init_flag /* i : Memory allocation flag */ ) { diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index c364494200..0208a4d761 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -909,7 +909,7 @@ ivas_error IVAS_DEC_ReadFormat( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_BIN_RENDERER_TYPE *binaural_renderer, /* o : binaural renderer type */ IVAS_BIN_RENDERER_TYPE *binaural_renderer_sec, /* o : secondary binaural renderer type */ - IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ + IVAS_AUDIO_CONFIG *hrtf_set_audio_cfg /* o : HRTF set audio config. */ ) { ivas_error error; @@ -2677,7 +2677,7 @@ ivas_error IVAS_DEC_GetHrtfTDrendHandle( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_GetHrtfCRendHandle( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_DEC_HRTF_CREND_HANDLE **hHrtfCrend /* o : Crend HRTF handle */ ) { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 2a05512d0b..fcbdee32a3 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -425,7 +425,7 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ - const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ ) { int16_t i; diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index c903841a60..27f594ce9b 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -305,7 +305,7 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ - TDREND_SRC_t *Src_p /* i/o: Source pointer */ + TDREND_SRC_t *Src_p /* i/o: Source pointer */ ) { TDREND_MIX_Listener_t *Listener_p; diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index e29f829df4..6b0f36c49c 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -1702,9 +1702,9 @@ static ivas_error create_parambin_HRTF_from_rawdata( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ - const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ - const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ + const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ) { FILE *f_hrtf; diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index 4037c01885..5a86806380 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -154,9 +154,9 @@ void destroy_crend_hrtf( ivas_error load_fastconv_HRTF_from_binary( IVAS_DEC_HRTF_FASTCONV_HANDLE hHrtfFastConv, /* i/o: FastConv HRTF handle */ - const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ - const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ - const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ + const IVAS_AUDIO_CONFIG OutputConfig, /* i : output audio configuration */ + const IVAS_AUDIO_CONFIG hrtf_set_audio_cfg, /* i : HRTF set audio config. */ + const hrtfFileReader *hrtfReader /* i : pointer to hrtfFileReader handle */ ); /*---------------------------------------------------------------------* -- GitLab From 98e7e8ff828847b5b53264ecebf20acda2fd58bb Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 16 Dec 2024 14:45:44 +0100 Subject: [PATCH 25/40] self-test: add object editing testcases --- scripts/config/self_test.prm | 14 ++++++++++++++ scripts/config/self_test_ltv.prm | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index ca4ee1880f..d8c6b634d6 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1947,3 +1947,17 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // OSBA 3OA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out ../IVAS_cod -ism_sba 4 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stvOSBA_4ISM_3OA48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stvOSBA_4ISM_3OA48c.wav_BINAURAL_ROOM_REVERB_512000_48-48_custom_configuration.tst + + + +// 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing +../IVAS_cod -ism +3 testv/stvISM1.csv null testv/stvISM3.csv switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ism48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst + +// OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing +../IVAS_cod -ism_masa 2 2 testv/stvOMASA_2ISM_2MASA2TC48c_ISM1.csv null testv/stvOMASA_2ISM_2MASA2TC48c.met switchPaths/sw_24k4_256k.bin 48 testv/stvOMASA_2ISM_2MASA2TC48c.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/stvOMASA_2ISM_2MASA2TC48c.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst + +// OSBA FOA 3ISM bitrate switching 48kHz in, 48kHz out, BINAURAL out, object editing +../IVAS_cod -ism_sba 2 1 testv/stvISM1.csv null switchPaths/sw_24k4_256k.bin 48 testv/stvOSBA_2ISM_FOA48c.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/stvOSBA_2ISM_FOA48c.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 9b4df02363..e613f1a75c 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1946,3 +1946,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_cod -ism_sba 4 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 48 testv/ltv48_OSBA_4ISM_HOA3.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OSBA_4ISM_HOA3.wav_BINAURAL_ROOM_REVERB_512000_48-48_custom_configuration.tst + + +// 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing +../IVAS_cod -ism +3 testv/ltvISM1.csv null testv/stvISM3.csv switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ism48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst + +// OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing +../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv null testv/ltv48_OMASA_2ISM_2TC.met switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OMASA_2ISM_2TC.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_OMASA_2ISM_2TC.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst + +// OSBA FOA 3ISM bitrate switching 48kHz in, 48kHz out, BINAURAL out, object editing +../IVAS_cod -ism_sba 2 1 testv/ltvISM1.csv null switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OSBA_2ISM_FOA.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_OSBA_2ISM_FOA.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst -- GitLab From 03786e8c5b8151e06c90675884719d23e5505d20 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 16 Dec 2024 14:59:32 +0100 Subject: [PATCH 26/40] fix folder path --- scripts/config/self_test.prm | 6 +++--- scripts/config/self_test_ltv.prm | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index d8c6b634d6..d520d0e206 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1951,13 +1951,13 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism +3 testv/stvISM1.csv null testv/stvISM3.csv switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit +../IVAS_cod -ism +3 testv/stvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit ../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ism48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst // OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_masa 2 2 testv/stvOMASA_2ISM_2MASA2TC48c_ISM1.csv null testv/stvOMASA_2ISM_2MASA2TC48c.met switchPaths/sw_24k4_256k.bin 48 testv/stvOMASA_2ISM_2MASA2TC48c.wav bit +../IVAS_cod -ism_masa 2 2 testv/stvOMASA_2ISM_2MASA2TC48c_ISM1.csv null testv/stvOMASA_2ISM_2MASA2TC48c.met ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stvOMASA_2ISM_2MASA2TC48c.wav bit ../IVAS_dec -obj_edit BINAURAL 48 bit testv/stvOMASA_2ISM_2MASA2TC48c.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst // OSBA FOA 3ISM bitrate switching 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_sba 2 1 testv/stvISM1.csv null switchPaths/sw_24k4_256k.bin 48 testv/stvOSBA_2ISM_FOA48c.wav bit +../IVAS_cod -ism_sba 2 1 testv/stvISM1.csv null ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stvOSBA_2ISM_FOA48c.wav bit ../IVAS_dec -obj_edit BINAURAL 48 bit testv/stvOSBA_2ISM_FOA48c.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index e613f1a75c..8fb5cbae8d 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1949,13 +1949,13 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism +3 testv/ltvISM1.csv null testv/stvISM3.csv switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit +../IVAS_cod -ism +3 testv/ltvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit ../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ism48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst // OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv null testv/ltv48_OMASA_2ISM_2TC.met switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OMASA_2ISM_2TC.wav bit +../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv null testv/ltv48_OMASA_2ISM_2TC.met ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OMASA_2ISM_2TC.wav bit ../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_OMASA_2ISM_2TC.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst // OSBA FOA 3ISM bitrate switching 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_sba 2 1 testv/ltvISM1.csv null switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OSBA_2ISM_FOA.wav bit +../IVAS_cod -ism_sba 2 1 testv/ltvISM1.csv null ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OSBA_2ISM_FOA.wav bit ../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_OSBA_2ISM_FOA.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst -- GitLab From 3d37818ee467bef591221874876ba7571d9071d2 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 16 Dec 2024 15:19:55 +0100 Subject: [PATCH 27/40] fix testv name --- scripts/config/self_test.prm | 4 ++-- scripts/config/self_test_ltv.prm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index d520d0e206..543683bd54 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1951,8 +1951,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism +3 testv/stvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ism48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst +../IVAS_cod -ism +3 testv/stvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv3ISM48s.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ISM48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst // OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing ../IVAS_cod -ism_masa 2 2 testv/stvOMASA_2ISM_2MASA2TC48c_ISM1.csv null testv/stvOMASA_2ISM_2MASA2TC48c.met ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stvOMASA_2ISM_2MASA2TC48c.wav bit diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 8fb5cbae8d..75afb08cac 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1949,8 +1949,8 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism +3 testv/ltvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv3ism48s.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ism48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst +../IVAS_cod -ism +3 testv/ltvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_3ISM.wav bit +../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_3ISM.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst // OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing ../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv null testv/ltv48_OMASA_2ISM_2TC.met ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OMASA_2ISM_2TC.wav bit -- GitLab From d4794240f896ff6f04ab1db8134bb04562f06318 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 16 Dec 2024 16:51:28 +0100 Subject: [PATCH 28/40] issue 1217: do object editing only when objects metadata is available; under NONBE_1217_INIT_OBJ_EDIT --- lib_com/options.h | 1 + lib_dec/lib_dec.c | 237 ++++++++++++++++++++++++++-------------------- 2 files changed, 133 insertions(+), 105 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e31bf15805..f1519081cc 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,7 @@ /* 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_1217_INIT_OBJ_EDIT /* VA: issue 1217: do object editing only when objects metadata is available */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 0208a4d761..6de470f829 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1213,53 +1213,53 @@ ivas_error IVAS_DEC_GetEditableParameters( ) { int16_t dirac_read_idx, obj; + Decoder_Struct *st_ivas; + ISM_MODE ism_mode; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasEditableParameters == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - 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 ) ) ) - { - return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing is not supported in this operation mode." ); - } + st_ivas = hIvasDec->st_ivas; + ism_mode = st_ivas->ism_mode; - if ( hIvasEditableParameters == NULL || hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + 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 ) ) ) { - return IVAS_ERR_UNEXPECTED_NULL_POINTER; + return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing is not supported in this operation mode." ); } hIvasEditableParameters->gain_bed = 1.0f; - hIvasEditableParameters->num_obj = hIvasDec->st_ivas->nchan_ism; - if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT ) + hIvasEditableParameters->num_obj = st_ivas->nchan_ism; + if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { - if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) { for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) { - hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth; - hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hIsmMetaData[obj]->elevation; - hIvasEditableParameters->ism_metadata[obj].yaw = hIvasDec->st_ivas->hIsmMetaData[obj]->yaw; - hIvasEditableParameters->ism_metadata[obj].pitch = hIvasDec->st_ivas->hIsmMetaData[obj]->pitch; - hIvasEditableParameters->ism_metadata[obj].radius = hIvasDec->st_ivas->hIsmMetaData[obj]->radius; - hIvasEditableParameters->ism_metadata[obj].gain = hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain; - hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hIsmMetaData[obj]->azimuth; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hIsmMetaData[obj]->elevation; + hIvasEditableParameters->ism_metadata[obj].yaw = st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = st_ivas->hIsmMetaData[obj]->radius; + hIvasEditableParameters->ism_metadata[obj].gain = st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; } - if ( hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + if ( ism_mode == ISM_SBA_MODE_DISC ) { hIvasEditableParameters->gain_bed = 1.0f; } } - else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_PARAM ) + else if ( ism_mode == ISM_MODE_PARAM ) { for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) { - hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hParamIsmDec->azimuth_values[obj]; - hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hParamIsmDec->elevation_values[obj]; + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hParamIsmDec->azimuth_values[obj]; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hParamIsmDec->elevation_values[obj]; hIvasEditableParameters->ism_metadata[obj].yaw = 0.0f; hIvasEditableParameters->ism_metadata[obj].pitch = 0.0f; hIvasEditableParameters->ism_metadata[obj].radius = 0.0f; @@ -1267,7 +1267,7 @@ ivas_error IVAS_DEC_GetEditableParameters( hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = 0; } } - else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_NONE ) + else if ( ism_mode == ISM_MODE_NONE ) { hIvasEditableParameters->num_obj = 0; } @@ -1278,31 +1278,39 @@ ivas_error IVAS_DEC_GetEditableParameters( } #endif } - else if ( 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 ) ) +#ifdef NONBE_1217_INIT_OBJ_EDIT + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) +#else + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) +#endif { /* object editing possible only in two highest OMASA modes */ - if ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) { for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) { - hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth; - hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hIsmMetaData[obj]->elevation; - hIvasEditableParameters->ism_metadata[obj].yaw = hIvasDec->st_ivas->hIsmMetaData[obj]->yaw; - hIvasEditableParameters->ism_metadata[obj].pitch = hIvasDec->st_ivas->hIsmMetaData[obj]->pitch; - hIvasEditableParameters->ism_metadata[obj].radius = hIvasDec->st_ivas->hIsmMetaData[obj]->radius; + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hIsmMetaData[obj]->azimuth; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hIsmMetaData[obj]->elevation; + hIvasEditableParameters->ism_metadata[obj].yaw = st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = st_ivas->hIsmMetaData[obj]->radius; /* reset the otherwise unused "gain" field for the object */ hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = 1.0f; - hIvasEditableParameters->ism_metadata[obj].gain = hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain; - hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + hIvasEditableParameters->ism_metadata[obj].gain = st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; } } +#ifdef NONBE_1217_INIT_OBJ_EDIT + else if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) +#else else +#endif { /* Handle MONO output */ - if ( hIvasDec->st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) + if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) { - dirac_read_idx = hIvasDec->st_ivas->hSpatParamRendCom->render_to_md_map[hIvasDec->st_ivas->hSpatParamRendCom->subframes_rendered]; + dirac_read_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->subframes_rendered]; } else { @@ -1311,19 +1319,31 @@ ivas_error IVAS_DEC_GetEditableParameters( for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) { - hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; - hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; + hIvasEditableParameters->ism_metadata[obj].azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; + hIvasEditableParameters->ism_metadata[obj].elevation = st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; - hIvasEditableParameters->ism_metadata[obj].yaw = hIvasDec->st_ivas->hIsmMetaData[obj]->yaw; - hIvasEditableParameters->ism_metadata[obj].pitch = hIvasDec->st_ivas->hIsmMetaData[obj]->pitch; - hIvasEditableParameters->ism_metadata[obj].radius = hIvasDec->st_ivas->hIsmMetaData[obj]->radius; + hIvasEditableParameters->ism_metadata[obj].yaw = st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = st_ivas->hIsmMetaData[obj]->radius; /* reset the otherwise unused "gain" field for the object */ hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = 1.0f; - hIvasEditableParameters->ism_metadata[obj].gain = hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain; - hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + hIvasEditableParameters->ism_metadata[obj].gain = st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; } } +#ifdef NONBE_1217_INIT_OBJ_EDIT + else if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MODE_NONE ) + { + hIvasEditableParameters->num_obj = 0; + } +#ifdef DEBUGGING + else + { + assert( 0 && "This should never happen!" ); + } +#endif +#endif } return IVAS_ERR_OK; @@ -1342,16 +1362,21 @@ ivas_error IVAS_DEC_SetEditableParameters( ) { int16_t dirac_read_idx, obj; + Decoder_Struct *st_ivas; + ISM_MODE ism_mode; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - 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 ) ) ) + st_ivas = hIvasDec->st_ivas; + ism_mode = st_ivas->ism_mode; + + 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 ) ) ) { return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing no supported in this operation mode." ); } @@ -1362,85 +1387,87 @@ ivas_error IVAS_DEC_SetEditableParameters( } #ifdef DEBUGGING - assert( hIvasEditableParameters.num_obj == hIvasDec->st_ivas->nchan_ism ); + assert( hIvasEditableParameters.num_obj == st_ivas->nchan_ism ); #endif - if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT ) + if ( st_ivas->ivas_format == ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { - if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC ) { for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) { - hIvasDec->st_ivas->hIsmMetaData[obj]->edited_azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; - hIvasDec->st_ivas->hIsmMetaData[obj]->edited_elevation = hIvasEditableParameters.ism_metadata[obj].elevation; - hIvasDec->st_ivas->hIsmMetaData[obj]->edited_radius = hIvasEditableParameters.ism_metadata[obj].radius; + st_ivas->hIsmMetaData[obj]->edited_azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; + st_ivas->hIsmMetaData[obj]->edited_elevation = hIvasEditableParameters.ism_metadata[obj].elevation; + st_ivas->hIsmMetaData[obj]->edited_radius = hIvasEditableParameters.ism_metadata[obj].radius; - hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; + st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; - hIvasDec->st_ivas->hIsmMetaData[obj]->edited_yaw = hIvasEditableParameters.ism_metadata[obj].yaw; - hIvasDec->st_ivas->hIsmMetaData[obj]->edited_pitch = hIvasEditableParameters.ism_metadata[obj].pitch; + st_ivas->hIsmMetaData[obj]->edited_yaw = hIvasEditableParameters.ism_metadata[obj].yaw; + st_ivas->hIsmMetaData[obj]->edited_pitch = hIvasEditableParameters.ism_metadata[obj].pitch; - hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; + st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; } - if ( hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + if ( ism_mode == ISM_SBA_MODE_DISC ) { - hIvasDec->st_ivas->hSbaIsmData->gain_bed = hIvasEditableParameters.gain_bed; + st_ivas->hSbaIsmData->gain_bed = hIvasEditableParameters.gain_bed; } } - else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_PARAM ) + else if ( ism_mode == ISM_MODE_PARAM ) { for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) { - hIvasDec->st_ivas->hParamIsmDec->edited_azimuth_values[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth; - hIvasDec->st_ivas->hParamIsmDec->edited_elevation_values[obj] = hIvasEditableParameters.ism_metadata[obj].elevation; - hIvasDec->st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; + st_ivas->hParamIsmDec->edited_azimuth_values[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth; + st_ivas->hParamIsmDec->edited_elevation_values[obj] = hIvasEditableParameters.ism_metadata[obj].elevation; + st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; /* Detect direction editing in Param-ISM mode */ - if ( fabsf( hIvasDec->st_ivas->hParamIsmDec->azimuth_values[obj] - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || - fabsf( hIvasDec->st_ivas->hParamIsmDec->elevation_values[obj] - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) + if ( fabsf( st_ivas->hParamIsmDec->azimuth_values[obj] - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || + fabsf( st_ivas->hParamIsmDec->elevation_values[obj] - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) { - hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; } else { - hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; } /* Detect gain editing in Param-ISM mode */ if ( fabsf( 1.0f - hIvasEditableParameters.ism_metadata[obj].gain ) > OMASA_GAIN_EDIT_THR ) { - hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; } else { - hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; } } /* MASA is not present with the ISM format */ - hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; + st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; } - else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_NONE ) + else if ( ism_mode == ISM_MODE_NONE ) { if ( hIvasEditableParameters.num_obj != 0 ) { return IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED; } } +#ifdef DEBUGGING else { assert( 0 && "This should never happen!" ); } +#endif } - else if ( 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 ) ) + else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) { int16_t id_th; float threshold_azi, threshold_ele; for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) { - if ( hIvasDec->st_ivas->hMasaIsmData != NULL ) + if ( st_ivas->hMasaIsmData != NULL ) { /* copy relevant fields also to OMASA structs, but only if the value has been changed. original values are in st_ivas->hIsmMetaData */ /* first, need to convert float values to ints used internally */ @@ -1463,12 +1490,12 @@ ivas_error IVAS_DEC_SetEditableParameters( new_ele = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].elevation - 0.5f ); } - if ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { /* Handle MONO output */ - if ( hIvasDec->st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) + if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) { - dirac_read_idx = hIvasDec->st_ivas->hSpatParamRendCom->render_to_md_map[hIvasDec->st_ivas->hSpatParamRendCom->subframes_rendered]; + dirac_read_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->subframes_rendered]; } else { @@ -1480,74 +1507,74 @@ ivas_error IVAS_DEC_SetEditableParameters( * which in turn depends from the object priority and importance: * importance -> priority -> number of bits -> elevation resolution -> elevation ring index -> azimuth resolution. * leading to elevation_resolution -> elevation threshold and azimuth resolution -> azimuth threshold */ - id_th = (int16_t) ( fabsf( (float) hIvasDec->st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) / delta_theta_masa[hIvasDec->st_ivas->hMasaIsmData->bits_ism[obj] - 3] + 0.5f ); - threshold_azi = 360.0f / (float) no_phi_masa[hIvasDec->st_ivas->hMasaIsmData->bits_ism[obj] - 1][id_th]; - threshold_ele = delta_theta_masa[hIvasDec->st_ivas->hMasaIsmData->bits_ism[obj] - 3]; + id_th = (int16_t) ( fabsf( (float) st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) / delta_theta_masa[st_ivas->hMasaIsmData->bits_ism[obj] - 3] + 0.5f ); + threshold_azi = 360.0f / (float) no_phi_masa[st_ivas->hMasaIsmData->bits_ism[obj] - 1][id_th]; + threshold_ele = delta_theta_masa[st_ivas->hMasaIsmData->bits_ism[obj] - 3]; - if ( ( (float) abs( new_azi - hIvasDec->st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx] ) > threshold_azi ) || - ( (float) abs( new_ele - hIvasDec->st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) > threshold_ele ) ) + if ( ( (float) abs( new_azi - st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx] ) > threshold_azi ) || + ( (float) abs( new_ele - st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) > threshold_ele ) ) { /* at least one of the threshold is exceeded, so use new direction value and set editing detection flag */ - hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; - hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; + st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; + st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; - hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; } else { - hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; } } else { /* detect editing in ISM_MASA_MODE_DISC. optionally, add quantization-resolution -based thresholds */ - if ( fabsf( hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || - fabsf( hIvasDec->st_ivas->hIsmMetaData[obj]->elevation - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) + if ( fabsf( st_ivas->hIsmMetaData[obj]->azimuth - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || + fabsf( st_ivas->hIsmMetaData[obj]->elevation - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) { - hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; - hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; + st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; + st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; - hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; } else { - hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; } } /* compare pre-edit gain and the edited one to detect editing */ - if ( fabsf( hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain - hIvasEditableParameters.ism_metadata[obj].gain ) > OMASA_GAIN_EDIT_THR ) + if ( fabsf( st_ivas->hIsmMetaData[obj]->edited_gain - hIvasEditableParameters.ism_metadata[obj].gain ) > OMASA_GAIN_EDIT_THR ) { - hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; - hIvasDec->st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; + st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; } else { - hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; + st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; } } /* Copy edited values to hIsmMetaData struct */ - if ( hIvasDec->st_ivas->hIsmMetaData[obj] != NULL ) + if ( st_ivas->hIsmMetaData[obj] != NULL ) { - hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; - hIvasDec->st_ivas->hIsmMetaData[obj]->elevation = hIvasEditableParameters.ism_metadata[obj].elevation; - hIvasDec->st_ivas->hIsmMetaData[obj]->yaw = hIvasEditableParameters.ism_metadata[obj].yaw; - hIvasDec->st_ivas->hIsmMetaData[obj]->pitch = hIvasEditableParameters.ism_metadata[obj].pitch; - hIvasDec->st_ivas->hIsmMetaData[obj]->radius = hIvasEditableParameters.ism_metadata[obj].radius; - hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; - hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; + st_ivas->hIsmMetaData[obj]->azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; + st_ivas->hIsmMetaData[obj]->elevation = hIvasEditableParameters.ism_metadata[obj].elevation; + st_ivas->hIsmMetaData[obj]->yaw = hIvasEditableParameters.ism_metadata[obj].yaw; + st_ivas->hIsmMetaData[obj]->pitch = hIvasEditableParameters.ism_metadata[obj].pitch; + st_ivas->hIsmMetaData[obj]->radius = hIvasEditableParameters.ism_metadata[obj].radius; + st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; + st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; } } if ( fabsf( hIvasEditableParameters.gain_bed - 1.0f ) > OMASA_GAIN_EDIT_THR ) { - hIvasDec->st_ivas->hMasaIsmData->gain_masa_edited = hIvasEditableParameters.gain_bed; - hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 1u; + st_ivas->hMasaIsmData->gain_masa_edited = hIvasEditableParameters.gain_bed; + st_ivas->hMasaIsmData->masa_gain_is_edited = 1u; } else { - hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; + st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; } } -- GitLab From c99270b6cd55b11b9bcafafab1e0d3d43de919eb Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Dec 2024 11:50:51 +0100 Subject: [PATCH 29/40] update within FIX_1225_DISCLAIMER --- lib_rend/lib_rend.c | 4 ++-- lib_rend/lib_rend.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d0d8c12116..5e691a7782 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7501,7 +7501,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, @@ -8756,7 +8756,7 @@ static ivas_error printConfigInfo_rend( *---------------------------------------------------------------------*/ void IVAS_REND_PrintInputConfig( - const AUDIO_CONFIG inputConfig /* i : input audio configuration */ + const IVAS_AUDIO_CONFIG inputConfig /* i : input audio configuration */ ) { char config_str[50]; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 2e8f2f444c..ee4aa681d4 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -35,7 +35,10 @@ #include "common_api_types.h" #include +#ifndef FIX_1225_DISCLAIMER #include "ivas_stat_rend.h" +#endif + /*---------------------------------------------------------------------* * Renderer constants @@ -425,7 +428,7 @@ int32_t IVAS_REND_GetCntFramesLimited( /* Disclaimer and info printing */ void IVAS_REND_PrintInputConfig( - const AUDIO_CONFIG inputConfig /* i : input audio configuration */ + const IVAS_AUDIO_CONFIG inputConfig /* i : input audio configuration */ ); ivas_error IVAS_REND_PrintConfig( -- GitLab From ac9c4a37e2937ab692bdd7d5a890d78b958efd23 Mon Sep 17 00:00:00 2001 From: vaclav Date: Tue, 17 Dec 2024 12:02:59 +0100 Subject: [PATCH 30/40] clang-format --- lib_rend/lib_rend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5e691a7782..7c9b9c0037 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -7501,7 +7501,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, -- GitLab From ed1da5d4a22b49f6a1b67920795b36f8540e9923 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 17 Dec 2024 17:20:44 +0100 Subject: [PATCH 31/40] Add fix NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX for issue 1246 --- lib_com/options.h | 1 + lib_enc/ivas_stereo_cng_enc.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index b26b2d81c5..cde0991748 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,6 +172,7 @@ #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_1240_FIX_CORE_SELECTION_ISM_SW /* VA: issue 1240: Remove the forcing of the TCX core in ISM when switching from a high bitarte to a low one */ +#define NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX /* Ericsson: Issue 1246: High level input which triggers DTX can lead to numerical overflow in coherence calculation */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_cng_enc.c b/lib_enc/ivas_stereo_cng_enc.c index ac938f02ed..49430f2d1f 100644 --- a/lib_enc/ivas_stereo_cng_enc.c +++ b/lib_enc/ivas_stereo_cng_enc.c @@ -95,7 +95,11 @@ void stereo_dft_enc_sid_calc_coh( for ( k = hStereoDft->band_limits[b]; k < hStereoDft->band_limits[b + 1]; k++ ) { coh_weight = hStereoDft->DFT[0][2 * k] * hStereoDft->DFT[0][2 * k] + hStereoDft->DFT[0][2 * k + 1] * hStereoDft->DFT[0][2 * k + 1]; +#ifdef NONBE_1246_INF_COHERENCE_IN_HIGH_LEVEL_DTX + cohBand[b] += coh_weight * ( ( hStereoDft->xspec_smooth[2 * k] * hStereoDft->xspec_smooth[2 * k] + hStereoDft->xspec_smooth[2 * k + 1] * hStereoDft->xspec_smooth[2 * k + 1] ) / ( hStereoDft->Spd_L_smooth[k] * hStereoDft->Spd_R_smooth[k] + EPSILON ) ); +#else cohBand[b] += coh_weight * ( hStereoDft->xspec_smooth[2 * k] * hStereoDft->xspec_smooth[2 * k] + hStereoDft->xspec_smooth[2 * k + 1] * hStereoDft->xspec_smooth[2 * k + 1] ) / ( hStereoDft->Spd_L_smooth[k] * hStereoDft->Spd_R_smooth[k] + EPSILON ); +#endif coh_weight_sum += coh_weight; } if ( coh_weight_sum > 0 ) -- GitLab From 4a0791ba5f65ef485f7f158d8b0325292adda759 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Dec 2024 08:21:14 +0100 Subject: [PATCH 32/40] wrap all changes within NONBE_1217_INIT_OBJ_EDIT --- lib_dec/lib_dec.c | 321 +++++++++++++++++++++++++++++++ scripts/config/self_test.prm | 14 -- scripts/config/self_test_ltv.prm | 13 -- 3 files changed, 321 insertions(+), 27 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 6de470f829..bef93cf29f 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1213,14 +1213,17 @@ ivas_error IVAS_DEC_GetEditableParameters( ) { int16_t dirac_read_idx, obj; +#ifdef NONBE_1217_INIT_OBJ_EDIT Decoder_Struct *st_ivas; ISM_MODE ism_mode; +#endif if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasEditableParameters == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } +#ifdef NONBE_1217_INIT_OBJ_EDIT st_ivas = hIvasDec->st_ivas; ism_mode = st_ivas->ism_mode; @@ -1345,6 +1348,114 @@ ivas_error IVAS_DEC_GetEditableParameters( #endif #endif } +#else + 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 ) ) ) + { + return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing is not supported in this operation mode." ); + } + + if ( hIvasEditableParameters == NULL || hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + hIvasEditableParameters->gain_bed = 1.0f; + hIvasEditableParameters->num_obj = hIvasDec->st_ivas->nchan_ism; + if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT ) + { + if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + { + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth; + hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hIsmMetaData[obj]->elevation; + hIvasEditableParameters->ism_metadata[obj].yaw = hIvasDec->st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = hIvasDec->st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = hIvasDec->st_ivas->hIsmMetaData[obj]->radius; + hIvasEditableParameters->ism_metadata[obj].gain = hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + } + + if ( hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + { + hIvasEditableParameters->gain_bed = 1.0f; + } + } + else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_PARAM ) + { + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hParamIsmDec->azimuth_values[obj]; + hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hParamIsmDec->elevation_values[obj]; + hIvasEditableParameters->ism_metadata[obj].yaw = 0.0f; + hIvasEditableParameters->ism_metadata[obj].pitch = 0.0f; + hIvasEditableParameters->ism_metadata[obj].radius = 0.0f; + hIvasEditableParameters->ism_metadata[obj].gain = 1.0f; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = 0; + } + } + else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_NONE ) + { + hIvasEditableParameters->num_obj = 0; + } +#ifdef DEBUGGING + else + { + assert( 0 && "This should never happen!" ); + } +#endif + } + else if ( 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 ) ) + { + /* object editing possible only in two highest OMASA modes */ + if ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) + { + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth; + hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hIsmMetaData[obj]->elevation; + hIvasEditableParameters->ism_metadata[obj].yaw = hIvasDec->st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = hIvasDec->st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = hIvasDec->st_ivas->hIsmMetaData[obj]->radius; + + /* reset the otherwise unused "gain" field for the object */ + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = 1.0f; + hIvasEditableParameters->ism_metadata[obj].gain = hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + } + } + else + { + /* Handle MONO output */ + if ( hIvasDec->st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) + { + dirac_read_idx = hIvasDec->st_ivas->hSpatParamRendCom->render_to_md_map[hIvasDec->st_ivas->hSpatParamRendCom->subframes_rendered]; + } + else + { + dirac_read_idx = 0; + } + + for ( obj = 0; obj < hIvasEditableParameters->num_obj; obj++ ) + { + hIvasEditableParameters->ism_metadata[obj].azimuth = hIvasDec->st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx]; + hIvasEditableParameters->ism_metadata[obj].elevation = hIvasDec->st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx]; + + hIvasEditableParameters->ism_metadata[obj].yaw = hIvasDec->st_ivas->hIsmMetaData[obj]->yaw; + hIvasEditableParameters->ism_metadata[obj].pitch = hIvasDec->st_ivas->hIsmMetaData[obj]->pitch; + hIvasEditableParameters->ism_metadata[obj].radius = hIvasDec->st_ivas->hIsmMetaData[obj]->radius; + + /* reset the otherwise unused "gain" field for the object */ + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = 1.0f; + hIvasEditableParameters->ism_metadata[obj].gain = hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain; + hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag; + } + } + } +#endif return IVAS_ERR_OK; } @@ -1362,6 +1473,7 @@ ivas_error IVAS_DEC_SetEditableParameters( ) { int16_t dirac_read_idx, obj; +#ifdef NONBE_1217_INIT_OBJ_EDIT Decoder_Struct *st_ivas; ISM_MODE ism_mode; @@ -1577,6 +1689,215 @@ ivas_error IVAS_DEC_SetEditableParameters( st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; } } +#else + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + 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 ) ) ) + { + return IVAS_ERROR( IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED, "Object editing no supported in this operation mode." ); + } + + if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + +#ifdef DEBUGGING + assert( hIvasEditableParameters.num_obj == hIvasDec->st_ivas->nchan_ism ); +#endif + + if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT ) + { + if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_DISC || hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + { + for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) + { + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_elevation = hIvasEditableParameters.ism_metadata[obj].elevation; + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_radius = hIvasEditableParameters.ism_metadata[obj].radius; + + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; + + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_yaw = hIvasEditableParameters.ism_metadata[obj].yaw; + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_pitch = hIvasEditableParameters.ism_metadata[obj].pitch; + + hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; + } + + if ( hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + { + hIvasDec->st_ivas->hSbaIsmData->gain_bed = hIvasEditableParameters.gain_bed; + } + } + else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_PARAM ) + { + for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) + { + hIvasDec->st_ivas->hParamIsmDec->edited_azimuth_values[obj] = hIvasEditableParameters.ism_metadata[obj].azimuth; + hIvasDec->st_ivas->hParamIsmDec->edited_elevation_values[obj] = hIvasEditableParameters.ism_metadata[obj].elevation; + hIvasDec->st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; + + /* Detect direction editing in Param-ISM mode */ + if ( fabsf( hIvasDec->st_ivas->hParamIsmDec->azimuth_values[obj] - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || + fabsf( hIvasDec->st_ivas->hParamIsmDec->elevation_values[obj] - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) + { + hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + } + else + { + hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + } + + /* Detect gain editing in Param-ISM mode */ + if ( fabsf( 1.0f - hIvasEditableParameters.ism_metadata[obj].gain ) > OMASA_GAIN_EDIT_THR ) + { + hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; + } + else + { + hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; + } + } + + /* MASA is not present with the ISM format */ + hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; + } + else if ( hIvasDec->st_ivas->ism_mode == ISM_MODE_NONE ) + { + if ( hIvasEditableParameters.num_obj != 0 ) + { + return IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED; + } + } + else + { + assert( 0 && "This should never happen!" ); + } + } + else if ( 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 ) ) + { + int16_t id_th; + float threshold_azi, threshold_ele; + + for ( obj = 0; obj < hIvasEditableParameters.num_obj; obj++ ) + { + if ( hIvasDec->st_ivas->hMasaIsmData != NULL ) + { + /* copy relevant fields also to OMASA structs, but only if the value has been changed. original values are in st_ivas->hIsmMetaData */ + /* first, need to convert float values to ints used internally */ + int16_t new_azi, new_ele; + if ( hIvasEditableParameters.ism_metadata[obj].azimuth > 0.0f ) + { + new_azi = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].azimuth + 0.5f ); + } + else + { + new_azi = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].azimuth - 0.5f ); + } + + if ( hIvasEditableParameters.ism_metadata[obj].elevation > 0.0f ) + { + new_ele = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].elevation + 0.5f ); + } + else + { + new_ele = (int16_t) ( hIvasEditableParameters.ism_metadata[obj].elevation - 0.5f ); + } + + if ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) + { + /* Handle MONO output */ + if ( hIvasDec->st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) + { + dirac_read_idx = hIvasDec->st_ivas->hSpatParamRendCom->render_to_md_map[hIvasDec->st_ivas->hSpatParamRendCom->subframes_rendered]; + } + else + { + dirac_read_idx = 0; + } + + /* determine thresholds for detecting object metadata edit for direction based on quantization resolution of the spatial direction parameters. + * these depend from the number of bits used to transmit the directions, + * which in turn depends from the object priority and importance: + * importance -> priority -> number of bits -> elevation resolution -> elevation ring index -> azimuth resolution. + * leading to elevation_resolution -> elevation threshold and azimuth resolution -> azimuth threshold */ + id_th = (int16_t) ( fabsf( (float) hIvasDec->st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) / delta_theta_masa[hIvasDec->st_ivas->hMasaIsmData->bits_ism[obj] - 3] + 0.5f ); + threshold_azi = 360.0f / (float) no_phi_masa[hIvasDec->st_ivas->hMasaIsmData->bits_ism[obj] - 1][id_th]; + threshold_ele = delta_theta_masa[hIvasDec->st_ivas->hMasaIsmData->bits_ism[obj] - 3]; + + if ( ( (float) abs( new_azi - hIvasDec->st_ivas->hMasaIsmData->azimuth_ism[obj][dirac_read_idx] ) > threshold_azi ) || + ( (float) abs( new_ele - hIvasDec->st_ivas->hMasaIsmData->elevation_ism[obj][dirac_read_idx] ) > threshold_ele ) ) + { + /* at least one of the threshold is exceeded, so use new direction value and set editing detection flag */ + hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; + hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; + + hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + } + else + { + hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + } + } + else + { + /* detect editing in ISM_MASA_MODE_DISC. optionally, add quantization-resolution -based thresholds */ + if ( fabsf( hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth - hIvasEditableParameters.ism_metadata[obj].azimuth ) > OMASA_AZI_EDIT_THR || + fabsf( hIvasDec->st_ivas->hIsmMetaData[obj]->elevation - hIvasEditableParameters.ism_metadata[obj].elevation ) > OMASA_ELE_EDIT_THR ) + { + hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[obj] = new_azi; + hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[obj] = new_ele; + + hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 1u; + } + else + { + hIvasDec->st_ivas->hMasaIsmData->ism_dir_is_edited[obj] = 0u; + } + } + + /* compare pre-edit gain and the edited one to detect editing */ + if ( fabsf( hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain - hIvasEditableParameters.ism_metadata[obj].gain ) > OMASA_GAIN_EDIT_THR ) + { + hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 1u; + hIvasDec->st_ivas->hMasaIsmData->gain_ism_edited[obj] = hIvasEditableParameters.ism_metadata[obj].gain; + } + else + { + hIvasDec->st_ivas->hMasaIsmData->ism_gain_is_edited[obj] = 0u; + } + } + + /* Copy edited values to hIsmMetaData struct */ + if ( hIvasDec->st_ivas->hIsmMetaData[obj] != NULL ) + { + hIvasDec->st_ivas->hIsmMetaData[obj]->azimuth = hIvasEditableParameters.ism_metadata[obj].azimuth; + hIvasDec->st_ivas->hIsmMetaData[obj]->elevation = hIvasEditableParameters.ism_metadata[obj].elevation; + hIvasDec->st_ivas->hIsmMetaData[obj]->yaw = hIvasEditableParameters.ism_metadata[obj].yaw; + hIvasDec->st_ivas->hIsmMetaData[obj]->pitch = hIvasEditableParameters.ism_metadata[obj].pitch; + hIvasDec->st_ivas->hIsmMetaData[obj]->radius = hIvasEditableParameters.ism_metadata[obj].radius; + hIvasDec->st_ivas->hIsmMetaData[obj]->edited_gain = hIvasEditableParameters.ism_metadata[obj].gain; + hIvasDec->st_ivas->hIsmMetaData[obj]->non_diegetic_flag = hIvasEditableParameters.ism_metadata[obj].non_diegetic_flag; + } + } + + if ( fabsf( hIvasEditableParameters.gain_bed - 1.0f ) > OMASA_GAIN_EDIT_THR ) + { + hIvasDec->st_ivas->hMasaIsmData->gain_masa_edited = hIvasEditableParameters.gain_bed; + hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 1u; + } + else + { + hIvasDec->st_ivas->hMasaIsmData->masa_gain_is_edited = 0u; + } + } +#endif return IVAS_ERR_OK; } diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 543683bd54..ca4ee1880f 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1947,17 +1947,3 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g // OSBA 3OA 4ISM at 512 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out ../IVAS_cod -ism_sba 4 3 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 512000 48 testv/stvOSBA_4ISM_3OA48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stvOSBA_4ISM_3OA48c.wav_BINAURAL_ROOM_REVERB_512000_48-48_custom_configuration.tst - - - -// 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism +3 testv/stvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stv3ISM48s.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/stv3ISM48s.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst - -// OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_masa 2 2 testv/stvOMASA_2ISM_2MASA2TC48c_ISM1.csv null testv/stvOMASA_2ISM_2MASA2TC48c.met ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stvOMASA_2ISM_2MASA2TC48c.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/stvOMASA_2ISM_2MASA2TC48c.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst - -// OSBA FOA 3ISM bitrate switching 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_sba 2 1 testv/stvISM1.csv null ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/stvOSBA_2ISM_FOA48c.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/stvOSBA_2ISM_FOA48c.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 75afb08cac..9b4df02363 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1946,16 +1946,3 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_10pct.g ../IVAS_cod -ism_sba 4 3 testv/ltvISM1.csv testv/ltvISM2.csv testv/ltvISM3.csv testv/ltvISM4.csv 512000 48 testv/ltv48_OSBA_4ISM_HOA3.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OSBA_4ISM_HOA3.wav_BINAURAL_ROOM_REVERB_512000_48-48_custom_configuration.tst - - -// 3 ISM with extended metadata bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism +3 testv/ltvISM1.csv null testv/stvISM3.csv ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_3ISM.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_3ISM.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst - -// OMASA 2Dir2TC 2ISM bitrate switching, 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_masa 2 2 testv/ltv48_OMASA_2ISM_2TC_ISM1.csv null testv/ltv48_OMASA_2ISM_2TC.met ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OMASA_2ISM_2TC.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_OMASA_2ISM_2TC.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst - -// OSBA FOA 3ISM bitrate switching 48kHz in, 48kHz out, BINAURAL out, object editing -../IVAS_cod -ism_sba 2 1 testv/ltvISM1.csv null ../scripts/switchPaths/sw_24k4_256k.bin 48 testv/ltv48_OSBA_2ISM_FOA.wav bit -../IVAS_dec -obj_edit BINAURAL 48 bit testv/ltv48_OSBA_2ISM_FOA.wav_brate_sw_48-48_BINAURAL_ObjEdit.tst -- GitLab From 80c9f52c4f3b0077ee9b6f9274e2197fc6a7db40 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Dec 2024 11:57:39 +0100 Subject: [PATCH 33/40] remove the exact same condition as per the review --- lib_enc/dtx.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 452f1cf5cc..676fb47647 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -193,15 +193,9 @@ void dtx( #endif if ( st->dtx_sce_sba == 0 ) { -#ifdef NONBE_1211_DTX_BR_SWITCHING - br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) || - ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || - st->lp_noise < 15; -#else br_dtx_flag = ( st->element_mode == EVS_MONO && st->total_brate <= MAX_BRATE_DTX_EVS ) || ( st->element_mode != EVS_MONO && ivas_total_brate <= MAX_BRATE_DTX_IVAS ) || st->lp_noise < 15; -#endif } if ( st->Opt_DTX_ON && vad == 0 && -- GitLab From bf5f83776327b82aa6375af8d9ad0807f48e4104 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Dec 2024 12:09:27 +0100 Subject: [PATCH 34/40] remove nested switches --- lib_dec/lib_dec.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index ae2b747071..a9abea3115 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -1283,11 +1283,7 @@ ivas_error IVAS_DEC_GetEditableParameters( } #endif } -#ifdef NONBE_1217_INIT_OBJ_EDIT else if ( st_ivas->ivas_format == MASA_ISM_FORMAT || ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_ism > 0 ) ) -#else - else if ( st_ivas->ivas_format == MASA_ISM_FORMAT && ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || ism_mode == ISM_MASA_MODE_DISC ) ) -#endif { /* object editing possible only in two highest OMASA modes */ if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -1306,11 +1302,7 @@ ivas_error IVAS_DEC_GetEditableParameters( hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; } } -#ifdef NONBE_1217_INIT_OBJ_EDIT else if ( ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) -#else - else -#endif { /* Handle MONO output */ if ( st_ivas->renderer_type != RENDERER_MONO_DOWNMIX ) @@ -1337,7 +1329,6 @@ ivas_error IVAS_DEC_GetEditableParameters( hIvasEditableParameters->ism_metadata[obj].non_diegetic_flag = st_ivas->hIsmMetaData[obj]->non_diegetic_flag; } } -#ifdef NONBE_1217_INIT_OBJ_EDIT else if ( ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || ism_mode == ISM_MODE_NONE ) { hIvasEditableParameters->num_obj = 0; @@ -1347,7 +1338,6 @@ ivas_error IVAS_DEC_GetEditableParameters( { assert( 0 && "This should never happen!" ); } -#endif #endif } #else -- GitLab From 24b928fc1780fed5c0faa3cb3a647ac59b92aaa1 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 18 Dec 2024 12:45:45 +0100 Subject: [PATCH 35/40] removal of duplicated conditions + small reshuffling --- scripts/config/self_test.prm | 40 +++++++++-------------- scripts/config/self_test_ltv.prm | 55 ++++++++++++++++---------------- 2 files changed, 42 insertions(+), 53 deletions(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 3326aba7b5..d901810c95 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1089,15 +1089,7 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 // MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/stv2MASA2TC48c.met 384000 48 testv/stv2MASA2TC48c.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom_Subframe.tst - - - - - - - - +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/stv2MASA2TC48c.wav_384000_48-48_BinauralRoom.tst // MASA 2dir 2TC at 512 kbps, 48kHz in, 48kHz out, 5_1 out ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met 512000 48 testv/stv2MASA2TC48c.wav bit @@ -1572,6 +1564,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 +// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod 64000 48 testv/stv48c.wav bit +../IVAS_dec -non_diegetic_pan -50 48 bit testv/stv48c.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst + +// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod -ism 1 testv/stvISM1.csv 32000 48 testv/stv1ISM48s.wav bit +../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst + + + // stereo at 48 kbps, 16 kHz in, 16 kHz out, DTX on, JBM Prof 5 ../IVAS_cod -stereo -dtx 48000 16 testv/stvST16n.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 @@ -1627,15 +1629,15 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP MONO 32 netsimoutput testv/stv1MASA2TC48n.wav_sw_48-32_MONO_JBM5.tst -// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL out, JBM Prof 5 +// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, EXT out, JBM Prof 5 ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stv2MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 -../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 16 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-16_BINAURAL_JBM5.tst +../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-48_EXT_JBM5.tst -// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, EXT out, JBM Prof 5 +// MASA 2dir 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL out, JBM Prof 5 ../IVAS_cod -masa 2 testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/stv2MASA2TC48c.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 -../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-48_EXT_JBM5.tst +../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 16 netsimoutput testv/stv2MASA2TC48c.wav_sw_48-16_BINAURAL_JBM5.tst // OMASA 2Dir2TC 1ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 ../IVAS_cod -ism_masa 1 2 testv/stvISM1.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_1ism.bin 48 testv/stvOMASA_1ISM_2MASA2TC48c.wav bit @@ -1677,8 +1679,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_256000_48-48_JBM5.tst - - // OMASA 1Dir1TC 4ISM 48 kbps 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out custom configuration ../IVAS_cod -ism_masa 4 1 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv1MASA1TC48c.met 48000 48 testv/stvOMASA_4ISM_1MASA1TC48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_1MASA1TC48c.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst @@ -1687,15 +1687,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met 48000 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst -// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod 64000 48 testv/stv48c.wav bit -../IVAS_dec -non_diegetic_pan -50 48 bit testv/stv48c.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst - -// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod -ism 1 testv/stvISM1.csv 32000 48 testv/stv1ISM48s.wav bit -../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst - - // OMASA 2Dir2TC 1ISM at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_masa 1 2 NULL testv/stv2MASA2TC48c.met 13200 48 testv/stvOMASA_1ISM_2MASA2TC48c.wav bit ../IVAS_dec BINAURAL 48 bit testv/stvOMASA_1ISM_2MASA2TC48c.wav_BINAURAL_13200_48-48.tst @@ -1788,7 +1779,6 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -ism_masa 4 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv testv/stv2MASA2TC48c.met 384000 48 testv/stvOMASA_4ISM_2MASA2TC48c.wav bit ../IVAS_dec EXT 48 bit testv/stvOMASA_4ISM_2MASA2TC48c.wav_EXT_384000_48-48.tst - // OMASA 2Dir2TC 3ISM at br sw techs 13.2 to 512 kbps start 160 kbps, 48kHz in, 48kHz out, MONO out ../IVAS_cod -ism_masa 3 2 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stv2MASA2TC48c.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_160k_omasatechs_3ism.bin 48 testv/stvOMASA_3ISM_2MASA2TC48c.wav bit ../IVAS_dec MONO 48 bit testv/stvOMASA_3ISM_2MASA2TC48c.wav_MONO_sw_48-48.tst diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 6fc8eb821e..1f073f71ce 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1083,17 +1083,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec 5_1_4 48 bit_error testv/ltv48_MASA2TC.wav_192000_48-48_5_1_4_FER5.tst -// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out -../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom.tst - -// MASA 2dir 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching -../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom_Subframe.tst - // MASA 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM out ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit -../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom_Subframe.tst +../IVAS_dec BINAURAL_ROOM_IR 48 bit testv/ltv48_MASA2TC.wav_384000_48-48_BinauralRoom.tst // MASA 2TC at 384 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM IR out, bandwidth switching ../IVAS_cod -max_band testv/ivas_bws_20fr_start_WB.txt -masa 2 testv/ltv48_MASA2TC.met 384000 48 testv/ltv48_MASA2TC.wav bit @@ -1203,13 +1195,9 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA2TC.wav bit ../IVAS_dec 7_1 48 bit testv/ltv48_MASA2TC.wav_sw_48-48_7_1.tst -// MASA 1TC at 256kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out default configuration -../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit -../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48.tst - -// MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out custom configuration -../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit -../IVAS_dec -render_config testv/rend_config_combined.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48_custom_config.tst +// MASA 1TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, 7_1 out +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA1TC.wav bit +../IVAS_dec 7_1 48 bit testv/ltv48_MASA1TC.wav_sw_48-48_7_1.tst // MASA 2TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -masa 2 testv/ltv48_MASA2TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA2TC.wav bit @@ -1220,6 +1208,14 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error ../IVAS_dec BINAURAL 48 bit_error testv/ltv48_MASA2TC.wav_sw_48-48_DTX_BINAURAL_FER5.tst +// MASA 1TC at 256kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out default configuration +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit +../IVAS_dec BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48.tst + +// MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out custom configuration +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit +../IVAS_dec -render_config testv/rend_config_combined.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_MASA1TC.wav_BINAURAL_ROOM_REVERB_256000_48-48_custom_config.tst + // MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out default configuration, random FER at 5% ../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met 256000 48 testv/ltv48_MASA1TC.wav bit eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g192 bit_error @@ -1568,6 +1564,16 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 +// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod 64000 48 testv/ltv48_MONO.wav bit +../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst + +// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out +../IVAS_cod -ism 1 testv/ltvISM1.csv 32000 48 testv/ltv48_1ISM.wav bit +../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst + + + // stereo at 48 kbps, 16 kHz in, 16 kHz out, DTX on, JBM Prof 5 ../IVAS_cod -stereo -dtx 48000 16 testv/ltv16_STEREO.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 @@ -1628,6 +1634,11 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/ltv48_MASA2TC.wav_sw_48-48_EXT_JBM5.tst +// MASA 1TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL out, JBM Prof 5 +../IVAS_cod -masa 2 testv/ltv48_MASA1TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA1TC.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 16 netsimoutput testv/ltv48_MASA1TC.wav_sw_48-16_BINAURAL_JBM5.tst + // OMASA 2Dir2TC 1ISM at br sw techs 13.2 to 512 kbps start 24.4 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_IR out, JBM Prof 5 ../IVAS_cod -ism_masa 1 2 testv/ltv48_OMASA_1ISM_2TC_ISM1.csv testv/ltv48_OMASA_1ISM_2TC.met ../scripts/switchPaths/sw_13k2_512k_2fr_start_24k4_omasatechs_1ism.bin 48 testv/ltv48_OMASA_1ISM_2TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 @@ -1668,8 +1679,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/ltv48_OMASA_4ISM_2TC.wav_EXT_256000_48-48_JBM5.tst - - // OMASA 1Dir1TC 4ISM 48 kbps 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out custom configuration ../IVAS_cod -ism_masa 4 1 testv/ltv48_OMASA_4ISM_1TC_ISM1.csv testv/ltv48_OMASA_4ISM_1TC_ISM2.csv testv/ltv48_OMASA_4ISM_1TC_ISM3.csv testv/ltv48_OMASA_4ISM_1TC_ISM4.csv testv/ltv48_OMASA_4ISM_1TC.met 48000 48 testv/ltv48_OMASA_4ISM_1TC.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_1TC.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst @@ -1678,16 +1687,6 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_cod -ism_masa 4 2 testv/ltv48_OMASA_4ISM_2TC_ISM1.csv testv/ltv48_OMASA_4ISM_2TC_ISM2.csv testv/ltv48_OMASA_4ISM_2TC_ISM3.csv testv/ltv48_OMASA_4ISM_2TC_ISM4.csv testv/ltv48_OMASA_4ISM_2TC.met 48000 48 testv/ltv48_OMASA_4ISM_2TC.wav bit ../IVAS_dec -render_config testv/rend_config_hospital_patientroom.cfg BINAURAL_ROOM_REVERB 48 bit testv/ltv48_OMASA_4ISM_2TC.wav_BINAURAL_ROOM_REVERB_48000_48-48_custom_configuration.tst -// EVS non-diegetic panning at 64 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod 64000 48 testv/ltv48_MONO.wav bit -../IVAS_dec -non_diegetic_pan -50 48 bit testv/ltv48_MONO.pcm_EVS_64000_48-48_STEREO_NON-DIEGETIC-PAN_-50.tst - -// 1 ISM non-diegetic panning at 32 kbps, 48kHz in, 48kHz out, STEREO out -../IVAS_cod -ism 1 testv/ltvISM1.csv 32000 48 testv/ltv48_1ISM.wav bit -../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/ltv48_1ISM.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst - - - // OMASA 2Dir2TC 1ISM at 13.2 kbps, 48kHz in, 48kHz out, BINAURAL out ../IVAS_cod -ism_masa 1 2 NULL testv/ltv48_OMASA_1ISM_2TC.met 13200 48 testv/ltv48_OMASA_1ISM_2TC.wav bit ../IVAS_dec BINAURAL 48 bit testv/ltv48_OMASA_1ISM_2TC.wav_BINAURAL_13200_48-48.tst -- GitLab From b5a0089ae5f36805d8dac9be20de9942699a0abc Mon Sep 17 00:00:00 2001 From: norvell Date: Fri, 20 Dec 2024 07:05:44 +0000 Subject: [PATCH 36/40] Update create_mode_force.py --- scripts/create_mode_force.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/create_mode_force.py b/scripts/create_mode_force.py index 39ec6773ea..fe87f7fdce 100644 --- a/scripts/create_mode_force.py +++ b/scripts/create_mode_force.py @@ -36,6 +36,7 @@ import struct MODES = { 0: "1 ACELP\n", 1: "1 TCX\n", + 2: "1 TCX\n", # Current -force option does not distinguish between TCX10 and TCX20 3: "1 HQ\n", } SR = [16, 32, 48] -- GitLab From eabbab770f824dd31a2d389dd9b8b620ca15405c Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 9 Jan 2025 08:36:21 +0200 Subject: [PATCH 37/40] Fix LTV self test case. --- scripts/config/self_test_ltv.prm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config/self_test_ltv.prm b/scripts/config/self_test_ltv.prm index 1f073f71ce..c9ca9cd783 100644 --- a/scripts/config/self_test_ltv.prm +++ b/scripts/config/self_test_ltv.prm @@ -1635,7 +1635,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit ../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/ltv48_MASA2TC.wav_sw_48-48_EXT_JBM5.tst // MASA 1TC bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL out, JBM Prof 5 -../IVAS_cod -masa 2 testv/ltv48_MASA1TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA1TC.wav bit +../IVAS_cod -masa 1 testv/ltv48_MASA1TC.met ../scripts/switchPaths/sw_13k2_512k.bin 48 testv/ltv48_MASA1TC.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0 ../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 16 netsimoutput testv/ltv48_MASA1TC.wav_sw_48-16_BINAURAL_JBM5.tst -- GitLab From b1b2dc1f5e8cd68c85ffa0c4c81521aba273164d Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 9 Jan 2025 10:22:05 +0100 Subject: [PATCH 38/40] log command lines of eid-xor and netsim tools --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index bb9e8ca387..3b3325795f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -749,6 +749,7 @@ class DecoderFrontend: cwd = Path(tmp_dir).absolute() else: cwd = Path(run_dir).absolute() + log_dbg_msg(f"eid-xor command:\n {" ".join(eid_command)}") result = run(eid_command, check=True, cwd=cwd) except Exception as e: pytest.fail(f"eid-xor operation failed! - {e}") @@ -793,6 +794,7 @@ class DecoderFrontend: else: cwd = Path(run_dir).absolute() run(netsim_command, check=True, cwd=cwd) + log_dbg_msg(f"netsim command:\n {" ".join(netsim_command)}") except Exception as e: pytest.fail(f"netsim operation failed! - {e}") -- GitLab From 19a9602a0883e38275574753c6d927fc8aaf0f46 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 9 Jan 2025 10:47:03 +0100 Subject: [PATCH 39/40] fix f srings --- tests/conftest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 3b3325795f..a82ee1a13a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -749,7 +749,9 @@ class DecoderFrontend: cwd = Path(tmp_dir).absolute() else: cwd = Path(run_dir).absolute() - log_dbg_msg(f"eid-xor command:\n {" ".join(eid_command)}") + + eid_command_str = " ".join(eid_command) + log_dbg_msg(f"eid-xor command:\n {eid_command_str}") result = run(eid_command, check=True, cwd=cwd) except Exception as e: pytest.fail(f"eid-xor operation failed! - {e}") @@ -794,7 +796,9 @@ class DecoderFrontend: else: cwd = Path(run_dir).absolute() run(netsim_command, check=True, cwd=cwd) - log_dbg_msg(f"netsim command:\n {" ".join(netsim_command)}") + + netsim_command_str = " ".join(netsim_command) + log_dbg_msg(f"netsim command:\n {netsim_command_str}") except Exception as e: pytest.fail(f"netsim operation failed! - {e}") -- GitLab From fce8ba2896e31e11bda56bd1c1ac7b5eae0540af Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 9 Jan 2025 11:08:55 +0100 Subject: [PATCH 40/40] change path objects to stringsin netsim command --- tests/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index a82ee1a13a..e7f591f4d4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -781,11 +781,11 @@ class DecoderFrontend: tracefile_path = input_bitstream_path.with_suffix(".netsimtrace") # TODO: need to check if the "1" works with every profile netsim_command = [ - netsim_path, - netsim_profile, - input_bitstream_path, - netsim_bitstream_path, - tracefile_path, + str(netsim_path), + str(netsim_profile), + str(input_bitstream_path), + str(netsim_bitstream_path), + str(tracefile_path), "1", ] print(netsim_command) -- GitLab