summaryrefslogtreecommitdiff
path: root/src/libfaad/fixed.h
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-12-16 18:59:50 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-12-16 18:59:50 +0000
commit94ef6649dd5f4e95337af00dcede2337ea7cfb49 (patch)
tree07d679ce92b4e4517815abc42394480eebf44904 /src/libfaad/fixed.h
parent48f4c5809db11a6df4a5e7285d5e60a2ed924e2a (diff)
downloadxine-lib-94ef6649dd5f4e95337af00dcede2337ea7cfb49.tar.gz
xine-lib-94ef6649dd5f4e95337af00dcede2337ea7cfb49.tar.bz2
updated libfaad
CVS patchset: 3560 CVS date: 2002/12/16 18:59:50
Diffstat (limited to 'src/libfaad/fixed.h')
-rw-r--r--src/libfaad/fixed.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/libfaad/fixed.h b/src/libfaad/fixed.h
new file mode 100644
index 000000000..ae5e5cc4a
--- /dev/null
+++ b/src/libfaad/fixed.h
@@ -0,0 +1,89 @@
+/*
+** FAAD - Freeware Advanced Audio Decoder
+** Copyright (C) 2002 M. Bakker
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program 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 General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+**
+** $Id: fixed.h,v 1.1 2002/12/16 19:00:06 miguelfreitas Exp $
+**/
+
+#ifndef __FIXED_H__
+#define __FIXED_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define COEF_BITS 28
+#define COEF_PRECISION (1 << COEF_BITS)
+#define REAL_BITS 7
+#define REAL_PRECISION (1 << REAL_BITS)
+
+
+typedef int32_t real_t;
+
+
+#define REAL_CONST(A) ((real_t)(A*(REAL_PRECISION)))
+#define COEF_CONST(A) ((real_t)(A*(COEF_PRECISION)))
+
+#if defined(_WIN32) && !defined(_WIN32_WCE)
+
+/* multiply real with real */
+static INLINE MUL(real_t A, real_t B)
+{
+ _asm {
+ mov eax,A
+ imul B
+ shrd eax,edx,REAL_BITS
+ }
+}
+
+/* multiply coef with coef */
+static INLINE MUL_C_C(real_t A, real_t B)
+{
+ _asm {
+ mov eax,A
+ imul B
+ shrd eax,edx,COEF_BITS
+ }
+}
+
+/* multiply real with coef */
+static INLINE MUL_R_C(real_t A, real_t B)
+{
+ _asm {
+ mov eax,A
+ imul B
+ shrd eax,edx,COEF_BITS
+ }
+}
+
+#else
+
+ /* multiply real with real */
+ #define MUL(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (REAL_BITS-1))) >> REAL_BITS)
+ /* multiply coef with coef */
+ #define MUL_C_C(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (COEF_BITS-1))) >> COEF_BITS)
+ /* multiply real with coef */
+ #define MUL_R_C(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (COEF_BITS-1))) >> COEF_BITS)
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif