From 3362d4237f3f92c15a275878061ce02f28b204c2 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Thu, 15 May 2014 07:22:53 +0000 Subject: common_audio: Removes unused macros * WEBRTC_SPL_MUL_32_32_RSFT32BI * WEBRTC_SPL_IS_NEG BUG=3348 TESTED=trybots, common_audio_unittests R=tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/18449004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@6169 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../signal_processing/include/signal_processing_library.h | 7 ------- common_audio/signal_processing/signal_processing_unittest.cc | 8 -------- 2 files changed, 15 deletions(-) (limited to 'common_audio/signal_processing') diff --git a/common_audio/signal_processing/include/signal_processing_library.h b/common_audio/signal_processing/include/signal_processing_library.h index 60c60bc9..3fb64a92 100644 --- a/common_audio/signal_processing/include/signal_processing_library.h +++ b/common_audio/signal_processing/include/signal_processing_library.h @@ -83,11 +83,6 @@ #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))) -#define WEBRTC_SPL_MUL_32_32_RSFT32BI(a32, b32) \ - ((int32_t)(WEBRTC_SPL_MUL_16_32_RSFT16(( \ - (int16_t)(a32 >> 16)), b32) + \ - (WEBRTC_SPL_MUL_16_32_RSFT16(( \ - (int16_t)((a32 & 0x0000FFFF) >> 1)), b32) >> 15))) #endif #endif @@ -122,8 +117,6 @@ #define WEBRTC_SPL_ADD_SAT_W16(a, b) WebRtcSpl_AddSatW16(a, b) #define WEBRTC_SPL_SUB_SAT_W16(a, b) WebRtcSpl_SubSatW16(a, b) -// We cannot do casting here due to signed/unsigned problem -#define WEBRTC_SPL_IS_NEG(a) ((a) & 0x80000000) // Shifting with negative numbers allowed // Positive means left shift #define WEBRTC_SPL_SHIFT_W16(x, c) \ diff --git a/common_audio/signal_processing/signal_processing_unittest.cc b/common_audio/signal_processing/signal_processing_unittest.cc index a1bf0d5e..c02e106e 100644 --- a/common_audio/signal_processing/signal_processing_unittest.cc +++ b/common_audio/signal_processing/signal_processing_unittest.cc @@ -63,11 +63,9 @@ 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 a32 = WEBRTC_SPL_WORD32_MAX; 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(5, WEBRTC_SPL_MUL_32_32_RSFT32BI(a32, 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)); @@ -82,8 +80,6 @@ TEST_F(SplTest, MacroTest) { EXPECT_EQ(16380, WEBRTC_SPL_ADD_SAT_W16(a, b)); EXPECT_EQ(16386, WEBRTC_SPL_SUB_SAT_W16(a, b)); - EXPECT_TRUE(WEBRTC_SPL_IS_NEG(b)); - // Shifting with negative numbers allowed int shift_amount = 1; // Workaround compiler warning using variable here. // Positive means left shift @@ -117,16 +113,12 @@ TEST_F(SplTest, MacroTest) { WEBRTC_SPL_WORD32_MAX)); EXPECT_EQ(0x3fffffff, WEBRTC_SPL_MUL_32_32_RSFT32(WEBRTC_SPL_WORD16_MAX, 0xffff, WEBRTC_SPL_WORD32_MAX)); - EXPECT_EQ(0x3fffffff, WEBRTC_SPL_MUL_32_32_RSFT32BI(WEBRTC_SPL_WORD32_MAX, - 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)); - EXPECT_EQ(0x3ffffffd, WEBRTC_SPL_MUL_32_32_RSFT32BI(WEBRTC_SPL_WORD32_MAX, - WEBRTC_SPL_WORD32_MAX)); #endif } -- cgit v1.2.3