diff options
author | Dave Hooper <dave@beermex.com> | 2010-02-17 00:49:53 +0000 |
---|---|---|
committer | Dave Hooper <dave@beermex.com> | 2010-02-17 00:49:53 +0000 |
commit | 42774d3128b91d5a37344cb40d56d3c4d147e5f2 (patch) | |
tree | bf336b407992ec9a5e454556f3351e3f8a0d10de /apps/codecs/libwma/wmafixed.h | |
parent | 62257ebc38bc0a3095b25dd0f58c4c8215edf602 (diff) | |
download | rockbox-42774d3128b91d5a37344cb40d56d3c4d147e5f2.tar.gz rockbox-42774d3128b91d5a37344cb40d56d3c4d147e5f2.zip |
Merge from branches/mdctexp - faster ifft+imdct in codec lib
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24712 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwma/wmafixed.h')
-rw-r--r-- | apps/codecs/libwma/wmafixed.h | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/apps/codecs/libwma/wmafixed.h b/apps/codecs/libwma/wmafixed.h index 6b5137e044..0ecdc5cfbc 100644 --- a/apps/codecs/libwma/wmafixed.h +++ b/apps/codecs/libwma/wmafixed.h | |||
@@ -52,10 +52,10 @@ fixed64 fixdiv64(fixed64 x, fixed64 y); | |||
52 | fixed32 fixsqrt32(fixed32 x); | 52 | fixed32 fixsqrt32(fixed32 x); |
53 | long fsincos(unsigned long phase, fixed32 *cos); | 53 | long fsincos(unsigned long phase, fixed32 *cos); |
54 | 54 | ||
55 | |||
55 | #ifdef CPU_ARM | 56 | #ifdef CPU_ARM |
56 | 57 | ||
57 | /*Sign-15.16 format */ | 58 | /*Sign-15.16 format */ |
58 | |||
59 | #define fixmul32(x, y) \ | 59 | #define fixmul32(x, y) \ |
60 | ({ int32_t __hi; \ | 60 | ({ int32_t __hi; \ |
61 | uint32_t __lo; \ | 61 | uint32_t __lo; \ |
@@ -70,18 +70,6 @@ long fsincos(unsigned long phase, fixed32 *cos); | |||
70 | __result; \ | 70 | __result; \ |
71 | }) | 71 | }) |
72 | 72 | ||
73 | #define fixmul32b(x, y) \ | ||
74 | ({ int32_t __hi; \ | ||
75 | uint32_t __lo; \ | ||
76 | int32_t __result; \ | ||
77 | asm ("smull %0, %1, %3, %4\n\t" \ | ||
78 | "movs %2, %1, lsl #1" \ | ||
79 | : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \ | ||
80 | : "%r" (x), "r" (y) \ | ||
81 | : "cc"); \ | ||
82 | __result; \ | ||
83 | }) | ||
84 | |||
85 | #elif defined(CPU_COLDFIRE) | 73 | #elif defined(CPU_COLDFIRE) |
86 | 74 | ||
87 | static inline int32_t fixmul32(int32_t x, int32_t y) | 75 | static inline int32_t fixmul32(int32_t x, int32_t y) |
@@ -91,9 +79,9 @@ static inline int32_t fixmul32(int32_t x, int32_t y) | |||
91 | #endif | 79 | #endif |
92 | int32_t t1; | 80 | int32_t t1; |
93 | asm ( | 81 | asm ( |
94 | "mac.l %[x], %[y], %%acc0 \n" /* multiply */ | 82 | "mac.l %[x], %[y], %%acc0 \n" // multiply |
95 | "mulu.l %[y], %[x] \n" /* get lower half, avoid emac stall */ | 83 | "mulu.l %[y], %[x] \n" // get lower half, avoid emac stall |
96 | "movclr.l %%acc0, %[t1] \n" /* get higher half */ | 84 | "movclr.l %%acc0, %[t1] \n" // get higher half |
97 | "lsr.l #1, %[t1] \n" | 85 | "lsr.l #1, %[t1] \n" |
98 | "move.w %[t1], %[x] \n" | 86 | "move.w %[t1], %[x] \n" |
99 | "swap %[x] \n" | 87 | "swap %[x] \n" |
@@ -103,17 +91,6 @@ static inline int32_t fixmul32(int32_t x, int32_t y) | |||
103 | return x; | 91 | return x; |
104 | } | 92 | } |
105 | 93 | ||
106 | static inline int32_t fixmul32b(int32_t x, int32_t y) | ||
107 | { | ||
108 | asm ( | ||
109 | "mac.l %[x], %[y], %%acc0 \n" /* multiply */ | ||
110 | "movclr.l %%acc0, %[x] \n" /* get higher half */ | ||
111 | : [x] "+d" (x) | ||
112 | : [y] "d" (y) | ||
113 | ); | ||
114 | return x; | ||
115 | } | ||
116 | |||
117 | #else | 94 | #else |
118 | 95 | ||
119 | static inline fixed32 fixmul32(fixed32 x, fixed32 y) | 96 | static inline fixed32 fixmul32(fixed32 x, fixed32 y) |
@@ -127,17 +104,7 @@ static inline fixed32 fixmul32(fixed32 x, fixed32 y) | |||
127 | return (fixed32)temp; | 104 | return (fixed32)temp; |
128 | } | 105 | } |
129 | 106 | ||
130 | static inline fixed32 fixmul32b(fixed32 x, fixed32 y) | ||
131 | { | ||
132 | fixed64 temp; | ||
133 | |||
134 | temp = x; | ||
135 | temp *= y; | ||
136 | |||
137 | temp >>= 31; //16+31-16 = 31 bits | ||
138 | |||
139 | return (fixed32)temp; | ||
140 | } | ||
141 | |||
142 | #endif | 107 | #endif |
143 | 108 | ||
109 | |||
110 | /* get fixmul32b from codeclib */ | ||