diff --git a/lib_com/options.h b/lib_com/options.h index 64519c06ddaf2274214f31e7c4a675b901bc06bb..ca759dc86cd3711076ff089a28b889a027387b90 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -171,6 +171,7 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */ +#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ #define NONBE_1229_FIX_ISM1_DPID /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 2a4e7782da0647be7768eea9ab870e3c438e3492..4dc1732dbed7622402cdb584fa0234d66adbdd1b 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -235,7 +235,11 @@ ivas_error ivas_td_binaural_renderer_sf( /* Render subframe */ /* ism_md_subframe_update_jbm != subframe_idx: trigger update only for ism_md_subframe_update_jbm == subframe_idx, where then the two TDREND_GetMix()-arguments subframe_idx and ism_md_subframe_update are equal, and we want to enforce the update inside TDREND_GetMix to use subframe_idx == 0 */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 ) ) != IVAS_ERR_OK ) +#else if ( ( error = TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ) != IVAS_ERR_OK ) +#endif { return error; } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 43bfe3c7a981f1caf65cfcc38da52aaae9b8fe1e..0a44305f064ee7257d0548044fb98c840a7d2d9c 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -384,7 +384,11 @@ ivas_error ivas_td_binaural_renderer_unwrap( } /* Render subframe */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx ) ) != IVAS_ERR_OK ) +#else if ( ( error = TDREND_GetMix( hBinRendererTd, output, subframe_length, subframe_idx, ism_md_subframe_update ) ) != IVAS_ERR_OK ) +#endif { return error; } @@ -425,8 +429,12 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth / rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ - const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ - const int16_t ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ +#else + const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ + const int16_t ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ +#endif ) { int16_t i; @@ -438,9 +446,11 @@ ivas_error TDREND_GetMix( float hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; int16_t intp_count; +#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION int16_t subframe_update_flag; subframe_update_flag = subframe_idx == ism_md_subframe_update; +#endif error = IVAS_ERR_OK; @@ -464,8 +474,13 @@ ivas_error TDREND_GetMix( /* Update rendering params if needed */ if ( ( SrcRend_p->PlayStatus == TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, + Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p ); +#else TDREND_SRC_REND_UpdateFiltersFromSpatialParams( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev, Src_p->hrf_right_prev, hrf_left_delta, hrf_right_delta, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain, Src_p, subframe_update_flag ); +#endif } /* Render source if needed */ diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 27c7801ad115d07249e4b6956da62e2f8b793290..0307a058eb2f4dc7b50de9705ba9822be0faf336 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -305,8 +305,13 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ - TDREND_SRC_t *Src_p, /* i/o: Source pointer */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + TDREND_SRC_t *Src_p /* i/o: Source pointer */ +) +#else + TDREND_SRC_t *Src_p, /* i/o: Source pointer */ const int16_t subframe_update_flag ) +#endif { TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; @@ -397,7 +402,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Src_p->azim_prev = 360.0f; /* Dummy angle -- sets max interpolation if switching to TDREND_POSTYPE_ABSOLUTE */ } +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + if ( ( *intp_count > 0 ) ) +#else if ( ( *intp_count > 0 ) && subframe_update_flag ) +#endif { /* Set deltas for interpolation */ v_sub( hrf_left, hrf_left_prev, hrf_left_delta, *filterlength ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 583fe40348b4186c0969cd15d927ae003fe6fe98..d7ec73d71ee57593e673aed766efc08c019f5396 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -658,8 +658,12 @@ ivas_error TDREND_GetMix( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ float *output[], /* i/o: ISM object synth/rendered output in 0,1 */ const int16_t subframe_length, /* i/o: subframe length */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + const int16_t subframe_idx /* i : Subframe index to 5 ms subframe */ +#else const int16_t subframe_idx, /* i : Subframe index to 5 ms subframe */ const int16_t ism_md_subframe_update /* i : Number of subframes to delay metadata to sync with audio */ +#endif ); ivas_error TDREND_Update_listener_orientation( @@ -760,8 +764,12 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( int16_t *filterlength, /* o : Length of filters */ int16_t *itd, /* o : ITD value */ float *Gain, /* o : Gain value */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + TDREND_SRC_t *Src_p /* i/o: Source pointer */ +#else TDREND_SRC_t *Src_p, const int16_t subframe_update_flag /* i : Flag to determine update subframe idx */ +#endif ); ivas_error TDREND_SRC_Alloc(