diff --git a/lib_com/options.h b/lib_com/options.h index 60a13fdae17f04c8d2120b3bf6addfa58080753c..4eaa7bb31e8a30035bb773c3a35472000cc7bdbb 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -163,6 +163,7 @@ #define FIX_UNCLR_ISSUE /* VoiceAge: issue 574: Fix UNCLR mis-classifications in noisy speech stereo */ #define FIX_TCX_LOWRATE_LIMITATION /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */ #define FIX_575_LOW_OVERLAP_PLC_RECOVERY /* FhG: Issue 575 fix for PLC and transistion to TCX5*/ +#define FIX_569_TD_FILTER_LENGTH /* Eri: Issue 569: If an HRTF binary file exceeds the SFX_SPAT_BIN_MAX_FILTER_LENGTH the decoder crashes. This truncates the filter when generated from the model. */ #define ISM_FB_16k4 /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */ #define FIX_580_PARAMMC_ENER_BURSTS /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */ #define UPDATE_FASTCONV_SBA_FILTER /* Dlb: Issue 584: Update SBA CLDFB-Domain HRTFs */ diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 6463261ec47145ba640e0bb77312f4afce673dc9..0df5df6fcddb0adc706f14c542bedd0681efd3e8 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -97,16 +97,24 @@ void GetFilterFromAngle( TDREND_HRFILT_FiltSet_t *HrFiltSet_p, /* i/o: HR filter set structure */ const float Elev, /* i : Elevation, degrees */ float Azim, /* i : Azimuth, degrees */ - float *hrf_left, /* o : Left HR filter */ - float *hrf_right, /* o : Right HR filter */ - int16_t *itd /* o : ITD value */ +#ifdef FIX_569_TD_FILTER_LENGTH + const int16_t filterlength, /* i : Filter length */ +#endif + float *hrf_left, /* o : Left HR filter */ + float *hrf_right, /* o : Right HR filter */ + int16_t *itd /* o : ITD value */ ) { GenerateFilter( Elev, Azim, &HrFiltSet_p->ModelParams, &HrFiltSet_p->ModelEval ); +#ifdef FIX_569_TD_FILTER_LENGTH + mvr2r( HrFiltSet_p->ModelEval.hrfModL, hrf_left, filterlength ); + mvr2r( HrFiltSet_p->ModelEval.hrfModR, hrf_right, filterlength ); +#else mvr2r( HrFiltSet_p->ModelEval.hrfModL, hrf_left, HrFiltSet_p->ModelParams.K ); mvr2r( HrFiltSet_p->ModelEval.hrfModR, hrf_right, HrFiltSet_p->ModelParams.K ); +#endif /* 4. Evaluate the ITD */ if ( HrFiltSet_p->ModelParams.UseItdModel ) { diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index 8debd6619bc341bc6a55f83b8ff28bc239403bd5..8b4b910c5b1411874cd84b2af4e6a02b88912cfe 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -275,7 +275,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Listener_p = hBinRendererTd->Listener_p; HrFiltSet_p = hBinRendererTd->HrFiltSet_p; +#ifdef FIX_569_TD_FILTER_LENGTH + *filterlength = min( HrFiltSet_p->FiltLength, SFX_SPAT_BIN_MAX_FILTER_LENGTH ); +#else *filterlength = HrFiltSet_p->FiltLength; +#endif /* 1. Map source pos to the coordinate system of the listener */ switch ( SrcSpatial_p->PosType ) @@ -312,7 +316,11 @@ void TDREND_SRC_REND_UpdateFiltersFromSpatialParams( Azim = -1.0f * _180_OVER_PI * (float) atan2f( ListRelPos[1], ListRelPos[0] ); } +#ifdef FIX_569_TD_FILTER_LENGTH + GetFilterFromAngle( HrFiltSet_p, Elev, Azim, *filterlength, hrf_left, hrf_right, itd ); +#else GetFilterFromAngle( HrFiltSet_p, Elev, Azim, hrf_left, hrf_right, itd ); +#endif /* 6. Evaluate the directional and distance gains */ /* Directional gain */ diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 803a612502e88c4edc139db1c8c7dbf2bd704748..c0313922262e7f7536a380c8fb11dc8a762b8595 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -314,6 +314,9 @@ void GetFilterFromAngle( TDREND_HRFILT_FiltSet_t *HrFiltSet_p, /* i/o: HR filter set structure */ const float Elev, /* i : Elevation, degrees */ float Azim, /* i : Azimuth, degrees */ +#ifdef FIX_569_TD_FILTER_LENGTH + const int16_t filterlength, /* i : Filter length */ +#endif float *LeftFilter, /* o : Left HR filter */ float *RightFilter, /* o : Right HR filter */ int16_t *itd /* o : ITD value */