OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 for (int i = 0; i < kState; i++) { | 58 for (int i = 0; i < kState; i++) { |
59 EXPECT_EQ(out_state_ch1[i], state_ch1[i]); | 59 EXPECT_EQ(out_state_ch1[i], state_ch1[i]); |
60 EXPECT_EQ(out_state_ch2[i], state_ch2[i]); | 60 EXPECT_EQ(out_state_ch2[i], state_ch2[i]); |
61 } | 61 } |
62 } | 62 } |
63 }; | 63 }; |
64 | 64 |
65 TEST_F(FilterBanksTest, AllpassFilter2FixDec16Test) { | 65 TEST_F(FilterBanksTest, AllpassFilter2FixDec16Test) { |
66 CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16C); | 66 CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16C); |
67 #ifdef WEBRTC_DETECT_NEON | 67 #if defined(WEBRTC_HAS_NEON) |
68 if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) { | |
69 CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon); | |
70 } | |
71 #elif defined(WEBRTC_HAS_NEON) | |
72 CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon); | 68 CalculateResidualEnergyTester(WebRtcIsacfix_AllpassFilter2FixDec16Neon); |
73 #endif | 69 #endif |
74 } | 70 } |
75 | 71 |
76 TEST_F(FilterBanksTest, HighpassFilterFixDec32Test) { | 72 TEST_F(FilterBanksTest, HighpassFilterFixDec32Test) { |
77 const int kSamples = 20; | 73 const int kSamples = 20; |
78 int16_t in[kSamples]; | 74 int16_t in[kSamples]; |
79 int32_t state[2] = {12345, 987654}; | 75 int32_t state[2] = {12345, 987654}; |
80 #ifdef WEBRTC_ARCH_ARM_V7 | 76 #ifdef WEBRTC_ARCH_ARM_V7 |
81 int32_t out[kSamples] = {-1040, -1035, -22875, -1397, -27604, 20018, 7917, | 77 int32_t out[kSamples] = {-1040, -1035, -22875, -1397, -27604, 20018, 7917, |
(...skipping 16 matching lines...) Expand all Loading... |
98 in[i] = WEBRTC_SPL_WORD32_MAX / (i + 1); | 94 in[i] = WEBRTC_SPL_WORD32_MAX / (i + 1); |
99 } | 95 } |
100 | 96 |
101 WebRtcIsacfix_HighpassFilterFixDec32(in, kSamples, | 97 WebRtcIsacfix_HighpassFilterFixDec32(in, kSamples, |
102 WebRtcIsacfix_kHPStCoeffOut1Q30, state); | 98 WebRtcIsacfix_kHPStCoeffOut1Q30, state); |
103 | 99 |
104 for (int i = 0; i < kSamples; i++) { | 100 for (int i = 0; i < kSamples; i++) { |
105 EXPECT_EQ(out[i], in[i]); | 101 EXPECT_EQ(out[i], in[i]); |
106 } | 102 } |
107 } | 103 } |
OLD | NEW |