OLD | NEW |
1 /* Copyright (c) 2003-2008 Jean-Marc Valin | 1 /* Copyright (c) 2003-2008 Jean-Marc Valin |
2 Copyright (c) 2007-2008 CSIRO | 2 Copyright (c) 2007-2008 CSIRO |
3 Copyright (c) 2007-2009 Xiph.Org Foundation | 3 Copyright (c) 2007-2009 Xiph.Org Foundation |
4 Written by Jean-Marc Valin */ | 4 Written by Jean-Marc Valin */ |
5 /** | 5 /** |
6 @file arch.h | 6 @file arch.h |
7 @brief Various architecture definitions for CELT | 7 @brief Various architecture definitions for CELT |
8 */ | 8 */ |
9 /* | 9 /* |
10 Redistribution and use in source and binary forms, with or without | 10 Redistribution and use in source and binary forms, with or without |
(...skipping 17 matching lines...) Expand all Loading... |
28 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | 28 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
29 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 29 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
30 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 30 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
32 */ | 32 */ |
33 | 33 |
34 #ifndef ARCH_H | 34 #ifndef ARCH_H |
35 #define ARCH_H | 35 #define ARCH_H |
36 | 36 |
37 #include "opus_types.h" | 37 #include "opus_types.h" |
| 38 #include "opus_defines.h" |
38 | 39 |
39 # if !defined(__GNUC_PREREQ) | 40 # if !defined(__GNUC_PREREQ) |
40 # if defined(__GNUC__)&&defined(__GNUC_MINOR__) | 41 # if defined(__GNUC__)&&defined(__GNUC_MINOR__) |
41 # define __GNUC_PREREQ(_maj,_min) \ | 42 # define __GNUC_PREREQ(_maj,_min) \ |
42 ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) | 43 ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min)) |
43 # else | 44 # else |
44 # define __GNUC_PREREQ(_maj,_min) 0 | 45 # define __GNUC_PREREQ(_maj,_min) 0 |
45 # endif | 46 # endif |
46 # endif | 47 # endif |
47 | 48 |
48 #define CELT_SIG_SCALE 32768.f | 49 #define CELT_SIG_SCALE 32768.f |
49 | 50 |
50 #define celt_fatal(str) _celt_fatal(str, __FILE__, __LINE__); | 51 #define celt_fatal(str) _celt_fatal(str, __FILE__, __LINE__); |
51 #ifdef ENABLE_ASSERTIONS | 52 #ifdef ENABLE_ASSERTIONS |
52 #include <stdio.h> | 53 #include <stdio.h> |
53 #include <stdlib.h> | 54 #include <stdlib.h> |
54 #ifdef __GNUC__ | 55 #ifdef __GNUC__ |
55 __attribute__((noreturn)) | 56 __attribute__((noreturn)) |
56 #endif | 57 #endif |
57 static inline void _celt_fatal(const char *str, const char *file, int line) | 58 static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line) |
58 { | 59 { |
59 fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, s
tr); | 60 fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, s
tr); |
60 abort(); | 61 abort(); |
61 } | 62 } |
62 #define celt_assert(cond) {if (!(cond)) {celt_fatal("assertion failed: " #cond);
}} | 63 #define celt_assert(cond) {if (!(cond)) {celt_fatal("assertion failed: " #cond);
}} |
63 #define celt_assert2(cond, message) {if (!(cond)) {celt_fatal("assertion failed:
" #cond "\n" message);}} | 64 #define celt_assert2(cond, message) {if (!(cond)) {celt_fatal("assertion failed:
" #cond "\n" message);}} |
64 #else | 65 #else |
65 #define celt_assert(cond) | 66 #define celt_assert(cond) |
66 #define celt_assert2(cond, message) | 67 #define celt_assert2(cond, message) |
67 #endif | 68 #endif |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 107 |
107 #define SCALEIN(a) (a) | 108 #define SCALEIN(a) (a) |
108 #define SCALEOUT(a) (a) | 109 #define SCALEOUT(a) (a) |
109 | 110 |
110 #ifdef FIXED_DEBUG | 111 #ifdef FIXED_DEBUG |
111 #include "fixed_debug.h" | 112 #include "fixed_debug.h" |
112 #else | 113 #else |
113 | 114 |
114 #include "fixed_generic.h" | 115 #include "fixed_generic.h" |
115 | 116 |
116 #ifdef ARMv5E_ASM | 117 #ifdef OPUS_ARM_INLINE_EDSP |
117 #include "arm/fixed_armv5e.h" | 118 #include "arm/fixed_armv5e.h" |
118 #elif defined (ARMv4_ASM) | 119 #elif defined (OPUS_ARM_INLINE_ASM) |
119 #include "arm/fixed_armv4.h" | 120 #include "arm/fixed_armv4.h" |
120 #elif defined (BFIN_ASM) | 121 #elif defined (BFIN_ASM) |
121 #include "fixed_bfin.h" | 122 #include "fixed_bfin.h" |
122 #elif defined (TI_C5X_ASM) | 123 #elif defined (TI_C5X_ASM) |
123 #include "fixed_c5x.h" | 124 #include "fixed_c5x.h" |
124 #elif defined (TI_C6X_ASM) | 125 #elif defined (TI_C6X_ASM) |
125 #include "fixed_c6x.h" | 126 #include "fixed_c6x.h" |
126 #endif | 127 #endif |
127 | 128 |
128 #endif | 129 #endif |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 205 |
205 #ifndef GLOBAL_STACK_SIZE | 206 #ifndef GLOBAL_STACK_SIZE |
206 #ifdef FIXED_POINT | 207 #ifdef FIXED_POINT |
207 #define GLOBAL_STACK_SIZE 100000 | 208 #define GLOBAL_STACK_SIZE 100000 |
208 #else | 209 #else |
209 #define GLOBAL_STACK_SIZE 100000 | 210 #define GLOBAL_STACK_SIZE 100000 |
210 #endif | 211 #endif |
211 #endif | 212 #endif |
212 | 213 |
213 #endif /* ARCH_H */ | 214 #endif /* ARCH_H */ |
OLD | NEW |