From 7a4a3eacf46e3abee96977f6dbd9dcad181b327e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 11 Jan 2024 10:11:35 +0100 Subject: [PATCH] add FIX_954_OTR_REF_VEC and fix reference vector direction --- lib_com/options.h | 1 + lib_rend/ivas_orient_trk.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index ebaa43a69d..b2897c3ba0 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,6 +150,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ /*#define SPLIT_REND_WITH_HEAD_ROT */ /* Dlb,FhG: Split Rendering contributions 21 and 35 */ +#define FIX_954_OTR_REF_VEC /* FhG: Fix forward vector direction for OTR REF VEC mode */ /* #################### End BE switches ################################## */ diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index ff24510c58..f4332a3b68 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -545,7 +545,11 @@ ivas_error ivas_orient_trk_SetReferenceVector( case IVAS_HEAD_ORIENT_TRK_REF: case IVAS_HEAD_ORIENT_TRK_AVG: case IVAS_HEAD_ORIENT_TRK_REF_VEC: +#ifdef FIX_954_OTR_REF_VEC + acousticFrontVector = VectorSubtract( refPos, listenerPos ); +#else acousticFrontVector = VectorSubtract( listenerPos, refPos ); +#endif break; case IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV: /* ignore the height difference between listener position and reference position */ @@ -554,7 +558,11 @@ ivas_error ivas_orient_trk_SetReferenceVector( listenerPosLevel.y = listenerPos.y; refPosLevel.x = refPos.x; refPosLevel.y = refPos.y; +#ifdef FIX_954_OTR_REF_VEC + acousticFrontVector = VectorSubtract( refPosLevel, listenerPosLevel ); +#else acousticFrontVector = VectorSubtract( listenerPosLevel, refPosLevel ); +#endif break; default: return IVAS_ERR_WRONG_PARAMS; @@ -568,7 +576,11 @@ ivas_error ivas_orient_trk_SetReferenceVector( return IVAS_ERR_WRONG_PARAMS; } +#ifdef FIX_954_OTR_REF_VEC + ivasForwardVector.x = 1.0f; +#else ivasForwardVector.x = -1.0f; +#endif ivasForwardVector.y = 0.0f; ivasForwardVector.z = 0.0f; VectorRotationToQuaternion( ivasForwardVector, acousticFrontVector, &pOTR->refRot ); -- GitLab