summaryrefslogtreecommitdiff
path: root/common_audio
diff options
context:
space:
mode:
authorbjornv@webrtc.org <bjornv@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-08-12 10:54:50 +0000
committerbjornv@webrtc.org <bjornv@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-08-12 10:54:50 +0000
commitb5cd1aa773e4e5bc6ab84ded200ff3a618086032 (patch)
tree34dcb8970b94f8134a06325319e087fc9507986e /common_audio
parent3022feab8961e5fc4842f7e886662bdc4444ce6c (diff)
downloadwebrtc-b5cd1aa773e4e5bc6ab84ded200ff3a618086032.tar.gz
common_audio/signal_processing: Removes macro WEBRTC_SPL_MUL_32_32_RSFT32
The macro is only used at four places in iSAC fixed point and the macro have been replaced at those places. In addition, it is used in a unit test, but throws a warning treated as error (issue3674). The macro has both MIPS and armv7 optimizations. Removing them impacts only MIPS platforms without DSP ASE. This may cause a very small increase in complexity when using iSAC fix. The armv7 optimizations are not used anywhere, since specific ones are used inline in iSAC fix. BUG=3348,3353,3674 TESTED=locally and trybots R=ljubomir.papuga@gmail.com, tina.legrand@webrtc.org, turaj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/16299004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6871 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'common_audio')
-rw-r--r--common_audio/signal_processing/include/signal_processing_library.h3
-rw-r--r--common_audio/signal_processing/include/spl_inl_armv7.h19
-rw-r--r--common_audio/signal_processing/include/spl_inl_mips.h44
-rw-r--r--common_audio/signal_processing/signal_processing_unittest.cc9
4 files changed, 0 insertions, 75 deletions
diff --git a/common_audio/signal_processing/include/signal_processing_library.h b/common_audio/signal_processing/include/signal_processing_library.h
index a658645d..36ee34f9 100644
--- a/common_audio/signal_processing/include/signal_processing_library.h
+++ b/common_audio/signal_processing/include/signal_processing_library.h
@@ -75,9 +75,6 @@
#define WEBRTC_SPL_MUL_16_32_RSFT16(a, b) \
(WEBRTC_SPL_MUL_16_16(a, b >> 16) \
+ ((WEBRTC_SPL_MUL_16_16(a, (b & 0xffff) >> 1) + 0x4000) >> 15))
-#define WEBRTC_SPL_MUL_32_32_RSFT32(a32a, a32b, b32) \
- ((int32_t)(WEBRTC_SPL_MUL_16_32_RSFT16(a32a, b32) \
- + (WEBRTC_SPL_MUL_16_32_RSFT16(a32b, b32) >> 16)))
#endif
#endif
diff --git a/common_audio/signal_processing/include/spl_inl_armv7.h b/common_audio/signal_processing/include/spl_inl_armv7.h
index a437a555..b52ebc53 100644
--- a/common_audio/signal_processing/include/spl_inl_armv7.h
+++ b/common_audio/signal_processing/include/spl_inl_armv7.h
@@ -30,25 +30,6 @@ static __inline int32_t WEBRTC_SPL_MUL_16_32_RSFT16(int16_t a, int32_t b) {
return tmp;
}
-/* This function produces result that is not bit exact with that by the generic
- * C version in some cases, although the former is at least as accurate as the
- * later.
- */
-static __inline int32_t WEBRTC_SPL_MUL_32_32_RSFT32(int16_t a,
- int16_t b,
- int32_t c) {
- int32_t tmp = 0;
- __asm __volatile (
- "pkhbt %[tmp], %[b], %[a], lsl #16\n\t"
- "smmulr %[tmp], %[tmp], %[c]\n\t"
- :[tmp]"+&r"(tmp)
- :[a]"r"(a),
- [b]"r"(b),
- [c]"r"(c)
- );
- return tmp;
-}
-
static __inline int32_t WEBRTC_SPL_MUL_32_32_RSFT32BI(int32_t a, int32_t b) {
int32_t tmp = 0;
__asm volatile ("smmulr %0, %1, %2":"=r"(tmp):"r"(a), "r"(b));
diff --git a/common_audio/signal_processing/include/spl_inl_mips.h b/common_audio/signal_processing/include/spl_inl_mips.h
index e1737777..f29f701d 100644
--- a/common_audio/signal_processing/include/spl_inl_mips.h
+++ b/common_audio/signal_processing/include/spl_inl_mips.h
@@ -78,50 +78,6 @@ static __inline int32_t WEBRTC_SPL_MUL_32_32_RSFT32BI(int32_t a,
return tmp;
}
-static __inline int32_t WEBRTC_SPL_MUL_32_32_RSFT32(int16_t a,
- int16_t b,
- int32_t c) {
- int32_t tmp1 = 0, tmp2 = 0, tmp3 = 0, tmp4 = 0;
-
- __asm __volatile(
- "sra %[tmp1], %[c], 16 \n\t"
- "andi %[tmp2], %[c], 0xFFFF \n\t"
-#if defined(MIPS32_R2_LE)
- "seh %[a], %[a] \n\t"
- "seh %[b], %[b] \n\t"
-#else
- "sll %[a], %[a], 16 \n\t"
- "sra %[a], %[a], 16 \n\t"
- "sll %[b], %[b], 16 \n\t"
- "sra %[b], %[b], 16 \n\t"
-#endif
- "sra %[tmp2], %[tmp2], 1 \n\t"
- "mul %[tmp3], %[a], %[tmp2] \n\t"
- "mul %[tmp4], %[b], %[tmp2] \n\t"
- "mul %[tmp2], %[a], %[tmp1] \n\t"
- "mul %[tmp1], %[b], %[tmp1] \n\t"
-#if defined(MIPS_DSP_R1_LE)
- "shra_r.w %[tmp3], %[tmp3], 15 \n\t"
- "shra_r.w %[tmp4], %[tmp4], 15 \n\t"
-#else
- "addiu %[tmp3], %[tmp3], 0x4000 \n\t"
- "sra %[tmp3], %[tmp3], 15 \n\t"
- "addiu %[tmp4], %[tmp4], 0x4000 \n\t"
- "sra %[tmp4], %[tmp4], 15 \n\t"
-#endif
- "addu %[tmp3], %[tmp3], %[tmp2] \n\t"
- "addu %[tmp4], %[tmp4], %[tmp1] \n\t"
- "sra %[tmp4], %[tmp4], 16 \n\t"
- "addu %[tmp1], %[tmp3], %[tmp4] \n\t"
- : [tmp1] "=&r" (tmp1), [tmp2] "=&r" (tmp2),
- [tmp3] "=&r" (tmp3), [tmp4] "=&r" (tmp4),
- [a] "+r" (a), [b] "+r" (b)
- : [c] "r" (c)
- : "hi", "lo"
- );
- return tmp1;
-}
-
#if defined(MIPS_DSP_R1_LE)
static __inline int16_t WebRtcSpl_SatW32ToW16(int32_t value32) {
__asm __volatile(
diff --git a/common_audio/signal_processing/signal_processing_unittest.cc b/common_audio/signal_processing/signal_processing_unittest.cc
index 284fb83c..2a347089 100644
--- a/common_audio/signal_processing/signal_processing_unittest.cc
+++ b/common_audio/signal_processing/signal_processing_unittest.cc
@@ -61,10 +61,6 @@ TEST_F(SplTest, MacroTest) {
EXPECT_EQ(-3, WEBRTC_SPL_MUL_16_32_RSFT14(a, b));
EXPECT_EQ(-24, WEBRTC_SPL_MUL_16_32_RSFT11(a, b));
- int a32a = (WEBRTC_SPL_WORD32_MAX >> 16);
- int a32b = (WEBRTC_SPL_WORD32_MAX & 0x0000ffff);
- EXPECT_EQ(5, WEBRTC_SPL_MUL_32_32_RSFT32(a32a, a32b, A));
-
EXPECT_EQ(-12288, WEBRTC_SPL_MUL_16_16_RSFT(a, b, 2));
EXPECT_EQ(-12287, WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(a, b, 2));
@@ -104,15 +100,10 @@ TEST_F(SplTest, MacroTest) {
EXPECT_EQ(-1073741824,
WEBRTC_SPL_MUL_16_32_RSFT16(WEBRTC_SPL_WORD16_MIN,
WEBRTC_SPL_WORD32_MAX));
- EXPECT_EQ(0x3fffffff, WEBRTC_SPL_MUL_32_32_RSFT32(WEBRTC_SPL_WORD16_MAX,
- 0xffff, WEBRTC_SPL_WORD32_MAX));
#else
EXPECT_EQ(-1073741823,
WEBRTC_SPL_MUL_16_32_RSFT16(WEBRTC_SPL_WORD16_MIN,
WEBRTC_SPL_WORD32_MAX));
- // TODO(bjornv): fix issue 3674 and re-enable or delete the following test.
- // EXPECT_EQ(0x3fff7ffe, WEBRTC_SPL_MUL_32_32_RSFT32(WEBRTC_SPL_WORD16_MAX,
- // 0xffff, WEBRTC_SPL_WORD32_MAX));
#endif
}