shithub: opus

Download patch

ref: 2040606f4a1d3b230bdf00e1b7e4427df8dcdd3b
parent: 006273c59f35ca10f1ab9b4cad36fdd7550b754b
author: Timothy B. Terriberry <[email protected]>
date: Wed May 22 04:52:00 EDT 2013

Minor ARMv5E cleanups.

Missed the armv5e extension on a couple of functions.

--- a/celt/arm/fixed_armv5e.h
+++ b/celt/arm/fixed_armv5e.h
@@ -84,7 +84,8 @@
 
 /** 16x16 multiply-add where the result fits in 32 bits */
 #undef MAC16_16
-static inline opus_val32 MAC16_16(opus_val32 c, opus_val16 a, opus_val16 b)
+static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
+ opus_val16 b)
 {
   int res;
   __asm__(
@@ -95,11 +96,11 @@
   );
   return res;
 }
-#define MAC16_16(c, a, b) (MAC16_16(c, a, b))
+#define MAC16_16(c, a, b) (MAC16_16_armv5e(c, a, b))
 
 /** 16x16 multiplication where the result fits in 32 bits */
 #undef MULT16_16
-static inline opus_val32 MULT16_16(opus_val16 a, opus_val16 b)
+static inline opus_val32 MULT16_16_armv5e(opus_val16 a, opus_val16 b)
 {
   int res;
   __asm__(
@@ -110,6 +111,6 @@
   );
   return res;
 }
-#define MULT16_16(a, b) (MULT16_16(a, b))
+#define MULT16_16(a, b) (MULT16_16_armv5e(a, b))
 
 #endif
--- a/celt/fixed_generic.h
+++ b/celt/fixed_generic.h
@@ -108,7 +108,9 @@
 
 /** 16x16 multiply-add where the result fits in 32 bits */
 #define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b))))
-/** 16x32 multiply-add, followed by a 15-bit shift right. Results fits in 32 bits */
+/** 16x32 multiply, followed by a 15-bit shift right and 32-bit add.
+    b must fit in 31 bits.
+    Result fits in 32 bits. */
 #define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)))
 
 #define MULT16_16_Q11_32(a,b) (SHR(MULT16_16((a),(b)),11))