Commit 888f2168 authored by malenov's avatar malenov
Browse files

cleanup NONBE_FIX_738_QUATERNION_SLERP_PRECISION

parent b6f8ce39
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@

/* ################### Start FIXES switches ########################### */

#define NONBE_FIX_738_QUATERNION_SLERP_PRECISION        /* Philips: issue 738: Quaternion spherical linear interpolation precision handling issues */
#define FIX_1033_MEMORY_LEAK_OMASA                      /* Nokia / Orange: issue #1033: Memory leak in OMASA to BINAURAL with HRTF with bitrate switching */
#define FIX_976_USAN_PVQ_ENC_DEC_EVS_CR                 /* Ericsson:  premature cast to unsigned detected by USAN corrected  */
#define FIX_1027_GSC_INT_OVERFLOW                       /* VA: issue 2207: overflow in GSC */
+0 −25
Original line number Diff line number Diff line
@@ -49,10 +49,7 @@
 *------------------------------------------------------------------------------------------*/

#define OTR_UPDATE_RATE (float) FRAMES_PER_SEC /* rate of the Process() calls [Hz]; 1x per IVAS frame */
#ifdef NONBE_FIX_738_QUATERNION_SLERP_PRECISION
#define COS_ONE_TENTH_DEGREE ( 0.999998476913288f )
#endif


/*------------------------------------------------------------------------------------------*
 * Local functions
@@ -160,7 +157,6 @@ void QuaternionSlerp(
    const float t,
    IVAS_QUATERNION *const r )
{
#ifdef NONBE_FIX_738_QUATERNION_SLERP_PRECISION
    IVAS_QUATERNION r1, r2;
    float phi, sinPhi, cosPhi, s1, s2;

@@ -199,28 +195,7 @@ void QuaternionSlerp(
        r->y = ( s1 * r1.y + s2 * r2.y ) / sinPhi;
        r->z = ( s1 * r1.z + s2 * r2.z ) / sinPhi;
    }
#else

    float angle, denom, s, s2;

    s = QuaternionDotProduct( q1, q2 );

    if ( fabsf( s ) >= 1.0f )
    {
        *r = q2;
        return;
    }

    angle = acosf( s );
    denom = sinf( angle );

    s = sinf( ( 1 - t ) * angle );
    s2 = sinf( t * angle );
    r->x = ( q1.x * s + q2.x * s2 ) / denom;
    r->y = ( q1.y * s + q2.y * s2 ) / denom;
    r->z = ( q1.z * s + q2.z * s2 ) / denom;
    r->w = ( q1.w * s + q2.w * s2 ) / denom;
#endif
    QuaternionNormalize( *r, r );

    return;