From f01330987d82c2d6e11897d04274ee5cec9debf1 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 11 Aug 2023 13:27:59 +0200 Subject: [PATCH 1/6] fix compilation issues --- lib_com/options.h | 6 ++++-- lib_rend/lib_rend.c | 13 ++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 6d126861a2..df6a1009f3 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -198,7 +198,10 @@ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_PRED_QUANT_63_PNTS #define SPLIT_REND_WITH_HEAD_ROT_PARAMBIN /* Nokia: Issue 623: Split rendering support for parambin renderer */ -#define FIX_658_SPLIT_REND_MASA /*Dlb : Fix for issue 658, uninitialized memory access in MASA in Split rendering 0DOF mode*/ +#define FIX_658_SPLIT_REND_MASA /*Dlb : Fix for issue 658, uninitialized memory access in MASA in Split rendering 0DOF mode*/ +#ifdef SBA_AND_OBJECTS +#define OSBA_SPLIT_RENDERING +#endif #endif #define FIX_594_STL_INCLUDE /* FhG: issue 594: Missing include of stl.h */ @@ -225,7 +228,6 @@ #define SBA_AND_OBJECTS #ifdef SBA_AND_OBJECTS #define OSBA_BR_SWITCHING -#define OSBA_SPLIT_RENDERING #endif #define TD_REND_TUNING_RENAME /* Eri: Tuning of TD renderer model as part of contribution 25 and renaming for default HRIR set */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 31ff940837..35317c9624 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -60,15 +60,14 @@ #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #define MAX_CLDFB_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) #define MAX_BIN_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) +#else +#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#endif #ifdef FIX_194_LFE_DELAY_EXTREND #define MAX_BIN_DELAY_SAMPLES 50 /* Maximum supported rendering latency for binaural IRs */ #endif -#else -#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) -#endif - /* Frame size required when rendering to binaural */ #define BINAURAL_RENDERING_FRAME_SIZE_MS 20 @@ -6490,7 +6489,7 @@ static ivas_error renderLfeToBinaural( #ifdef FIX_194_LFE_DELAY_EXTREND for ( ear_idx = 0; ear_idx < BINAURAL_CHANNELS; ++ear_idx ) { - writePtr = getSmplPtr( outAudio, pose_idx * BINAURAL_CHANNELS + ear_idx, 0 ); + writePtr = getSmplPtr( outAudio, ear_idx, 0 ); v_add( writePtr, tmpLfeBuffer, writePtr, frame_size ); } #else @@ -8107,6 +8106,7 @@ static void renderMasaToBinaural( copyMasaMetadataToDiracRenderer( &masaInput->masaMetadata, masaInput->decDummy->hSpatParamRendCom ); ivas_dirac_dec_binaural( masaInput->decDummy, *masaInput->base.ctx.pCombinedOrientationData, tmpBuffer, masaInput->base.inputBuffer.config.numChannels ); +#ifdef SPLIT_REND_WITH_HEAD_ROT if ( is_split_rend_mode ) { accumulateCLDFBArrayToBuffer( @@ -8116,8 +8116,11 @@ static void renderMasaToBinaural( } else { +#endif accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); +#ifdef SPLIT_REND_WITH_HEAD_ROT } +#endif return; } -- GitLab From bb1414dce28537b9fb3f005e7cacc8dc6f84bcd2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 11 Aug 2023 15:23:33 +0200 Subject: [PATCH 2/6] fix compilation warnings --- lib_dec/ivas_mc_paramupmix_dec.c | 10 +++++----- lib_rend/ivas_dirac_dec_binaural_functions.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 217d67d693..8e973facd0 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -58,7 +58,7 @@ static void ps_pred_process( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, float qmf_m #ifdef JBM_PARAMUPMIX static void ps_pred_process_sf( MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix, DECODER_TC_BUFFER_HANDLE hTcBuffer, float qmf_mod_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_mod_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_re[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float qmf_side_im[JBM_CLDFB_SLOTS_IN_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float *param_interpol, const int16_t ch, const int16_t slots_rendered ); -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS], int16_t slot_index_start ); #else static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, float *output_f[MAX_OUTPUT_CHANNELS] ); @@ -528,7 +528,7 @@ void ivas_mc_paramupmix_dec_render( int16_t slots_to_render, first_sf, last_sf, subframe_idx; uint16_t slot_size, ch; float *output_f_local[MAX_OUTPUT_CHANNELS]; -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) int16_t slot_index_start; #endif MC_PARAMUPMIX_DEC_HANDLE hMCParamUpmix; @@ -580,14 +580,14 @@ void ivas_mc_paramupmix_dec_render( mvr2r( hMCParamUpmix->beta_prev[ch], hMCParamUpmix->beta_sf[ch], IVAS_MAX_NUM_BANDS ); } -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) slot_index_start = 0; #endif for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) ivas_mc_paramupmix_dec_sf( st_ivas, output_f_local, slot_index_start ); slot_index_start += st_ivas->hTcBuffer->subframe_nbslots[subframe_idx]; #else @@ -1012,7 +1012,7 @@ static void ps_pred_process_sf( static void ivas_mc_paramupmix_dec_sf( Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ -#ifdef PARAMUPMIX_BINAURAL_UPDATES +#if defined( PARAMUPMIX_BINAURAL_UPDATES ) && defined( SPLIT_REND_WITH_HEAD_ROT ) , int16_t slot_index_start #endif diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 2b882468eb..a8d3897a73 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -104,7 +104,11 @@ typedef struct parambin_rend_config_data * Local function prototypes *------------------------------------------------------------------------*/ +#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, float *output_f[], const int16_t nchan_transport, const int16_t subframe ); +#else +static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, const int16_t nchan_transport, const int16_t subframe ); +#endif static void ivas_dirac_dec_decorrelate_slot( DIRAC_DEC_BIN_HANDLE hDiracDecBin, const int16_t num_freq_bands, const int16_t slot, float inRe[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float inIm[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], float decRe[][CLDFB_NO_CHANNELS_MAX], float decIm[][CLDFB_NO_CHANNELS_MAX] ); @@ -527,7 +531,11 @@ void ivas_dirac_dec_binaural_render( for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ ) { int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe_idx]; +#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN ivas_dirac_dec_binaural_internal( st_ivas, st_ivas->hCombinedOrientationData, output_f_local, nchan_transport, subframe_idx ); +#else + ivas_dirac_dec_binaural_internal( st_ivas, st_ivas->hCombinedOrientationData, nchan_transport, subframe_idx ); +#endif for ( ch = 0; ch < nchan_out; ch++ ) { @@ -673,7 +681,11 @@ void ivas_dirac_dec_binaural( { int16_t n_samples_sf = slot_size * hSpatParamRendCom->subframe_nbslots[subframe]; +#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN ivas_dirac_dec_binaural_internal( st_ivas, hCombinedOrientationData, p_output, nchan_transport, subframe ); +#else + ivas_dirac_dec_binaural_internal( st_ivas, hCombinedOrientationData, nchan_transport, subframe ); +#endif for ( ch = 0; ch < 2 * BINAURAL_CHANNELS; ch++ ) { @@ -698,7 +710,9 @@ void ivas_dirac_dec_binaural( static void ivas_dirac_dec_binaural_internal( Decoder_Struct *st_ivas, COMBINED_ORIENTATION_HANDLE hCombinedOrientationData, +#ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN float *output_f[], +#endif const int16_t nchan_transport, const int16_t subframe ) { -- GitLab From b9e1b1ec855c45be7a6530528a945b894396cf8d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 11 Aug 2023 17:52:47 +0200 Subject: [PATCH 3/6] fix declaration --- lib_util/render_config_reader.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib_util/render_config_reader.h b/lib_util/render_config_reader.h index f9491a0488..33cac35e99 100644 --- a/lib_util/render_config_reader.h +++ b/lib_util/render_config_reader.h @@ -61,8 +61,8 @@ ivas_error RenderConfigReader_getAcousticEnvironment( #ifdef CONTROL_METADATA_DIRECTIVITY ivas_error RenderConfigReader_getDirectivity( RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ - uint16_t *pId, /* i : Directivity pattern ID */ - float *directivity /* o : Target directivity */ + uint16_t *pId, /* i : Directivity pattern ID */ + float *directivity /* o : Target directivity */ ); #endif /* Verifies configuration parameters */ @@ -75,11 +75,8 @@ ivas_error RenderConfigReader_checkValues( ivas_error RenderConfigReader_read( #ifdef CONTROL_METADATA_REVERB RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ - const char *pRenderConfigPath /* i : Renderer configuration file path */ -#if ( defined SPLIT_REND_WITH_HEAD_ROT ) || ( defined DEBUGGING ) - , - IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ -#endif + const char *pRenderConfigPath, /* i : Renderer configuration file path */ + IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ #else RenderConfigReader *pRenderConfigReader, /* i : RenderConfigReader handle */ IVAS_RENDER_CONFIG_HANDLE hRenderConfig /* o : Renderer configuration handle */ -- GitLab From c87b584644fa13ec42596b3b932daa50b1400a49 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Fri, 11 Aug 2023 23:11:14 +0200 Subject: [PATCH 4/6] fix call to ivas_reverb_open(), introduced with FIX_674_MISSING_TABLES_FOR_TDREND_REVERB --- 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 090d065bbe..4f546f3e1e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1453,7 +1453,7 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { #ifdef FIX_674_MISSING_TABLES_FOR_TDREND_REVERB - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, &inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif -- GitLab From 201de97f0ae6406543c61ba82e0d90007a76d132 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 12 Aug 2023 22:08:05 +0200 Subject: [PATCH 5/6] re-enable SPLIT_REND_WITH_HEAD_ROT in options.h --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 5b0111eec3..96f7e04740 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,7 +151,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ -//#define SPLIT_REND_WITH_HEAD_ROT /* Dlb,FhG: Split Rendering contributions 21 and 35 */ +#define SPLIT_REND_WITH_HEAD_ROT /* Dlb,FhG: Split Rendering contributions 21 and 35 */ #ifdef SPLIT_REND_WITH_HEAD_ROT #define SPLIT_REND_PRED_QUANT_63_PNTS #define SPLIT_REND_WITH_HEAD_ROT_PARAMBIN /* Nokia: Issue 623: Split rendering support for parambin renderer */ -- GitLab From bbfa93da7da2e6a577add7d9183218d26b9aaad9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sat, 12 Aug 2023 22:09:41 +0200 Subject: [PATCH 6/6] formatting --- lib_dec/ivas_mc_paramupmix_dec.c | 6 +++--- lib_rend/lib_rend.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index bd66135d1b..d9be291edb 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -981,11 +981,11 @@ static void ps_pred_process_sf( static void ivas_mc_paramupmix_dec_sf( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ + Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ + float *output_f[MAX_OUTPUT_CHANNELS] /* i/o: synthesized core-coder transport channels */ #ifdef SPLIT_REND_WITH_HEAD_ROT , - int16_t slot_index_start + int16_t slot_index_start #endif ) { diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index c5b66e2a97..8e17dfe0a3 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8067,7 +8067,7 @@ static void renderMasaToBinaural( #ifdef FIX_264_AUDIO_CHANNELS_TO_HEAP accumulate2dArrayToBuffer( tmpBuffer_buff, &outAudio ); #else - accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); + accumulate2dArrayToBuffer( tmpBuffer, &outAudio ); #endif #ifdef SPLIT_REND_WITH_HEAD_ROT } -- GitLab