diff --git a/apps/renderer.c b/apps/renderer.c index 26c4b349d2b8e436a01db2d5d3dda8a9f86f0d31..18e0f838e31ad927b92664cb4c99f72c6890f56b 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1228,6 +1228,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 6e836e141c2ad7cb2a44c8318899b353925e1cc7..f0fb90fe4e1df019fd8337662615bd92f3424093 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -680,8 +680,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 object_id /* i: Object ID */ ) #else const int32_t outFs ) @@ -692,9 +692,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; @@ -726,8 +723,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 */ - 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 2617bae683233d35cf5ae7b5be9f0d259f6c4170..32c2992c1a2449e6e329d666e821248b1e5bd426 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -662,8 +662,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 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 4d12d71e39138e721281b15aea5b87c3f4385d03..645a23f2c827b7e056035e4c64ae2bbc21251eda 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -122,6 +122,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; @@ -1609,7 +1612,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 - if ( ( error = ivas_td_binaural_open_ext( &inputIsm->tdRendWrapper, inConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate, id ) ) != 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 @@ -1621,7 +1624,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, 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 @@ -1643,7 +1646,7 @@ 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 ) + 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 @@ -3959,6 +3962,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 ac9516521d0486dcc9224b2f3f6af10e918b81fa..4df7d859612ba86491b5b41a8565a8aba08eba3c 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -152,6 +152,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 */