diff --git a/lib_com/options.h b/lib_com/options.h index a84db75dc7f0d4bea007e5a2a557a098c1cd5bfd..23ef274169d102e85cea12bb9de794bdee942959 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -185,6 +185,8 @@ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ + +#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */ #define FIX_1113_CLDFB_REND_IN_ISAR /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */ #define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ #define NONBE_1894_OSBA_SCALING /* FhG: port OSBA scaling MRs (298,355,360) jointly */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 823844b9a3e9bcb94a8e74f19860433b16a67c26..1aa0508094a5cf0333905fadeaee2940b4fe9adf 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -204,7 +204,12 @@ 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 2e98f7de7620a4bfbd83cec234970bb4cf763ed4..2137c948398b843b8759b2f5f7fa86392bb32b3e 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -396,7 +396,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; } @@ -437,8 +441,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; @@ -450,10 +458,12 @@ 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; /* Clear the output buffer to accumulate rendered sources */ @@ -476,8 +486,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 c1eaef409b24125759c0d7f0a57d5e5e1ffaca21..db26566ad2aa4140585e688e2273d9722bf964ba 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -289,8 +289,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; @@ -381,7 +386,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 ef22e92c6df703546220f7760d0281af58867a44..f9e3a1a2d31a09f15749a2a481c769a07d87f5de 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( @@ -750,8 +754,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(