From 3b9badc96802d3c9397ca4fbfaa637f3343595aa Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 31 Jul 2024 17:12:29 +0200 Subject: [PATCH 1/5] [cleanup] accept FIX_1113_EXTREND_ISAR --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 17 ----------------- lib_rend/ivas_rotation.c | 4 ---- lib_rend/lib_rend.c | 12 ------------ lib_rend/lib_rend.h | 8 -------- 5 files changed, 42 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7189648051..aa5e00eb6d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ #define FIX_CREND_SIMPLIFY_CODE /* Ora : simplify line code in crend */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1113_EXTREND_ISAR /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ #define FIX_POINT_HRTF_FILE_FORMAT /* All: fix point hrtf binary file format */ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index f38caf6a16..9622a7fb99 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1271,12 +1271,7 @@ ivas_error ivas_rend_openCldfbRend( hBinRenderer->conv_band = convBand; } -#ifdef FIX_1113_EXTREND_ISAR ivas_output_init( hBinRenderer->hInputSetup, inConfig ); -#else - hBinRenderer->hInputSetup->is_loudspeaker_setup = 0; - hBinRenderer->hInputSetup->output_config = inConfig; -#endif if ( ( error = getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ) ) != IVAS_ERR_OK ) { return error; @@ -1308,7 +1303,6 @@ ivas_error ivas_rend_openCldfbRend( } #ifdef FIX_1113_CLDFB_REND_IN_ISAR -#ifdef FIX_1113_EXTREND_ISAR if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) { pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); @@ -1326,9 +1320,6 @@ ivas_error ivas_rend_openCldfbRend( /* should never happen for SBA */ return IVAS_ERR_INVALID_OUTPUT_FORMAT; } -#else - pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); -#endif #else pCldfbRend->binaural_latency_ns = (int32_t) ( FASTCONV_HOA3_latency_s * 1000000000.f ); #endif @@ -2199,12 +2190,8 @@ void ivas_binRenderer( } /* HOA decoding to CICP19 if needed*/ -#ifdef FIX_1113_EXTREND_ISAR if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && ( hBinRenderer->nInChannels != HOA3_CHANNELS && hBinRenderer->nInChannels != HOA2_CHANNELS && hBinRenderer->nInChannels != FOA_CHANNELS ) ) -#else - if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && hBinRenderer->nInChannels != 16 ) -#endif { ivas_sba2mc_cldfb( *( hBinRenderer->hInputSetup ), RealBuffer, ImagBuffer, hBinRenderer->nInChannels, hBinRenderer->conv_band, numTimeSlots, hBinRenderer->hoa_dec_mtx ); } @@ -2262,11 +2249,7 @@ void ivas_binRenderer( } else { -#ifdef FIX_1113_EXTREND_ISAR rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, hBinRenderer->hInputSetup->ambisonics_order ); -#else - rotateFrame_shd_cldfb( RealBuffer, ImagBuffer, Rmat_local, hBinRenderer->hInputSetup->nchan_out_woLFE, numTimeSlots, 3 ); -#endif } ivas_binRenderer_filterModule( Cldfb_RealBuffer_Binaural[pos_idx], Cldfb_ImagBuffer_Binaural[pos_idx], RealBuffer, ImagBuffer, numTimeSlots, hBinRenderer, pos_idx ); diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index c28d7430ae..dc5136cd00 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -502,12 +502,8 @@ void rotateFrame_shd_cldfb( float realRot[2 * HEADROT_ORDER + 1], imagRot[2 * HEADROT_ORDER + 1]; float SHrotmat[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM]; -#ifdef FIX_1113_EXTREND_ISAR assert( ( nInChannels == HOA3_CHANNELS || nInChannels == HOA2_CHANNELS || nInChannels == FOA_CHANNELS ) && "Number of channels must correspond to an ambisonics order!" ); -#else - assert( nInChannels == HEADROT_SHMAT_DIM && "Number of channels must be 16!" ); -#endif /* initialize rotation matrices with zeros */ for ( i = 0; i < HEADROT_SHMAT_DIM; i++ ) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c2133d2f6d..d091f05c0c 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -2512,11 +2512,7 @@ static ivas_error updateSbaPanGains( { if ( hRendCfg->split_rend_config.rendererSelection == ISAR_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { -#ifdef FIX_1113_EXTREND_ISAR assert( *rendCtx.pOutSampleRate == 48000 && "split binaural fast conv mode is currently supported with 48k sampling rate only" ); -#else - assert( inConfig == IVAS_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" ); -#endif if ( ( error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; @@ -4140,11 +4136,7 @@ ivas_error IVAS_REND_InitConfig( * *-------------------------------------------------------------------*/ -#ifdef FIX_1113_EXTREND_ISAR ivas_error IVAS_REND_GetRenderConfig( -#else -int16_t IVAS_REND_GetRenderConfig( -#endif IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ) @@ -4207,11 +4199,7 @@ int16_t IVAS_REND_GetRenderConfig( * *-------------------------------------------------------------------*/ -#ifdef FIX_1113_EXTREND_ISAR ivas_error IVAS_REND_FeedRenderConfig( -#else -int16_t IVAS_REND_FeedRenderConfig( -#endif IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ) diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 615ba65eee..81bedc3bcf 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -238,20 +238,12 @@ ivas_error IVAS_REND_InitConfig( const IVAS_AUDIO_CONFIG outAudioConfig /* i : output audioConfig */ ); -#ifdef FIX_1113_EXTREND_ISAR ivas_error IVAS_REND_GetRenderConfig( -#else -int16_t IVAS_REND_GetRenderConfig( -#endif IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ const IVAS_RENDER_CONFIG_HANDLE hRCout /* o : Render configuration handle */ ); -#ifdef FIX_1113_EXTREND_ISAR ivas_error IVAS_REND_FeedRenderConfig( -#else -int16_t IVAS_REND_FeedRenderConfig( -#endif IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS decoder handle */ const IVAS_RENDER_CONFIG_DATA renderConfig /* i : Render configuration struct */ ); -- GitLab From 0f2473659028da536dbb7350a89c012bd5480a7d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 31 Jul 2024 17:13:10 +0200 Subject: [PATCH 2/5] [cleanup] accept FIX_1113_CLDFB_REND_IN_ISAR --- lib_com/options.h | 1 - lib_dec/ivas_binRenderer_internal.c | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index aa5e00eb6d..6446fcf225 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -161,7 +161,6 @@ #define FIX_CREND_SIMPLIFY_CODE /* Ora : simplify line code in crend */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ #define FIX_POINT_HRTF_FILE_FORMAT /* All: fix point hrtf binary file format */ #ifdef FIX_POINT_HRTF_FILE_FORMAT diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 9622a7fb99..4934c3eb04 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1171,11 +1171,7 @@ static void ivas_binaural_obtain_DMX( set_zero( outImagRightPtr, CLDFB_NO_CHANNELS_MAX ); /*Ambisonics input requires different processing*/ -#ifdef FIX_1113_CLDFB_REND_IN_ISAR if ( hBinRenderer->nInChannels == HOA3_CHANNELS ) -#else - if ( hBinRenderer->nInChannels == 16 ) -#endif { float *inRealPtr_W, *inImagPtr_W; float *inRealPtr_Y, *inImagPtr_Y; @@ -1302,7 +1298,6 @@ ivas_error ivas_rend_openCldfbRend( return error; } -#ifdef FIX_1113_CLDFB_REND_IN_ISAR if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) { pCldfbRend->binaural_latency_ns = (int32_t) ( pCldfbRend->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); @@ -1320,9 +1315,6 @@ ivas_error ivas_rend_openCldfbRend( /* should never happen for SBA */ return IVAS_ERR_INVALID_OUTPUT_FORMAT; } -#else - pCldfbRend->binaural_latency_ns = (int32_t) ( FASTCONV_HOA3_latency_s * 1000000000.f ); -#endif hBinRenderer->hReverb = NULL; hBinRenderer->hEFAPdata = NULL; @@ -1456,27 +1448,15 @@ ivas_error ivas_binRenderer_open( } else { -#ifdef FIX_1113_CLDFB_REND_IN_ISAR if ( hBinRenderer->nInChannels == HOA3_CHANNELS ) -#else - if ( hBinRenderer->nInChannels == 16 ) -#endif { st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA3_latency_s * 1000000000.f ); } -#ifdef FIX_1113_CLDFB_REND_IN_ISAR else if ( hBinRenderer->nInChannels == HOA2_CHANNELS ) -#else - else if ( hBinRenderer->nInChannels == 9 ) -#endif { st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_HOA2_latency_s * 1000000000.f ); } -#ifdef FIX_1113_CLDFB_REND_IN_ISAR else if ( hBinRenderer->nInChannels == FOA_CHANNELS ) -#else - else if ( hBinRenderer->nInChannels == 4 ) -#endif { st_ivas->binaural_latency_ns = (int32_t) ( st_ivas->hHrtfFastConv->FASTCONV_FOA_latency_s * 1000000000.f ); } -- GitLab From 60d5c9f217c5b5821e02949ba59028a5cab3a1f3 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 31 Jul 2024 17:13:47 +0200 Subject: [PATCH 3/5] [cleanup] accept FIX_BASOP_812_NAN_COHSNR --- lib_com/options.h | 1 - lib_enc/ivas_stereo_dft_enc_itd.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6446fcf225..c42db033e7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,7 +170,6 @@ #define FIX_1123_PARAMBIN_16BIT_ROM /* FhG,Nok: issue 1123: update ParamBin ROM tables and scripts to generate 16 bit tables instead of float */ #define FIX_RETURN /* VA: fix location of function returns */ #endif -#define FIX_BASOP_812_NAN_COHSNR /* FhG: BASOP issue 812: fix nan values in sparse frames for cohSNR value in ITD estimation*/ /* #################### End BE switches ################################## */ diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index d115eb5a25..0476f35423 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -1051,18 +1051,14 @@ void stereo_dft_enc_compute_itd( } /*calculate total cohSNR for frame in dB*/ -#ifdef FIX_BASOP_812_NAN_COHSNR if ( mEr > 1.0f ) { -#endif cohSNR = 20 * log10f( mEr ); -#ifdef FIX_BASOP_812_NAN_COHSNR } else { cohSNR = 0; } -#endif /* collect UNCLR classifier parameters */ { -- GitLab From b3c64c128c5cce71a5cf5b07a022d4041a9995c0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 31 Jul 2024 17:14:24 +0200 Subject: [PATCH 4/5] [cleanup] accept NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE --- lib_com/options.h | 1 - lib_dec/swb_tbe_dec.c | 4 ---- lib_enc/swb_tbe_enc.c | 4 ---- 3 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c42db033e7..7def4b0b4f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,7 +177,6 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ -#define NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE /* VA: issue 1132: prevent division by extremely low energy value in SWB TBE */ #define NONBE_FIX_1141_OSBA_ROOM_RENDERING /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 5f2978157d..e43317b6e9 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -328,14 +328,12 @@ void wb_tbe_dec( prev_pow = sum2_f( shaped_wb_excitation, L_SHB_LAHEAD / 4 ); curr_pow = sum2_f( shaped_wb_excitation + L_SHB_LAHEAD / 4, L_SHB_LAHEAD / 4 ); -#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE if ( st->element_mode > EVS_MONO ) { /* prevent too low values of energy */ prev_pow = max( 0.00001f, prev_pow ); curr_pow = max( 0.00001f, curr_pow ); } -#endif if ( voice_factors[0] > 0.75f ) { @@ -1073,14 +1071,12 @@ void swb_tbe_dec( prev_pow = sum2_f( shaped_shb_excitation, L_SHB_LAHEAD + 10 ); curr_pow = sum2_f( shaped_shb_excitation + L_SHB_LAHEAD + 10, L_SHB_LAHEAD + 10 ); -#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE if ( st->element_mode > EVS_MONO ) { /* prevent too low values of energy */ prev_pow = max( 0.00001f, prev_pow ); curr_pow = max( 0.00001f, curr_pow ); } -#endif if ( voice_factors[0] > 0.75f ) { diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index 8f93f4241e..6f2b686638 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -383,14 +383,12 @@ void wb_tbe_enc( prev_pow = sum2_f( shaped_wb_excitation, L_SHB_LAHEAD / 4 ); curr_pow = sum2_f( shaped_wb_excitation + L_SHB_LAHEAD / 4, L_SHB_LAHEAD / 4 ); -#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE if ( st->element_mode > EVS_MONO ) { /* prevent too low values of energy */ prev_pow = max( 0.00001f, prev_pow ); curr_pow = max( 0.00001f, curr_pow ); } -#endif if ( voice_factors[0] > 0.75f ) { @@ -1069,14 +1067,12 @@ void swb_tbe_enc( prev_pow = sum2_f( shaped_shb_excitation, L_SHB_LAHEAD + 10 ); curr_pow = sum2_f( shaped_shb_excitation + L_SHB_LAHEAD + 10, L_SHB_LAHEAD + 10 ); -#ifdef NONBE_FIX_1132_THRESHOLD_POW_IN_SWB_TBE if ( st->element_mode > EVS_MONO ) { /* prevent too low values of energy */ prev_pow = max( 0.00001f, prev_pow ); curr_pow = max( 0.00001f, curr_pow ); } -#endif if ( voice_factors[0] > 0.75f ) { -- GitLab From 34af93bd21ce6f047a7e82138a9742dfef2acf8b Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 31 Jul 2024 17:16:00 +0200 Subject: [PATCH 5/5] formatting --- lib_dec/ivas_binRenderer_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 4934c3eb04..1d73514df5 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1170,7 +1170,7 @@ static void ivas_binaural_obtain_DMX( set_zero( outRealRightPtr, CLDFB_NO_CHANNELS_MAX ); set_zero( outImagRightPtr, CLDFB_NO_CHANNELS_MAX ); -/*Ambisonics input requires different processing*/ + /*Ambisonics input requires different processing*/ if ( hBinRenderer->nInChannels == HOA3_CHANNELS ) { float *inRealPtr_W, *inImagPtr_W; @@ -2169,7 +2169,7 @@ void ivas_binRenderer( } } -/* HOA decoding to CICP19 if needed*/ + /* HOA decoding to CICP19 if needed*/ if ( hBinRenderer->hInputSetup->is_loudspeaker_setup == 0 && ( hBinRenderer->nInChannels != HOA3_CHANNELS && hBinRenderer->nInChannels != HOA2_CHANNELS && hBinRenderer->nInChannels != FOA_CHANNELS ) ) { -- GitLab