From decd9f6521169a952cde50766f97dedc67425e57 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 8 Sep 2025 15:36:37 +0200 Subject: [PATCH 1/7] Add NONBE_1377_REND_DIRATT_CONF to address Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend --- lib_com/options.h | 1 + lib_rend/ivas_objectRenderer.c | 21 ++++++++++++++++++++- lib_rend/ivas_prot_rend.h | 5 +++++ lib_rend/lib_rend.c | 20 ++++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 597107966..0c4477f35 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,6 +168,7 @@ #define NONBE_FIX_1143_MASA_BRSW /* Nok: Fix for issue 1143: MSAN use of uninitialized value in masa decoding to binaural with dtx bitrate switching and 5 % FER */ #define NONBE_FIX_1220_OMASA_JBM_EXT_USAN /* Nokia: fix issue 1220 OMASA EXT JBM USAN, also fix similar cases of free to avoid future problems */ #define NONBE_FIX_1376_MDCT_CONCEALMENT /* FhG: fix concealment artifact in MDCT Stereo with DTX, in case transition frame gets lost */ +#define NONBE_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 1b5a7d049..4c81d3802 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -518,13 +518,16 @@ ivas_error TDREND_Update_object_positions( const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ ) { +#ifndef NONBE_1377_REND_DIRATT_CONF TDREND_DirAtten_t *DirAtten_p; +#endif int16_t nS; float Pos[3]; float Dir[3]; ivas_error error; - +#ifndef NONBE_1377_REND_DIRATT_CONF DirAtten_p = hBinRendererTd->DirAtten_p; +#endif /* For each source, write the frame data to the source object*/ for ( nS = 0; nS < num_src; nS++ ) @@ -541,10 +544,12 @@ ivas_error TDREND_Update_object_positions( return error; } +#ifndef NONBE_1377_REND_DIRATT_CONF if ( ( error = TDREND_MIX_SRC_SetDirAtten( hBinRendererTd, nS, DirAtten_p ) ) != IVAS_ERR_OK ) { return error; } +#endif if ( hIsmMetaData[nS]->non_diegetic_flag ) { @@ -654,13 +659,22 @@ ivas_error ivas_td_binaural_open_ext( AUDIO_CONFIG inConfig, RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, +#ifdef NONBE_1377_REND_DIRATT_CONF + const int32_t outFs, /* i: output sampling rate */ + const IVAS_REND_InputId id /* i: ISM ID */ +) +#else const int32_t outFs ) +#endif { int16_t nchan_transport; AUDIO_CONFIG transport_config; IVAS_FORMAT ivas_format; IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; +#ifdef NONBE_1377_REND_DIRATT_CONF + int16_t ism_number; +#endif float *distAtt = NULL; float *directivity = NULL; @@ -691,7 +705,12 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { +#ifdef NONBE_1377_REND_DIRATT_CONF + ism_number = id & 0x00FF; /* Exctract ISM number from ID */ + directivity = hRendCfg->directivity + 3 * ism_number; +#else directivity = hRendCfg->directivity; +#endif distAtt = hRendCfg->distAtt; } diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 1e8ffa6bc..c0beda123 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -641,7 +641,12 @@ ivas_error ivas_td_binaural_open_ext( const AUDIO_CONFIG inConfig, RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, +#ifdef NONBE_1377_REND_DIRATT_CONF + const int32_t outFs, /* i: output sampling rate */ + const IVAS_REND_InputId id /* i: ISM ID */ +#else const int32_t output_Fs +#endif ); void ivas_td_binaural_close( diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 68d5d4558..134aa64f0 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1326,7 +1326,11 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { +#ifdef NONBE_1377_REND_DIRATT_CONF + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -1334,7 +1338,11 @@ static ivas_error setRendInputActiveIsm( /* Open TD renderer wrappers */ for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { +#ifdef NONBE_1377_REND_DIRATT_CONF + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, id ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -1352,7 +1360,11 @@ static ivas_error setRendInputActiveIsm( } else { +#ifdef NONBE_1377_REND_DIRATT_CONF + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -2107,7 +2119,11 @@ static ivas_error initMcBinauralRendering( if ( useTDRend && inputMc->tdRendWrapper.hBinRendererTd == NULL ) { +#ifdef NONBE_1377_REND_DIRATT_CONF + if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0 ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -2117,7 +2133,11 @@ static ivas_error initMcBinauralRendering( /* Open TD renderer wrappers */ for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { +#ifdef NONBE_1377_REND_DIRATT_CONF + if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0 ) ) != IVAS_ERR_OK ) +#else if ( ( error = ivas_td_binaural_open_ext( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate ) ) != IVAS_ERR_OK ) +#endif { return error; } -- GitLab From 7b53196ebac54dc09515ab999fd3030368530bf9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 09:55:09 +0200 Subject: [PATCH 2/7] Fix under NONBE_1377_REND_DIRATT_CONF --- lib_rend/ivas_objectRenderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 4c81d3802..caf49e3cb 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -706,7 +706,7 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = id & 0x00FF; /* Exctract ISM number from ID */ + ism_number = id & 0x00FF - 1; /* Extract ISM number from ID */ directivity = hRendCfg->directivity + 3 * ism_number; #else directivity = hRendCfg->directivity; -- GitLab From 3fe02a56487cc893e5620921e6bf42d2df59d329 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 11:10:58 +0200 Subject: [PATCH 3/7] Add parenthesis to resolve warning --- lib_rend/ivas_objectRenderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index caf49e3cb..65ecb3656 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -706,7 +706,7 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = id & 0x00FF - 1; /* Extract ISM number from ID */ + ism_number = (id & 0x00FF) - 1; /* Extract ISM number from ID */ directivity = hRendCfg->directivity + 3 * ism_number; #else directivity = hRendCfg->directivity; -- GitLab From 24ff31c361c256567488e10fe4b76719840e88cf Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 11:21:35 +0200 Subject: [PATCH 4/7] Clang format --- lib_rend/ivas_objectRenderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 65ecb3656..f452a0962 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -706,7 +706,7 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = (id & 0x00FF) - 1; /* Extract ISM number from ID */ + ism_number = ( id & 0x00FF ) - 1; /* Extract ISM number from ID */ directivity = hRendCfg->directivity + 3 * ism_number; #else directivity = hRendCfg->directivity; -- GitLab From 3ddbba0a3ede202b2077a3ac33d06c4d31ef9600 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 14:39:28 +0200 Subject: [PATCH 5/7] Add id in renderer configuration struct --- lib_com/common_api_types.h | 5 +++++ lib_rend/ivas_objectRenderer.c | 8 ++------ lib_rend/ivas_prot_rend.h | 4 ++-- lib_rend/ivas_render_config.c | 3 +++ lib_rend/lib_rend.c | 17 ++++++++++++++--- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 5fb7b349c..4210c11ad 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -325,6 +325,11 @@ typedef struct _IVAS_RENDER_CONFIG ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; float directivity[IVAS_MAX_NUM_OBJECTS * 3]; float distAtt[3]; +#ifdef NONBE_1377_REND_DIRATT_CONF + int16_t object_id[IVAS_MAX_NUM_OBJECTS]; + int16_t number_of_objects; +#endif + } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; typedef struct diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index f452a0962..cbff634a2 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -660,8 +660,8 @@ ivas_error ivas_td_binaural_open_ext( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, #ifdef NONBE_1377_REND_DIRATT_CONF - const int32_t outFs, /* i: output sampling rate */ - const IVAS_REND_InputId id /* i: ISM ID */ + const int32_t outFs, /* i: output sampling rate */ + const int16_t ism_number /* i: ISM number */ ) #else const int32_t outFs ) @@ -672,9 +672,6 @@ ivas_error ivas_td_binaural_open_ext( IVAS_FORMAT ivas_format; IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; -#ifdef NONBE_1377_REND_DIRATT_CONF - int16_t ism_number; -#endif float *distAtt = NULL; float *directivity = NULL; @@ -706,7 +703,6 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = ( id & 0x00FF ) - 1; /* Extract ISM number from ID */ directivity = hRendCfg->directivity + 3 * ism_number; #else directivity = hRendCfg->directivity; diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index c0beda123..8906bba06 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -642,8 +642,8 @@ ivas_error ivas_td_binaural_open_ext( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, #ifdef NONBE_1377_REND_DIRATT_CONF - const int32_t outFs, /* i: output sampling rate */ - const IVAS_REND_InputId id /* i: ISM ID */ + const int32_t output_Fs, /* i: output sampling rate */ + const int16_t ism_number /* i: ISM number */ #else const int32_t output_Fs #endif diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 887538a11..288d22062 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -134,6 +134,9 @@ ivas_error ivas_render_config_init_from_rom( ( *hRenderConfig )->distAtt[1] = 1.0f; /* Default ref dist */ ( *hRenderConfig )->distAtt[2] = 1.0f; /* Default rolloff factor */ ( *hRenderConfig )->split_rend_config.splitRendBitRate = SPLIT_REND_768k; +#ifdef NONBE_1377_REND_DIRATT_CONF + ( *hRenderConfig )->number_of_objects = 0; +#endif ( *hRenderConfig )->split_rend_config.dof = 3; ( *hRenderConfig )->split_rend_config.hq_mode = 0; ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 134aa64f0..690468f90 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1288,6 +1288,9 @@ static ivas_error setRendInputActiveIsm( AUDIO_CONFIG outConfig; input_ism *inputIsm; int16_t i; +#ifdef NONBE_1377_REND_DIRATT_CONF + int16_t ism_number; +#endif inputIsm = (input_ism *) input; rendCtx = inputIsm->base.ctx; @@ -1327,7 +1330,11 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifdef NONBE_1377_REND_DIRATT_CONF - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id ) ) != IVAS_ERR_OK ) + ism_number = hRendCfg->number_of_objects; + hRendCfg->object_id[ism_number] = id; + hRendCfg->number_of_objects++; + + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -1339,7 +1346,7 @@ static ivas_error setRendInputActiveIsm( for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { #ifdef NONBE_1377_REND_DIRATT_CONF - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, id ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, ism_number ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -1361,7 +1368,11 @@ static ivas_error setRendInputActiveIsm( else { #ifdef NONBE_1377_REND_DIRATT_CONF - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id ) ) != IVAS_ERR_OK ) + ism_number = hRendCfg->number_of_objects; + hRendCfg->object_id[ism_number] = id; + hRendCfg->number_of_objects++; + + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif -- GitLab From 9397a3bb7bd16ff46b03f5f983accf46d786234b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 22:11:01 +0200 Subject: [PATCH 6/7] Change to object id within inputIsm structs --- apps/renderer.c | 3 +++ lib_rend/ivas_objectRenderer.c | 6 ++--- lib_rend/ivas_prot_rend.h | 2 +- lib_rend/lib_rend.c | 45 +++++++++++++++++++++++++--------- lib_rend/lib_rend.h | 6 +++++ 5 files changed, 47 insertions(+), 15 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index a01cb40c2..b843a718b 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1189,6 +1189,9 @@ int main( { masaIds[i] = 0u; } +#ifdef NONBE_1377_REND_DIRATT_CONF + IVAS_REND_SetObjectIDs( hIvasRend ); +#endif for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i ) { diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index cbff634a2..879aa5e90 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -660,8 +660,8 @@ ivas_error ivas_td_binaural_open_ext( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, #ifdef NONBE_1377_REND_DIRATT_CONF - const int32_t outFs, /* i: output sampling rate */ - const int16_t ism_number /* i: ISM number */ + const int32_t outFs, /* i: output sampling rate */ + const int16_t object_id /* i: Object ID */ ) #else const int32_t outFs ) @@ -703,7 +703,7 @@ ivas_error ivas_td_binaural_open_ext( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - directivity = hRendCfg->directivity + 3 * ism_number; + directivity = hRendCfg->directivity + 3 * object_id; #else directivity = hRendCfg->directivity; #endif diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 8906bba06..6d6f0c141 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -643,7 +643,7 @@ ivas_error ivas_td_binaural_open_ext( LSSETUP_CUSTOM_STRUCT *customLsInput, #ifdef NONBE_1377_REND_DIRATT_CONF const int32_t output_Fs, /* i: output sampling rate */ - const int16_t ism_number /* i: ISM number */ + const int16_t object_id /* i: Object ID */ #else const int32_t output_Fs #endif diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 690468f90..5f95dc66a 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -119,6 +119,9 @@ typedef struct float nonDiegeticPanGain; OMASA_ANA_HANDLE hOMasa; uint16_t total_num_objects; +#ifdef NONBE_1377_REND_DIRATT_CONF + int16_t object_id; +#endif float ism_metadata_delay_ms; } input_ism; @@ -1330,11 +1333,7 @@ static ivas_error setRendInputActiveIsm( if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = hRendCfg->number_of_objects; - hRendCfg->object_id[ism_number] = id; - hRendCfg->number_of_objects++; - - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -1346,7 +1345,7 @@ static ivas_error setRendInputActiveIsm( for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { #ifdef NONBE_1377_REND_DIRATT_CONF - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, ism_number ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, inputIsm->object_id ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -1368,11 +1367,7 @@ static ivas_error setRendInputActiveIsm( else { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = hRendCfg->number_of_objects; - hRendCfg->object_id[ism_number] = id; - hRendCfg->number_of_objects++; - - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id ) ) != IVAS_ERR_OK ) #else if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) #endif @@ -3626,6 +3621,34 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return IVAS_ERR_OK; } +#ifdef NONBE_1377_REND_DIRATT_CONF +/*-------------------------------------------------------------------* + * IVAS_REND_SetObjectIDs() + * + * + *-------------------------------------------------------------------*/ + +ivas_error IVAS_REND_SetObjectIDs( + IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ +) +{ + int16_t i; + + /* Validate function arguments */ + if ( hIvasRend == NULL ) + { + return IVAS_ERR_UNEXPECTED_NULL_POINTER; + } + + for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ ) + { + hIvasRend->inputsIsm[i].object_id = i; + } + + return IVAS_ERR_OK; +} +#endif + /*-------------------------------------------------------------------* * IVAS_REND_SetInputGain() diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 8e3353b1b..463e1a882 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -145,6 +145,12 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( const IVAS_CUSTOM_LS_DATA layout /* i : custom loudspeaker layout for input */ ); +#ifdef NONBE_1377_REND_DIRATT_CONF +ivas_error IVAS_REND_SetObjectIDs( + IVAS_REND_HANDLE hIvasRend /* i/o: Renderer handle */ +); +#endif + ivas_error IVAS_REND_SetInputGain( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_REND_InputId inputId, /* i : ID of the input */ -- GitLab From 89954745b7236b1dcf297f050f836e408f8a40e3 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 22:16:44 +0200 Subject: [PATCH 7/7] Cleanup --- lib_com/common_api_types.h | 5 ----- lib_rend/ivas_render_config.c | 3 --- lib_rend/lib_rend.c | 3 --- 3 files changed, 11 deletions(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 4210c11ad..5fb7b349c 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -325,11 +325,6 @@ typedef struct _IVAS_RENDER_CONFIG ISAR_SPLIT_REND_CONFIG_DATA split_rend_config; float directivity[IVAS_MAX_NUM_OBJECTS * 3]; float distAtt[3]; -#ifdef NONBE_1377_REND_DIRATT_CONF - int16_t object_id[IVAS_MAX_NUM_OBJECTS]; - int16_t number_of_objects; -#endif - } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; typedef struct diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 288d22062..887538a11 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -134,9 +134,6 @@ ivas_error ivas_render_config_init_from_rom( ( *hRenderConfig )->distAtt[1] = 1.0f; /* Default ref dist */ ( *hRenderConfig )->distAtt[2] = 1.0f; /* Default rolloff factor */ ( *hRenderConfig )->split_rend_config.splitRendBitRate = SPLIT_REND_768k; -#ifdef NONBE_1377_REND_DIRATT_CONF - ( *hRenderConfig )->number_of_objects = 0; -#endif ( *hRenderConfig )->split_rend_config.dof = 3; ( *hRenderConfig )->split_rend_config.hq_mode = 0; ( *hRenderConfig )->split_rend_config.codec_delay_ms = 0; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 5f95dc66a..628421352 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1291,9 +1291,6 @@ static ivas_error setRendInputActiveIsm( AUDIO_CONFIG outConfig; input_ism *inputIsm; int16_t i; -#ifdef NONBE_1377_REND_DIRATT_CONF - int16_t ism_number; -#endif inputIsm = (input_ism *) input; rendCtx = inputIsm->base.ctx; -- GitLab