Commit 0f1db617 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

minimize diffs

parent 829f977a
Loading
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -40,11 +40,6 @@
#include "wmc_auto.h"
#include "prot_fx.h"

#ifdef FIX_2398_PRECISSION_ORIENTATION_TRACKING
#define FIX_2398_PRECISSION_ORIENTATION_TRACKING_VectorLength_fx_USE_Sqrt32_NewtonRaphson /*use refinement of Sqrt32          within VectorLength_fx() function*/
#define FIX_2398_PRECISSION_ORIENTATION_TRACKING_QuaternionNormalize_fx_USE_Sqrt32_NewtonRaphson /*use refinement of Sqrt32   within QuaternionNormalize_fx() function*/
#endif


/*------------------------------------------------------------------------------------------*
 * Local constants
@@ -236,7 +231,7 @@ static void QuaternionNormalize_fx(
    Word32 sqrt_fx;
    Word32 dot_prod_fx = QuaternionDotProduct_fx( q_fx, q_fx, &q_dot );
    sqrt_e = sub( Q31, q_dot );
#ifdef FIX_2398_PRECISSION_ORIENTATION_TRACKING_QuaternionNormalize_fx_USE_Sqrt32_NewtonRaphson
#ifdef FIX_2398_PRECISSION_ORIENTATION_TRACKING
    sqrt_fx = Sqrt32_NewtonRaphson( dot_prod_fx, &sqrt_e, 1 );
#else
    sqrt_fx = Sqrt32( dot_prod_fx, &sqrt_e );
@@ -521,7 +516,6 @@ static Word32 VectorDotProduct_fx(
    return result_fx;
}


/*------------------------------------------------------------------------------------------*
 * VectorLength()
 *
@@ -532,18 +526,15 @@ static Word32 VectorLength_fx(
    IVAS_VECTOR3 p,
    Word16 *q_fact )
{

    Word16 sqrt_e;
    Word32 result_fx;
    result_fx = Madd_32_32( Madd_32_32( Mpy_32_32( p.x_fx, p.x_fx ), p.y_fx, p.y_fx ), p.z_fx, p.z_fx );
    sqrt_e = shl( sub( 31, p.q_fact ), 1 ); /* convert Q to E */
#ifndef FIX_2398_PRECISSION_ORIENTATION_TRACKING_VectorLength_fx_USE_Sqrt32_NewtonRaphson
#ifndef FIX_2398_PRECISSION_ORIENTATION_TRACKING
    result_fx = Sqrt32( result_fx, &sqrt_e );
#else
    result_fx = Sqrt32_NewtonRaphson( result_fx, &sqrt_e, 1 );
#endif


    *q_fact = sub( 31, sqrt_e ); /* back to Q again */
    move16();
    return result_fx;
@@ -606,13 +597,11 @@ static void VectorRotationToQuaternion_fx(

    p1_normalized_fx = VectorNormalize_fx( p1 );
    p2_normalized_fx = VectorNormalize_fx( p2 );

    cross_product_fx = VectorCrossProduct_fx( p1_normalized_fx, p2_normalized_fx );
    dot_product_fx = VectorDotProduct_fx( p1_normalized_fx, p2_normalized_fx, &q_dot );

    // dot & cross product are same q//

    Word32 comp_fx = -2147481472;
    Word32 comp_fx = -2147481472; //-0.999999f in Q31
    move32();
    Word16 comp_e = 0, check_flag;
    move16();