From 79fd098b0c8213f964fa690901de770c7ac7b229 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 8 Sep 2025 16:54:49 +0200 Subject: [PATCH 1/5] 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_fx.c | 19 +++++++++++++++++-- lib_rend/ivas_prot_rend_fx.h | 3 +++ lib_rend/lib_rend_fx.c | 20 ++++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b3fbecfb0..c15c48e18 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -105,6 +105,7 @@ #define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ #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_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_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 850debb72..51ed35b07 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -604,13 +604,16 @@ ivas_error TDREND_Update_object_positions_fx( const ISM_METADATA_HANDLE *hIsmMetaData /* i : Input metadata for ISM objects */ ) { +#ifndef NONBE_1377_REND_DIRATT_CONF TDREND_DirAtten_t *DirAtten_p; +#endif Word16 nS; Word32 Pos_fx[3]; // Q25 Word32 Dir_fx[3]; // Q30 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++ ) @@ -635,11 +638,12 @@ ivas_error TDREND_Update_object_positions_fx( { return error; } - +#ifndef NONBE_1377_REND_DIRATT_CONF IF( NE_32( ( error = TDREND_MIX_SRC_SetDirAtten_fx( hBinRendererTd, nS, DirAtten_p ) ), IVAS_ERR_OK ) ) { return error; } +#endif IF( hIsmMetaData[nS]->non_diegetic_flag ) { @@ -790,6 +794,9 @@ ivas_error ivas_td_binaural_open_ext_fx( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 outFs, +#ifdef NONBE_1377_REND_DIRATT_CONF + const IVAS_REND_InputId id, /* i: ISM ID */ +#endif Word16 *SrcInd, Word16 *num_src ) { @@ -798,6 +805,9 @@ ivas_error ivas_td_binaural_open_ext_fx( IVAS_FORMAT ivas_format; IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; +#ifdef NONBE_1377_REND_DIRATT_CONF + Word16 ism_number; +#endif Word32 *distAtt_fx = NULL; Word16 *directivity_fx = NULL; @@ -839,7 +849,12 @@ ivas_error ivas_td_binaural_open_ext_fx( if ( NULL != hRendCfg ) { +#ifdef NONBE_1377_REND_DIRATT_CONF + ism_number = s_and( (Word16) 0xFF, id ); /* Exctract ISM number from ID */ + directivity_fx = hRendCfg->directivity_fx + 3 * ism_number; /* Address calculation -- no BASOPs */ +#else directivity_fx = hRendCfg->directivity_fx; +#endif distAtt_fx = hRendCfg->distAtt_fx; } diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 32d3639be..39eebf343 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -687,6 +687,9 @@ ivas_error ivas_td_binaural_open_ext_fx( RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 output_Fs, +#ifdef NONBE_1377_REND_DIRATT_CONF + const IVAS_REND_InputId id, /* i : ISM ID */ +#endif Word16 *SrcInd, Word16 *num_src ); diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index c74d77bf9..c4d9acccf 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -1493,7 +1493,11 @@ static ivas_error setRendInputActiveIsm( test(); IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { +#ifdef NONBE_1377_REND_DIRATT_CONF + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -1526,7 +1530,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( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -1560,7 +1568,11 @@ static ivas_error setRendInputActiveIsm( } ELSE { +#ifdef NONBE_1377_REND_DIRATT_CONF + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -2512,7 +2524,11 @@ static ivas_error initMcBinauralRendering( { Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; Word16 num_src; +#ifdef NONBE_1377_REND_DIRATT_CONF + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->tdRendWrapper, inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -2548,7 +2564,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( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, 0, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputMc->splitTdRendWrappers[i], inConfig, hRendCfg, &inputMc->customLsInput, outSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) +#endif { return error; } -- GitLab From 0990f0fbc17f6e6a3486af60f15a986404169477 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 09:50:20 +0200 Subject: [PATCH 2/5] Fix under NONBE_1377_REND_DIRATT_CONF --- lib_com/options.h | 1 - lib_rend/ivas_objectRenderer_fx.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index d651bd863..41fa771e6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -105,7 +105,6 @@ #define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ #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_1377_REND_DIRATT_CONF /* Eri: Issue 1377: Error in directivity attenuation configuration for both IVAS_dec and IVAS_rend */ #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 */ diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 51ed35b07..ad56f794f 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -850,7 +850,7 @@ ivas_error ivas_td_binaural_open_ext_fx( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = s_and( (Word16) 0xFF, id ); /* Exctract ISM number from ID */ + ism_number = sub( s_and( (Word16) 0xFF, id ), 1 ); /* Extract ISM number from ID */ directivity_fx = hRendCfg->directivity_fx + 3 * ism_number; /* Address calculation -- no BASOPs */ #else directivity_fx = hRendCfg->directivity_fx; -- GitLab From 05ba3d7f632fb48f771db9deab67e3545e6e05cb Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Tue, 9 Sep 2025 14:57:37 +0200 Subject: [PATCH 3/5] Add id in renderer configuration struct --- lib_com/common_api_types.h | 4 ++++ lib_rend/ivas_objectRenderer_fx.c | 6 +----- lib_rend/ivas_prot_rend_fx.h | 2 +- lib_rend/ivas_render_config_fx.c | 4 ++++ lib_rend/lib_rend_fx.c | 19 ++++++++++++++++--- 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 66f2c2d74..af14b73c2 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -343,6 +343,10 @@ typedef struct _IVAS_RENDER_CONFIG Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15} float distAtt[3]; Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */ +#ifdef NONBE_1377_REND_DIRATT_CONF + Word16 object_id[IVAS_MAX_NUM_OBJECTS]; + Word16 number_of_objects; +#endif } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index ad56f794f..6ecd5f11d 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -795,7 +795,7 @@ ivas_error ivas_td_binaural_open_ext_fx( LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 outFs, #ifdef NONBE_1377_REND_DIRATT_CONF - const IVAS_REND_InputId id, /* i: ISM ID */ + Word16 ism_number, /* i: ISM number */ #endif Word16 *SrcInd, Word16 *num_src ) @@ -805,9 +805,6 @@ ivas_error ivas_td_binaural_open_ext_fx( IVAS_FORMAT ivas_format; IVAS_OUTPUT_SETUP hTransSetup; ivas_error error; -#ifdef NONBE_1377_REND_DIRATT_CONF - Word16 ism_number; -#endif Word32 *distAtt_fx = NULL; Word16 *directivity_fx = NULL; @@ -850,7 +847,6 @@ ivas_error ivas_td_binaural_open_ext_fx( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = sub( s_and( (Word16) 0xFF, id ), 1 ); /* Extract ISM number from ID */ directivity_fx = hRendCfg->directivity_fx + 3 * ism_number; /* Address calculation -- no BASOPs */ #else directivity_fx = hRendCfg->directivity_fx; diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 39eebf343..b26a9e9cb 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -688,7 +688,7 @@ ivas_error ivas_td_binaural_open_ext_fx( LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 output_Fs, #ifdef NONBE_1377_REND_DIRATT_CONF - const IVAS_REND_InputId id, /* i : ISM ID */ + const Word16 ism_number, /* i : ISM number */ #endif Word16 *SrcInd, Word16 *num_src diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index 98e5a0b33..32080d90c 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -140,6 +140,10 @@ ivas_error ivas_render_config_init_from_rom_fx( move32(); ( *hRenderConfig )->distAtt_fx[2] = ONE_IN_Q30; // Q30 /* Default rolloff factor */ move32(); +#ifdef NONBE_1377_REND_DIRATT_CONF + ( *hRenderConfig )->number_of_objects = 0; + move16(); +#endif ( *hRenderConfig )->split_rend_config.splitRendBitRate = ISAR_MAX_SPLIT_REND_BITRATE; move32(); ( *hRenderConfig )->split_rend_config.dof = 3; diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index c4d9acccf..95c555c31 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -1430,6 +1430,9 @@ static ivas_error setRendInputActiveIsm( Word16 num_src; Word16 ivas_format; Word16 num_poses; +#ifdef NONBE_1377_REND_DIRATT_CONF + Word16 ism_number; +#endif IF( EQ_32( getAudioConfigType( inConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ) { @@ -1494,7 +1497,12 @@ static ivas_error setRendInputActiveIsm( IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef NONBE_1377_REND_DIRATT_CONF - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) + ism_number = hRendCfg->number_of_objects; + move16(); + hRendCfg->object_id[ism_number] = id; + hRendCfg->number_of_objects = add( hRendCfg->number_of_objects, 1 ); + + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #endif @@ -1531,7 +1539,7 @@ static ivas_error setRendInputActiveIsm( FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { #ifdef NONBE_1377_REND_DIRATT_CONF - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, ism_number, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #endif @@ -1569,7 +1577,12 @@ static ivas_error setRendInputActiveIsm( ELSE { #ifdef NONBE_1377_REND_DIRATT_CONF - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) + ism_number = hRendCfg->number_of_objects; + move16(); + hRendCfg->object_id[ism_number] = id; + hRendCfg->number_of_objects = add( hRendCfg->number_of_objects, 1 ); + + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #endif -- GitLab From f340cc8c762a90247b08cc4ff3925f9ff31dab31 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 10 Sep 2025 07:15:31 +0200 Subject: [PATCH 4/5] Change to object id within inputIsm structs --- apps/renderer.c | 3 ++ lib_com/common_api_types.h | 5 ---- lib_rend/ivas_objectRenderer_fx.c | 4 +-- lib_rend/ivas_prot_rend_fx.h | 2 +- lib_rend/ivas_render_config_fx.c | 4 --- lib_rend/lib_rend.h | 6 ++++ lib_rend/lib_rend_fx.c | 50 +++++++++++++++++++++---------- 7 files changed, 46 insertions(+), 28 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 0de22270e..3a4d4e128 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1278,6 +1278,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_com/common_api_types.h b/lib_com/common_api_types.h index af14b73c2..664f552c0 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -343,11 +343,6 @@ typedef struct _IVAS_RENDER_CONFIG Word16 directivity_fx[IVAS_MAX_NUM_OBJECTS * 3]; // has the following q-factor pattern: {6, 6, 15, 6, 6, 15, 6, 6, 15, 6, 6, 15} float distAtt[3]; Word32 distAtt_fx[3]; /* {Q27, Q30, Q30} */ -#ifdef NONBE_1377_REND_DIRATT_CONF - Word16 object_id[IVAS_MAX_NUM_OBJECTS]; - Word16 number_of_objects; -#endif - } IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE; typedef struct diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 6ecd5f11d..6a35e9d0f 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -795,7 +795,7 @@ ivas_error ivas_td_binaural_open_ext_fx( LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 outFs, #ifdef NONBE_1377_REND_DIRATT_CONF - Word16 ism_number, /* i: ISM number */ + Word16 object_id, /* i: Object ID */ #endif Word16 *SrcInd, Word16 *num_src ) @@ -847,7 +847,7 @@ ivas_error ivas_td_binaural_open_ext_fx( if ( NULL != hRendCfg ) { #ifdef NONBE_1377_REND_DIRATT_CONF - directivity_fx = hRendCfg->directivity_fx + 3 * ism_number; /* Address calculation -- no BASOPs */ + directivity_fx = hRendCfg->directivity_fx + 3 * object_id; /* Address calculation -- no BASOPs */ #else directivity_fx = hRendCfg->directivity_fx; #endif diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index b26a9e9cb..57911331c 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -688,7 +688,7 @@ ivas_error ivas_td_binaural_open_ext_fx( LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 output_Fs, #ifdef NONBE_1377_REND_DIRATT_CONF - const Word16 ism_number, /* i : ISM number */ + const Word16 object_id, /* i : Object ID */ #endif Word16 *SrcInd, Word16 *num_src diff --git a/lib_rend/ivas_render_config_fx.c b/lib_rend/ivas_render_config_fx.c index 32080d90c..98e5a0b33 100644 --- a/lib_rend/ivas_render_config_fx.c +++ b/lib_rend/ivas_render_config_fx.c @@ -140,10 +140,6 @@ ivas_error ivas_render_config_init_from_rom_fx( move32(); ( *hRenderConfig )->distAtt_fx[2] = ONE_IN_Q30; // Q30 /* Default rolloff factor */ move32(); -#ifdef NONBE_1377_REND_DIRATT_CONF - ( *hRenderConfig )->number_of_objects = 0; - move16(); -#endif ( *hRenderConfig )->split_rend_config.splitRendBitRate = ISAR_MAX_SPLIT_REND_BITRATE; move32(); ( *hRenderConfig )->split_rend_config.dof = 3; diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 05b78f670..65cd20af3 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -147,6 +147,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_fx( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_REND_InputId inputId, /* i : ID of the input */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 95c555c31..7b2b73855 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -131,6 +131,9 @@ typedef struct Word32 nonDiegeticPanGain_fx; /* Q31 */ OMASA_ANA_HANDLE hOMasa; UWord16 total_num_objects; +#ifdef NONBE_1377_REND_DIRATT_CONF + Word16 object_id; +#endif Word32 ism_metadata_delay_ms_fx; /* Q0 */ } input_ism; @@ -1430,9 +1433,6 @@ static ivas_error setRendInputActiveIsm( Word16 num_src; Word16 ivas_format; Word16 num_poses; -#ifdef NONBE_1377_REND_DIRATT_CONF - Word16 ism_number; -#endif IF( EQ_32( getAudioConfigType( inConfig ), IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ) { @@ -1497,12 +1497,7 @@ static ivas_error setRendInputActiveIsm( IF( EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_16( outConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = hRendCfg->number_of_objects; - move16(); - hRendCfg->object_id[ism_number] = id; - hRendCfg->number_of_objects = add( hRendCfg->number_of_objects, 1 ); - - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #endif @@ -1539,7 +1534,7 @@ static ivas_error setRendInputActiveIsm( FOR( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) { #ifdef NONBE_1377_REND_DIRATT_CONF - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, ism_number, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->splitTdRendWrappers[i], inConfig, hRendCfg, NULL, *inputIsm->base.ctx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #endif @@ -1577,12 +1572,7 @@ static ivas_error setRendInputActiveIsm( ELSE { #ifdef NONBE_1377_REND_DIRATT_CONF - ism_number = hRendCfg->number_of_objects; - move16(); - hRendCfg->object_id[ism_number] = id; - hRendCfg->number_of_objects = add( hRendCfg->number_of_objects, 1 ); - - IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, ism_number, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) + IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, inputIsm->object_id, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #else IF( NE_32( ( error = ivas_td_binaural_open_ext_fx( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, SrcInd, &num_src ) ), IVAS_ERR_OK ) ) #endif @@ -4209,6 +4199,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() * -- GitLab From b2445acf996c2c4840bec7e793a5168a20234f8d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 10 Sep 2025 08:15:55 +0200 Subject: [PATCH 5/5] Add missing const qualifier --- lib_rend/ivas_objectRenderer_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index 6a35e9d0f..0eb73f018 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -795,7 +795,7 @@ ivas_error ivas_td_binaural_open_ext_fx( LSSETUP_CUSTOM_STRUCT *customLsInput, const Word32 outFs, #ifdef NONBE_1377_REND_DIRATT_CONF - Word16 object_id, /* i: Object ID */ + const Word16 object_id, /* i: Object ID */ #endif Word16 *SrcInd, Word16 *num_src ) -- GitLab