diff options
author | Android Chromium Automerger <chromium-automerger@android> | 2014-08-14 15:59:13 +0000 |
---|---|---|
committer | Android Chromium Automerger <chromium-automerger@android> | 2014-08-14 15:59:13 +0000 |
commit | f6947968116dfb1e9004d0941932253097a4daa1 (patch) | |
tree | bec6da598564b55249d5f98d40eff83ef89ca29c /common_audio | |
parent | 5f192429a0cef706ec6e903d99130b9623db8c02 (diff) | |
parent | c2ef523233552340785557abce1129a0f61537eb (diff) | |
download | webrtc-f6947968116dfb1e9004d0941932253097a4daa1.tar.gz |
Merge third_party/webrtc from https://chromium.googlesource.com/external/webrtc/trunk/webrtc.git at c2ef523233552340785557abce1129a0f61537eb
This commit was generated by merge_from_chromium.py.
Change-Id: If1f6b3b63673dba2f4d77d2ddea983f77d0eaab9
Diffstat (limited to 'common_audio')
4 files changed, 3 insertions, 78 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 a68840e8..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,14 +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)); - EXPECT_EQ(0x3fff7ffe, WEBRTC_SPL_MUL_32_32_RSFT32(WEBRTC_SPL_WORD16_MAX, - 0xffff, WEBRTC_SPL_WORD32_MAX)); #endif } @@ -134,10 +126,9 @@ TEST_F(SplTest, InlineTest) { EXPECT_EQ(0, WebRtcSpl_NormW16(WEBRTC_SPL_WORD16_MIN)); EXPECT_EQ(4, WebRtcSpl_NormW16(b32)); - EXPECT_EQ(0, WebRtcSpl_NormU32(0)); - EXPECT_EQ(0, WebRtcSpl_NormU32(-1)); - EXPECT_EQ(0, WebRtcSpl_NormU32(WEBRTC_SPL_WORD32_MIN)); - EXPECT_EQ(15, WebRtcSpl_NormU32(a32)); + EXPECT_EQ(0, WebRtcSpl_NormU32(0u)); + EXPECT_EQ(0, WebRtcSpl_NormU32(0xffffffff)); + EXPECT_EQ(15, WebRtcSpl_NormU32(static_cast<uint32_t>(a32))); EXPECT_EQ(104, WebRtcSpl_AddSatW16(a16, b16)); EXPECT_EQ(138, WebRtcSpl_SubSatW16(a16, b16)); |