diff options
Diffstat (limited to 'src/libfaad/fixed.h')
-rw-r--r-- | src/libfaad/fixed.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/libfaad/fixed.h b/src/libfaad/fixed.h index c58ee26cb..531583772 100644 --- a/src/libfaad/fixed.h +++ b/src/libfaad/fixed.h @@ -1,6 +1,6 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding -** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com +** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com ** ** 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 @@ -19,10 +19,13 @@ ** Any non-GPL usage of this software or parts of this software is strictly ** forbidden. ** +** The "appropriate copyright message" mentioned in section 2c of the GPLv2 +** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com" +** ** Commercial non-GPL licensing of this software is possible. -** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. +** For more info contact Nero AG through Mpeg4AAClicense@nero.com. ** -** $Id: fixed.h,v 1.7 2005/10/29 23:57:06 tmmm Exp $ +** $Id: fixed.h,v 1.32 2007/11/01 12:33:30 menno Exp $ **/ #ifndef __FIXED_H__ @@ -36,6 +39,7 @@ extern "C" { #include <cmnintrin.h> #endif + #define COEF_BITS 28 #define COEF_PRECISION (1 << COEF_BITS) #define REAL_BITS 14 // MAXIMUM OF 14 FOR FIXED POINT SBR @@ -240,9 +244,27 @@ static INLINE void ComplexMult(real_t *y1, real_t *y2, return _MulHigh(A,B) << (32-FRAC_BITS); } #else +#ifdef __BFIN__ +#define _MulHigh(X,Y) ({ int __xxo; \ + asm ( \ + "a1 = %2.H * %1.L (IS,M);\n\t" \ + "a0 = %1.H * %2.H, a1+= %1.H * %2.L (IS,M);\n\t"\ + "a1 = a1 >>> 16;\n\t" \ + "%0 = (a0 += a1);\n\t" \ + : "=d" (__xxo) : "d" (X), "d" (Y) : "A0","A1"); __xxo; }) + +#define MUL_F(X,Y) ({ int __xxo; \ + asm ( \ + "a1 = %2.H * %1.L (M);\n\t" \ + "a0 = %1.H * %2.H, a1+= %1.H * %2.L (M);\n\t" \ + "a1 = a1 >>> 16;\n\t" \ + "%0 = (a0 += a1);\n\t" \ + : "=d" (__xxo) : "d" (X), "d" (Y) : "A0","A1"); __xxo; }) +#else #define _MulHigh(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (FRAC_SIZE-1))) >> FRAC_SIZE) #define MUL_F(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (FRAC_BITS-1))) >> FRAC_BITS) #endif +#endif #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS) #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6) #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23) |