Commit 38633f69 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_BASOP_2361_OTR

parent 9369ec04
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -124,18 +124,11 @@ void modify_Quat_q_fx(
    Word16 q_new                    /* i  : quaternion describing the rotation             */
)
{
#ifdef FIX_BASOP_2361_OTR
    Word16 shift = sub( q_new, in_quat->q_fact );
    out_quat->w_fx = L_shl_sat( in_quat->w_fx, shift ); // q_new
    out_quat->x_fx = L_shl_sat( in_quat->x_fx, shift ); // q_new
    out_quat->y_fx = L_shl_sat( in_quat->y_fx, shift ); // q_new
    out_quat->z_fx = L_shl_sat( in_quat->z_fx, shift ); // q_new
#else
    out_quat->w_fx = L_shl_sat( in_quat->w_fx, sub( q_new, in_quat->q_fact ) ); // q_new
    out_quat->x_fx = L_shl_sat( in_quat->x_fx, sub( q_new, in_quat->q_fact ) ); // q_new
    out_quat->y_fx = L_shl_sat( in_quat->y_fx, sub( q_new, in_quat->q_fact ) ); // q_new
    out_quat->z_fx = L_shl_sat( in_quat->z_fx, sub( q_new, in_quat->q_fact ) ); // q_new
#endif
    out_quat->q_fact = q_new;
    return;
}
@@ -155,19 +148,13 @@ void modify_Rmat_q_fx(
)
{
    Word16 j, k;
#ifdef FIX_BASOP_2361_OTR
    Word16 shift = sub( q_new, q_cur );
#endif

    FOR( j = 0; j < 3; j++ )
    {
        FOR( k = 0; k < 3; k++ )
        {
#ifdef FIX_BASOP_2361_OTR
            Rmat_out[j][k] = L_shl( Rmat_in[j][k], shift );
#else
            Rmat_out[j][k] = L_shl( Rmat_in[j][k], sub( q_new, q_cur ) );
#endif
            move32();
        }
    }
+0 −1
Original line number Diff line number Diff line
@@ -98,7 +98,6 @@
/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt. TS 26.251 V3.0 */

#define FIX_BASOP_2361_OTR                              /* FhG: Basop issue 2361: Orientation tracking tests for equivalent rotations fail */
#define FIX_2396_CONSTANT_STRIDE_IN_TC_BUFFER           /* FhG/VA: basop issue 2396: keep TC channel pointers in one constant place during decoding and rendering */
#define FIX_2408_FD_BWE_UPDATE                          /* VA: basop issue 2408: bug-fix in the FD BWE memory updates in wb_pre_proc_ivas_fx()  */
#define FIX_2380_HARM_GSC_GAIN_COMP_FX                  /* VA: basop issue 2380 & 2381: Fix issue when switching from CNG low energy to active content with high energy */
+0 −31
Original line number Diff line number Diff line
@@ -482,7 +482,6 @@ static Word32 VectorLength_fx(
    IVAS_VECTOR3 p,
    Word16 *q_fact )
{
#ifdef FIX_BASOP_2361_OTR
    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 );
@@ -490,13 +489,6 @@ static Word32 VectorLength_fx(

    result_fx = Sqrt32( result_fx, &sqrt_e );
    *q_fact = sub( 31, sqrt_e ); /* back to Q again */
#else
    Word32 result_fx = 0;
    move32();
    result_fx = L_add( L_add( Mpy_32_32( p.x_fx, p.x_fx ), Mpy_32_32( p.y_fx, p.y_fx ) ), Mpy_32_32( p.z_fx, p.z_fx ) ); // // Q: ( p1.q_fact + p2.q_fact ) - 31

    *q_fact = sub( add( p.q_fact, p.q_fact ), 31 );
#endif
    move16();
    return result_fx;
}
@@ -712,14 +704,10 @@ ivas_error ivas_orient_trk_SetReferenceRotation_fx(
        Euler2Quat_fx( deg2rad_fx( refRot.x_fx ), deg2rad_fx( refRot.y_fx ), deg2rad_fx( refRot.z_fx ), &pOTR->refRot );
        modify_Quat_q_fx( &pOTR->refRot, &pOTR->refRot, Q29 );
    }
#ifdef FIX_BASOP_2361_OTR
    ELSE
    {
#endif
        pOTR->refRot = refRot;
#ifdef FIX_BASOP_2361_OTR
    }
#endif

    return IVAS_ERR_OK;
}
@@ -841,16 +829,8 @@ ivas_error ivas_orient_trk_SetReferenceVector_fx(
            return IVAS_ERR_WRONG_PARAMS;
    }

#ifdef FIX_BASOP_2361_OTR
    Word16 tmp_q;
    acousticFrontVectorLength = VectorLength_fx( acousticFrontVector, &tmp_q );
#else
    Word16 accoustic_q = acousticFrontVector.q_fact;
    move16();
    acousticFrontVectorLength = VectorLength_fx( acousticFrontVector, &acousticFrontVector.q_fact );
    acousticFrontVector.q_fact = accoustic_q;
    move16();
#endif
    /* if the length is zero, the user has entered insensible listener and reference positions */
    IF( LE_32( acousticFrontVectorLength, 0 ) )
    {
@@ -911,7 +891,6 @@ ivas_error ivas_orient_trk_Process_fx(
            /* Reset average orientation   */
            pOTR->absAvgRot = absRot;

#ifdef FIX_BASOP_2361_OTR
            Word16 scale_e;
            Word16 tmp;
            tmp = BASOP_Util_Divide3232_Scale( PI2_C_ADP_RATE_Q31, updateRate_fx, &scale_e );
@@ -922,16 +901,6 @@ ivas_error ivas_orient_trk_Process_fx(
            move32();
            pOTR->Q_alpha = sub( Q31, scale_e );
            move16();
#else
            Word16 scale_e;
            Word32 div;
            div = L_deposit_h( BASOP_Util_Divide3232_Scale( pOTR->centerAdaptationRate_fx, updateRate_fx, &scale_e ) );

            scale_e = sub( scale_e, 8 ); // e+e1-e2//
            // here div value is less so we can use sandwitch rule of sine//
            pOTR->alpha_fx = div;
            move32();
#endif
            /* Compute relative orientation = (absolute orientation) - (reference orientation) */
            QuaternionInverse_fx( pOTR->refRot, &pOTR->trkRot );
            QuaternionProduct_fx( pOTR->trkRot, absRot, &pOTR->trkRot );
+0 −5
Original line number Diff line number Diff line
@@ -114,13 +114,8 @@ ivas_error Vector3PairFileReader_read(
    pSecond->y = y2;
    pSecond->z = z2;

#ifdef FIX_BASOP_2361_OTR
    pFirst->q_fact = 27;  // Q27
    pSecond->q_fact = 27; // Q27
#else
    pFirst->q_fact = 29;  // Q29
    pSecond->q_fact = 29; // Q29
#endif
    pFirst->x_fx = floatToFixed_32( pFirst->x, pFirst->q_fact );
    pFirst->y_fx = floatToFixed_32( pFirst->y, pFirst->q_fact );
    pFirst->z_fx = floatToFixed_32( pFirst->z, pFirst->q_fact );