MythTV  master
mathtools.h
Go to the documentation of this file.
1 #ifndef MATHTOOLS_H
2 #define MATHTOOLS_H
3 
4 //#define _double2fixmagic (68719476736.0*1.5)
5 //2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor
6 //#define _shiftamt 16
7 //16.16 fixed point representation,
8 
9 #ifdef BigEndian_
10 #define iexp_ 0
11 #define iman_ 1
12 #else
13 #define iexp_ 1
14 #define iman_ 0
15 #endif //BigEndian_
16 
17 //#ifdef HAVE_MMX
18 //#define F2I(dbl,i)
19 //{double d = dbl + _double2fixmagic; i = ((int*)&d)[iman_] >> _shiftamt; }
20 //#else
21 #define F2I(dbl,i) i=(int)(dbl);
22 //#endif
23 
24 #if 0
25 #define SINCOS(f,s,c) \
26  __asm__ __volatile__ ("fsincos" : "=t" (c), "=u" (s) : "0" (f))
27 #else
28 #define SINCOS(f,s,c) {(s)=sinf(f);(c)=cosf(f);}
29 #endif
30 
31 #endif // MATHTOOLS_H