/*************************** Fraunhofer IIS FDK Tools ********************** (C) Copyright Fraunhofer IIS (2005) All Rights Reserved Please be advised that this software and/or program delivery is Confidential Information of Fraunhofer and subject to and covered by the Fraunhofer IIS Software Evaluation Agreement between Google Inc. and Fraunhofer effective and in full force since March 1, 2012. You may use this software and/or program only under the terms and conditions described in the above mentioned Fraunhofer IIS Software Evaluation Agreement. Any other and/or further use requires a separate agreement. $Id$ Author(s): Haricharan Lakshman, Manuel Jander Description: Trigonometric functions fixed point fractional implementation. This software and/or program is protected by copyright law and international treaties. Any reproduction or distribution of this software and/or program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law. ******************************************************************************/ #include "common_fix.h" #include "FDK_tools_rom.h" /* Fixed point precision definitions */ #define Q(format) ((FIXP_DBL)(((LONG)1) << (format))) #ifndef M_PI #define M_PI (3.14159265358979323846f) #endif /*! * Inverse tangent function. */ // --- fixp_atan() ---- #define Q_ATANINP (25) // Input in q25, Output in q30 #define Q_ATANOUT (30) #define ATI_SF ((DFRACT_BITS-1)-Q_ATANINP) // 6 #define ATI_SCALE ((float)(1<> shift; residual &= ( (1< (1< (1<<(LD-1))) { FIXP_STP tmp; /* Cosine/Sine simetry for angles greater than PI/4 */ s = (1<