Commit 7a4a3eac authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

add FIX_954_OTR_REF_VEC and fix reference vector direction

parent b726dd64
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 ################################## */
+12 −0
Original line number Diff line number Diff line
@@ -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 );