summaryrefslogtreecommitdiff
path: root/gst/goom/mathtools.h
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2015-10-24 16:49:08 +0900
committerjk7744.park <jk7744.park@samsung.com>2015-10-24 16:49:08 +0900
commit32e864f0f32b7628d995e84d07646b01dc5bf2d5 (patch)
tree27f97eaa1ca7e171815e4f88b348448b05f02748 /gst/goom/mathtools.h
parent9093d777f57b3f1dc62010bb8e0c7ed3d72a76d2 (diff)
downloadgst-plugins-good-accepted/tizen_2.4_mobile.tar.gz
gst-plugins-good-accepted/tizen_2.4_mobile.tar.bz2
gst-plugins-good-accepted/tizen_2.4_mobile.zip
Diffstat (limited to 'gst/goom/mathtools.h')
-rw-r--r--gst/goom/mathtools.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/gst/goom/mathtools.h b/gst/goom/mathtools.h
new file mode 100644
index 0000000..5340dab
--- /dev/null
+++ b/gst/goom/mathtools.h
@@ -0,0 +1,58 @@
+/* Goom Project
+ * Copyright (C) <2003> Jean-Christophe Hoelt <jeko@free.fr>
+ *
+ * goom_core.c:Contains the core of goom's work.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+ #ifndef MATHTOOLS_H
+#define MATHTOOLS_H
+
+#include <glib.h>
+
+#define _double2fixmagic (68719476736.0*1.5)
+/* 2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor */
+#define _shiftamt 16
+/* 16.16 fixed point representation */
+
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define iexp_ 0
+#define iman_ 1
+#else
+#define iexp_ 1
+#define iman_ 0
+#endif /* BigEndian_ */
+
+/* TODO: this optimization is very efficient: put it again when all works
+#ifdef HAVE_MMX
+#define F2I(dbl,i) {double d = dbl + _double2fixmagic; i = ((int*)&d)[iman_] >> _shiftamt;}
+#else*/
+#define F2I(dbl,i) i=(int)dbl;
+/*#endif*/
+
+#if 0
+#define SINCOS(f,s,c) \
+ __asm__ __volatile__ ("fsincos" : "=t" (c), "=u" (s) : "0" (f))
+#else
+#define SINCOS(f,s,c) {s=sin(f);c=cos(f);}
+#endif
+
+extern float sin256[256];
+extern float cos256[256];
+
+#endif
+