diff options
Diffstat (limited to 'apps/codecs/libwma')
-rw-r--r-- | apps/codecs/libwma/SOURCES | 2 | ||||
-rw-r--r-- | apps/codecs/libwma/wmafixed.c | 25 | ||||
-rw-r--r-- | apps/codecs/libwma/wmafixed.h | 23 |
3 files changed, 25 insertions, 25 deletions
diff --git a/apps/codecs/libwma/SOURCES b/apps/codecs/libwma/SOURCES index 190e3a7ba3..65166464fd 100644 --- a/apps/codecs/libwma/SOURCES +++ b/apps/codecs/libwma/SOURCES | |||
@@ -1,3 +1,3 @@ | |||
1 | wmadeci.c | 1 | wmadeci.c |
2 | common.c | 2 | common.c |
3 | wmafixed.c \ No newline at end of file | 3 | wmafixed.c |
diff --git a/apps/codecs/libwma/wmafixed.c b/apps/codecs/libwma/wmafixed.c index 45a827af15..7c38009754 100644 --- a/apps/codecs/libwma/wmafixed.c +++ b/apps/codecs/libwma/wmafixed.c | |||
@@ -53,30 +53,8 @@ fixed64 Fixed32To64(fixed32 x) | |||
53 | /*Sign-15.16 format */ | 53 | /*Sign-15.16 format */ |
54 | #ifdef CPU_ARM | 54 | #ifdef CPU_ARM |
55 | /* these are defines in wmafixed.h*/ | 55 | /* these are defines in wmafixed.h*/ |
56 | |||
57 | |||
58 | #elif defined(CPU_COLDFIRE) | 56 | #elif defined(CPU_COLDFIRE) |
59 | inline int32_t fixmul32(int32_t x, int32_t y) | 57 | |
60 | { | ||
61 | #if PRECISION != 16 | ||
62 | #warning Coldfire fixmul32() only works for PRECISION == 16 | ||
63 | #endif | ||
64 | int32_t t1; | ||
65 | asm ( | ||
66 | "mac.l %[x], %[y], %%acc0 \n" /* multiply */ | ||
67 | "mulu.l %[y], %[x] \n" /* get lower half, avoid emac stall */ | ||
68 | "movclr.l %%acc0, %[t1] \n" /* get higher half */ | ||
69 | "lsr.l #1, %[t1] \n" | ||
70 | "move.w %[t1], %[x] \n" | ||
71 | "swap %[x] \n" | ||
72 | : /* outputs */ | ||
73 | [t1]"=&d"(t1), | ||
74 | [x] "+d" (x) | ||
75 | : /* inputs */ | ||
76 | [y] "d" (y) | ||
77 | ); | ||
78 | return x; | ||
79 | } | ||
80 | #else | 58 | #else |
81 | 59 | ||
82 | fixed32 fixmul32(fixed32 x, fixed32 y) | 60 | fixed32 fixmul32(fixed32 x, fixed32 y) |
@@ -91,7 +69,6 @@ fixed32 fixmul32(fixed32 x, fixed32 y) | |||
91 | } | 69 | } |
92 | 70 | ||
93 | 71 | ||
94 | |||
95 | /* | 72 | /* |
96 | Special fixmul32 that does a 16.16 x 1.31 multiply that returns a 16.16 value. | 73 | Special fixmul32 that does a 16.16 x 1.31 multiply that returns a 16.16 value. |
97 | this is needed because the fft constants are all normalized to be less then 1 | 74 | this is needed because the fft constants are all normalized to be less then 1 |
diff --git a/apps/codecs/libwma/wmafixed.h b/apps/codecs/libwma/wmafixed.h index 878601d799..887973a78a 100644 --- a/apps/codecs/libwma/wmafixed.h +++ b/apps/codecs/libwma/wmafixed.h | |||
@@ -85,7 +85,30 @@ long fsincos(unsigned long phase, fixed32 *cos); | |||
85 | }) | 85 | }) |
86 | 86 | ||
87 | 87 | ||
88 | #elif defined(CPU_COLDFIRE) | ||
89 | static inline int32_t fixmul32(int32_t x, int32_t y) | ||
90 | { | ||
91 | #if PRECISION != 16 | ||
92 | #warning Coldfire fixmul32() only works for PRECISION == 16 | ||
93 | #endif | ||
94 | int32_t t1; | ||
95 | asm ( | ||
96 | "mac.l %[x], %[y], %%acc0 \n" /* multiply */ | ||
97 | "mulu.l %[y], %[x] \n" /* get lower half, avoid emac stall */ | ||
98 | "movclr.l %%acc0, %[t1] \n" /* get higher half */ | ||
99 | "lsr.l #1, %[t1] \n" | ||
100 | "move.w %[t1], %[x] \n" | ||
101 | "swap %[x] \n" | ||
102 | : /* outputs */ | ||
103 | [t1]"=&d"(t1), | ||
104 | [x] "+d" (x) | ||
105 | : /* inputs */ | ||
106 | [y] "d" (y) | ||
107 | ); | ||
108 | return x; | ||
109 | } | ||
88 | #else | 110 | #else |
111 | |||
89 | fixed32 fixmul32(fixed32 x, fixed32 y); | 112 | fixed32 fixmul32(fixed32 x, fixed32 y); |
90 | fixed32 fixmul32b(fixed32 x, fixed32 y); | 113 | fixed32 fixmul32b(fixed32 x, fixed32 y); |
91 | #endif | 114 | #endif |