diff options
Diffstat (limited to 'apps/codecs/Tremor/misc.h')
-rw-r--r-- | apps/codecs/Tremor/misc.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/apps/codecs/Tremor/misc.h b/apps/codecs/Tremor/misc.h index ed7617d0e0..dc2dccf116 100644 --- a/apps/codecs/Tremor/misc.h +++ b/apps/codecs/Tremor/misc.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "os_types.h" | 23 | #include "os_types.h" |
24 | 24 | ||
25 | #include "asm_arm.h" | 25 | #include "asm_arm.h" |
26 | #include "asm_mcf5249.h" | ||
26 | 27 | ||
27 | 28 | ||
28 | /* Some prototypes that were not defined elsewhere */ | 29 | /* Some prototypes that were not defined elsewhere */ |
@@ -36,7 +37,6 @@ void* alloca(size_t size); | |||
36 | 37 | ||
37 | #ifndef _LOW_ACCURACY_ | 38 | #ifndef _LOW_ACCURACY_ |
38 | /* 64 bit multiply */ | 39 | /* 64 bit multiply */ |
39 | |||
40 | //#include <sys/types.h> | 40 | //#include <sys/types.h> |
41 | 41 | ||
42 | #if BYTE_ORDER==LITTLE_ENDIAN | 42 | #if BYTE_ORDER==LITTLE_ENDIAN |
@@ -47,9 +47,7 @@ union magic { | |||
47 | } halves; | 47 | } halves; |
48 | ogg_int64_t whole; | 48 | ogg_int64_t whole; |
49 | }; | 49 | }; |
50 | #endif | 50 | #elif BYTE_ORDER==BIG_ENDIAN |
51 | |||
52 | #if BYTE_ORDER==BIG_ENDIAN | ||
53 | union magic { | 51 | union magic { |
54 | struct { | 52 | struct { |
55 | ogg_int32_t hi; | 53 | ogg_int32_t hi; |
@@ -64,7 +62,6 @@ static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { | |||
64 | magic.whole = (ogg_int64_t)x * y; | 62 | magic.whole = (ogg_int64_t)x * y; |
65 | return magic.halves.hi; | 63 | return magic.halves.hi; |
66 | } | 64 | } |
67 | |||
68 | static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { | 65 | static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { |
69 | return MULT32(x,y)<<1; | 66 | return MULT32(x,y)<<1; |
70 | } | 67 | } |
@@ -102,7 +99,6 @@ static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { | |||
102 | static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { | 99 | static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { |
103 | return (x >> 6) * y; /* y preshifted >>9 */ | 100 | return (x >> 6) * y; /* y preshifted >>9 */ |
104 | } | 101 | } |
105 | |||
106 | #endif | 102 | #endif |
107 | 103 | ||
108 | /* | 104 | /* |
@@ -122,11 +118,15 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { | |||
122 | * macros. | 118 | * macros. |
123 | */ | 119 | */ |
124 | 120 | ||
121 | /* replaced XPROD32 with a macro to avoid memory reference | ||
122 | _x, _y are the results (must be l-values) */ | ||
123 | #define XPROD32(_a, _b, _t, _v, _x, _y) \ | ||
124 | { (_x)=MULT32(_a,_t)+MULT32(_b,_v); \ | ||
125 | (_y)=MULT32(_b,_t)-MULT32(_a,_v); } | ||
126 | |||
127 | |||
125 | #ifdef __i386__ | 128 | #ifdef __i386__ |
126 | 129 | ||
127 | #define XPROD32(_a, _b, _t, _v, _x, _y) \ | ||
128 | { *(_x)=MULT32(_a,_t)+MULT32(_b,_v); \ | ||
129 | *(_y)=MULT32(_b,_t)-MULT32(_a,_v); } | ||
130 | #define XPROD31(_a, _b, _t, _v, _x, _y) \ | 130 | #define XPROD31(_a, _b, _t, _v, _x, _y) \ |
131 | { *(_x)=MULT31(_a,_t)+MULT31(_b,_v); \ | 131 | { *(_x)=MULT31(_a,_t)+MULT31(_b,_v); \ |
132 | *(_y)=MULT31(_b,_t)-MULT31(_a,_v); } | 132 | *(_y)=MULT31(_b,_t)-MULT31(_a,_v); } |
@@ -136,14 +136,6 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { | |||
136 | 136 | ||
137 | #else | 137 | #else |
138 | 138 | ||
139 | static inline void XPROD32(ogg_int32_t a, ogg_int32_t b, | ||
140 | ogg_int32_t t, ogg_int32_t v, | ||
141 | ogg_int32_t *x, ogg_int32_t *y) | ||
142 | { | ||
143 | *x = MULT32(a, t) + MULT32(b, v); | ||
144 | *y = MULT32(b, t) - MULT32(a, v); | ||
145 | } | ||
146 | |||
147 | static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, | 139 | static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, |
148 | ogg_int32_t t, ogg_int32_t v, | 140 | ogg_int32_t t, ogg_int32_t v, |
149 | ogg_int32_t *x, ogg_int32_t *y) | 141 | ogg_int32_t *x, ogg_int32_t *y) |
@@ -159,9 +151,7 @@ static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b, | |||
159 | *x = MULT31(a, t) - MULT31(b, v); | 151 | *x = MULT31(a, t) - MULT31(b, v); |
160 | *y = MULT31(b, t) + MULT31(a, v); | 152 | *y = MULT31(b, t) + MULT31(a, v); |
161 | } | 153 | } |
162 | |||
163 | #endif | 154 | #endif |
164 | |||
165 | #endif | 155 | #endif |
166 | 156 | ||
167 | #ifndef _V_CLIP_MATH | 157 | #ifndef _V_CLIP_MATH |
@@ -245,4 +235,3 @@ static inline ogg_int32_t VFLOAT_ADD(ogg_int32_t a,ogg_int32_t ap, | |||
245 | 235 | ||
246 | 236 | ||
247 | 237 | ||
248 | |||