summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/libwma/wmadeci.c4
-rw-r--r--apps/codecs/libwma/wmafixed.c4
-rw-r--r--apps/codecs/libwma/wmafixed.h15
3 files changed, 19 insertions, 4 deletions
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index bb9b96abe0..cd01c030c8 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -696,14 +696,14 @@ void ff_mdct_end(MDCTContext *s)
696static void vector_fmul_add_add(fixed32 *dst, const fixed32 *src0, const fixed32 *src1, const fixed32 *src2, int src3, int len, int step){ 696static void vector_fmul_add_add(fixed32 *dst, const fixed32 *src0, const fixed32 *src1, const fixed32 *src2, int src3, int len, int step){
697 int i; 697 int i;
698 for(i=0; i<len; i++) 698 for(i=0; i<len; i++)
699 dst[i*step] = fixmul32(src0[i], src1[i]) + src2[i] + src3; 699 dst[i*step] = fixmul32b(src0[i], src1[i]) + src2[i] + src3;
700} 700}
701 701
702static void vector_fmul_reverse(fixed32 *dst, const fixed32 *src0, const fixed32 *src1, int len){ 702static void vector_fmul_reverse(fixed32 *dst, const fixed32 *src0, const fixed32 *src1, int len){
703 int i; 703 int i;
704 src1 += len-1; 704 src1 += len-1;
705 for(i=0; i<len; i++) 705 for(i=0; i<len; i++)
706 dst[i] = fixmul32(src0[i], src1[-i]); 706 dst[i] = fixmul32b(src0[i], src1[-i]);
707} 707}
708 708
709/** 709/**
diff --git a/apps/codecs/libwma/wmafixed.c b/apps/codecs/libwma/wmafixed.c
index 3a902dd9ef..7b08689282 100644
--- a/apps/codecs/libwma/wmafixed.c
+++ b/apps/codecs/libwma/wmafixed.c
@@ -275,7 +275,7 @@ long fsincos(unsigned long phase, fixed32 *cos)
275 275
276*/ 276*/
277 277
278#if 0 278
279fixed32 fixsin32(fixed32 x) 279fixed32 fixsin32(fixed32 x)
280{ 280{
281 281
@@ -326,4 +326,4 @@ fixed32 fixcos32(fixed32 x)
326{ 326{
327 return fixsin32(x - (M_PI_F>>1))*-1; 327 return fixsin32(x - (M_PI_F>>1))*-1;
328} 328}
329#endif 329
diff --git a/apps/codecs/libwma/wmafixed.h b/apps/codecs/libwma/wmafixed.h
index 99ddec759e..da0637fb68 100644
--- a/apps/codecs/libwma/wmafixed.h
+++ b/apps/codecs/libwma/wmafixed.h
@@ -61,6 +61,21 @@ long fsincos(unsigned long phase, fixed32 *cos);
61 __result; \ 61 __result; \
62 }) 62 })
63 63
64
65 #define fixmul32b(x, y) \
66 ({ int32_t __hi; \
67 uint32_t __lo; \
68 int32_t __result; \
69 asm ("smull %0, %1, %3, %4\n\t" \
70 "movs %0, %0, lsr %5\n\t" \
71 "adc %2, %0, %1, lsl %6" \
72 : "=&r" (__lo), "=&r" (__hi), "=r" (__result) \
73 : "%r" (x), "r" (y), \
74 "M" (31), "M" (32 - 31) \
75 : "cc"); \
76 __result; \
77 })
78
64#elif defined(CPU_COLDFIRE) 79#elif defined(CPU_COLDFIRE)
65static inline int32_t fixmul32(int32_t x, int32_t y) 80static inline int32_t fixmul32(int32_t x, int32_t y)
66{ 81{