diff --git a/lib_com/options.h b/lib_com/options.h index 61eef7b0c2379455a12cc4201cfdc22cfd684b12..785ea51ed70f03fc9cd8fea6ae4ceb7523c2268e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -118,6 +118,7 @@ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1097_SBA_DTX_BRATE_SWITCHING_ENC /* FhG: fix out-of-bound errors when switching from SID frame to active frame*/ #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 NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ #define FIX_1099_JBM_MD_HANDLE_ALLOC /* VA: issue 1099: Limit the allocation of `hJbmMetadata` handle to MASA and OMASA only */ #define FIX_1121_MASA_DESCRIPTOR /* VA: issue 1121: Define 'ivasmasaFormatDescriptor' at one common place */ diff --git a/lib_dec/ivas_objectRenderer_internal_fx.c b/lib_dec/ivas_objectRenderer_internal_fx.c index e64e9d2208082d85a1d7d1e44046ed94799d3eaf..f4cfa0dc156cb6b1c874c5ed49d03974fdd4e53e 100644 --- a/lib_dec/ivas_objectRenderer_internal_fx.c +++ b/lib_dec/ivas_objectRenderer_internal_fx.c @@ -263,7 +263,11 @@ ivas_error ivas_td_binaural_renderer_sf_fx( /* 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( NE_32( ( error = TDREND_GetMix_fx( st_ivas->hBinRendererTd, output_fx_local, output_frame, 0 ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = TDREND_GetMix_fx( st_ivas->hBinRendererTd, output_fx_local, output_frame, 0, ism_md_subframe_update_jbm != subframe_idx ) ), IVAS_ERR_OK ) ) +#endif { return error; } diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index bfd8566566a6e7d04e58cd985560aa67b4baec72..eca9692b55e00c04d08acce75cd0d4f141482fcf 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -459,7 +459,12 @@ ivas_error ivas_td_binaural_renderer_unwrap_fx( } /* Render subframe */ + +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + IF( NE_32( ( error = TDREND_GetMix_fx( hBinRendererTd, output_fx, subframe_length, subframe_idx ) ), IVAS_ERR_OK ) ) +#else IF( NE_32( ( error = TDREND_GetMix_fx( hBinRendererTd, output_fx, subframe_length, subframe_idx, ism_md_subframe_update ) ), IVAS_ERR_OK ) ) +#endif { return error; } @@ -502,8 +507,12 @@ ivas_error TDREND_GetMix_fx( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ Word32 *output[], /* i/o: ISM object synth / rendered output in 0,1 Q11 */ const Word16 subframe_length, /* i/o: subframe length */ - const Word16 subframe_idx, /* i : Subframe index to 5 ms subframe */ - const Word16 ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + const Word16 subframe_idx /* i : Subframe index to 5 ms subframe */ +#else + const Word16 subframe_idx, /* i : Subframe index to 5 ms subframe */ + const Word16 ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ +#endif ) { Word16 i; @@ -515,14 +524,18 @@ ivas_error TDREND_GetMix_fx( Word32 hrf_left_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; Word32 hrf_right_delta[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; Word16 intp_count; + +#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION Word16 subframe_update_flag; +#endif Word16 hrf_left_delta_e = 0, hrf_right_delta_e = 0; move16(); move16(); +#ifndef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION subframe_update_flag = (Word16) EQ_16( subframe_idx, ism_md_subframe_update ); move16(); - +#endif error = IVAS_ERR_OK; move32(); /* Clear the output buffer to accumulate rendered sources */ @@ -548,12 +561,21 @@ ivas_error TDREND_GetMix_fx( test(); IF( EQ_16( SrcRend_p->PlayStatus, TDREND_PLAYSTATUS_PLAYING ) && ( hBinRendererTd->Listener_p->PoseUpdated || SrcSpatial_p->Updated ) ) { +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( hBinRendererTd, SrcRend_p, SrcSpatial_p, + Src_p->hrf_left_prev_fx, &Src_p->hrf_left_prev_e, Src_p->hrf_right_prev_fx, &Src_p->hrf_right_prev_e, + hrf_left_delta, &hrf_left_delta_e, hrf_right_delta, &hrf_right_delta_e, + &intp_count, &Src_p->filterlength, &Src_p->itd, + &Src_p->Gain_fx, + Src_p ); +#else TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( hBinRendererTd, SrcRend_p, SrcSpatial_p, Src_p->hrf_left_prev_fx, &Src_p->hrf_left_prev_e, Src_p->hrf_right_prev_fx, &Src_p->hrf_right_prev_e, hrf_left_delta, &hrf_left_delta_e, hrf_right_delta, &hrf_right_delta_e, &intp_count, &Src_p->filterlength, &Src_p->itd, &Src_p->Gain_fx, Src_p, subframe_update_flag ); +#endif } /* Render source if needed */ diff --git a/lib_rend/ivas_objectRenderer_sources_fx.c b/lib_rend/ivas_objectRenderer_sources_fx.c index bf8b3a30e7f553287f147ed86af51eaf3f2a9b7a..62a8fc90616ffe01436e3fe6e7d8c24f6ce20410 100644 --- a/lib_rend/ivas_objectRenderer_sources_fx.c +++ b/lib_rend/ivas_objectRenderer_sources_fx.c @@ -307,9 +307,14 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( Word16 *itd, /* o : ITD value */ // Q0 Word32 *Gain, - /* o : Gain value */ // Q30 - TDREND_SRC_t *Src_p, /* i/o: Source pointer */ - const Word16 subframe_update_flag ) +/* o : Gain value */ // Q30 +#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 Word16 subframe_update_flag +#endif +) { TDREND_MIX_Listener_t *Listener_p; TDREND_HRFILT_FiltSet_t *HrFiltSet_p; @@ -469,7 +474,12 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( } test(); + +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION + IF( ( *intp_count > 0 ) ) +#else IF( ( *intp_count > 0 ) && subframe_update_flag ) +#endif { /* Set deltas for interpolation */ Word16 tmp_e; diff --git a/lib_rend/ivas_prot_rend_fx.h b/lib_rend/ivas_prot_rend_fx.h index 04d45c7262be221da571b7bedfea042ecfdeeabe..db806653fa187f03cf81f17420e985a17c6588dd 100644 --- a/lib_rend/ivas_prot_rend_fx.h +++ b/lib_rend/ivas_prot_rend_fx.h @@ -696,11 +696,15 @@ void ivas_td_binaural_close_fx( ); ivas_error TDREND_GetMix_fx( - BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ - Word32 *output[], /* i/o: ISM object synth / rendered output in 0,1 */ - const Word16 subframe_length, /* i/o: subframe length Q11 */ - const Word16 subframe_idx, /* i : Subframe index to 5 ms subframe */ - const Word16 ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ + BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd, /* i/o: TD renderer handle */ + Word32 *output[], /* i/o: ISM object synth / rendered output in 0,1 */ + const Word16 subframe_length, /* i/o: subframe length Q11 */ +#ifdef NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION +const Word16 subframe_idx /* i : Subframe index to 5 ms subframe */ +#else + const Word16 subframe_idx, /* i : Subframe index to 5 ms subframe */ + const Word16 ism_md_subframe_update /* i : Number of subframes to delay ism metadata to sync with audio */ +#endif ); void BSplineModelEvalDealloc_fx( @@ -785,8 +789,13 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams_fx( Word16 *filterlength, /* o : Length of filters */ Word16 *itd, /* o : ITD value */ Word32 *Gain, /* o : Gain value Q30 */ +#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 Word16 subframe_update_flag); + const Word16 subframe_update_flag /* i : Flag to determine update subframe idx */ +#endif +); ivas_error TDREND_SRC_Alloc( TDREND_SRC_t **Src_pp /* i/o: Source */