| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 #include <vector> | 10 #include <vector> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // preceeding frames as testvectors. As the algorithm being tested has a | 87 // preceeding frames as testvectors. As the algorithm being tested has a |
| 88 // memory, testing only the last frame implicitly also tests the preceeding | 88 // memory, testing only the last frame implicitly also tests the preceeding |
| 89 // frames. | 89 // frames. |
| 90 EXPECT_TRUE(test::VerifyDeinterleavedArray( | 90 EXPECT_TRUE(test::VerifyDeinterleavedArray( |
| 91 capture_config.num_frames(), capture_config.num_channels(), | 91 capture_config.num_frames(), capture_config.num_channels(), |
| 92 output_reference, capture_output, kVectorElementErrorBound)); | 92 output_reference, capture_output, kVectorElementErrorBound)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace | 95 } // namespace |
| 96 | 96 |
| 97 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Mono8kHzLow) { | 97 TEST(NoiseSuppresionBitExactnessTest, Mono8kHzLow) { |
| 98 #if defined(WEBRTC_ARCH_ARM64) | 98 #if defined(WEBRTC_ARCH_ARM64) |
| 99 const float kSpeechProbabilityReference = -4.0f; | 99 const float kSpeechProbabilityReference = -4.0f; |
| 100 const float kNoiseEstimateReference[] = {2.797542f, 6.488125f, 14.995160f}; | 100 const float kNoiseEstimateReference[] = |
| 101 {1432.341431f, 3321.919922f, 7677.521973f}; |
| 101 const float kOutputReference[] = {0.003510f, 0.004517f, 0.004669f}; | 102 const float kOutputReference[] = {0.003510f, 0.004517f, 0.004669f}; |
| 102 #elif defined(WEBRTC_ARCH_ARM) | 103 #elif defined(WEBRTC_ARCH_ARM) |
| 103 const float kSpeechProbabilityReference = -4.0f; | 104 const float kSpeechProbabilityReference = -4.0f; |
| 104 const float kNoiseEstimateReference[] = {2.797542f, 6.488125f, 14.995160f}; | 105 const float kNoiseEstimateReference[] = |
| 106 {1432.341431f, 3321.919922f, 7677.521973f}; |
| 105 const float kOutputReference[] = {0.003510f, 0.004517f, 0.004669f}; | 107 const float kOutputReference[] = {0.003510f, 0.004517f, 0.004669f}; |
| 106 #else | 108 #else |
| 107 const float kSpeechProbabilityReference = 0.73421317f; | 109 const float kSpeechProbabilityReference = 0.73421317f; |
| 108 const float kNoiseEstimateReference[] = {0.035866f, 0.100382f, 0.229889f}; | 110 const float kNoiseEstimateReference[] = |
| 111 {1175.266113f, 3289.305908f, 7532.991211f}; |
| 109 const float kOutputReference[] = {0.003263f, 0.004402f, 0.004537f}; | 112 const float kOutputReference[] = {0.003263f, 0.004402f, 0.004537f}; |
| 110 #endif | 113 #endif |
| 111 | 114 |
| 112 RunBitexactnessTest(8000, 1, NoiseSuppression::Level::kLow, | 115 RunBitexactnessTest(8000, 1, NoiseSuppression::Level::kLow, |
| 113 kSpeechProbabilityReference, kNoiseEstimateReference, | 116 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 114 kOutputReference); | 117 kOutputReference); |
| 115 } | 118 } |
| 116 | 119 |
| 117 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Mono16kHzLow) { | 120 TEST(NoiseSuppresionBitExactnessTest, Mono16kHzLow) { |
| 118 #if defined(WEBRTC_ARCH_ARM64) | 121 #if defined(WEBRTC_ARCH_ARM64) |
| 119 const float kSpeechProbabilityReference = -4.0f; | 122 const float kSpeechProbabilityReference = -4.0f; |
| 120 const float kNoiseEstimateReference[] = {2.475060f, 6.130507f, 14.030761f}; | 123 const float kNoiseEstimateReference[] = |
| 124 {2534.461914f, 6277.638672f, 14367.499023f}; |
| 121 const float kOutputReference[] = {0.003449f, 0.004334f, 0.004303f}; | 125 const float kOutputReference[] = {0.003449f, 0.004334f, 0.004303f}; |
| 122 #elif defined(WEBRTC_ARCH_ARM) | 126 #elif defined(WEBRTC_ARCH_ARM) |
| 123 const float kSpeechProbabilityReference = -4.0f; | 127 const float kSpeechProbabilityReference = -4.0f; |
| 124 const float kNoiseEstimateReference[] = {2.475060f, 6.130507f, 14.030761f}; | 128 const float kNoiseEstimateReference[] = |
| 129 {2534.461914f, 6277.638672f, 14367.499023f}; |
| 125 const float kOutputReference[] = {0.003449f, 0.004334f, 0.004303f}; | 130 const float kOutputReference[] = {0.003449f, 0.004334f, 0.004303f}; |
| 126 #else | 131 #else |
| 127 const float kSpeechProbabilityReference = 0.71672988f; | 132 const float kSpeechProbabilityReference = 0.71672988f; |
| 128 const float kNoiseEstimateReference[] = {0.065653f, 0.198662f, 0.477870f}; | 133 const float kNoiseEstimateReference[] = |
| 134 {2151.313965f, 6509.765137f, 15658.848633f}; |
| 129 const float kOutputReference[] = {0.003574f, 0.004494f, 0.004499f}; | 135 const float kOutputReference[] = {0.003574f, 0.004494f, 0.004499f}; |
| 130 #endif | 136 #endif |
| 131 | 137 |
| 132 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kLow, | 138 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kLow, |
| 133 kSpeechProbabilityReference, kNoiseEstimateReference, | 139 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 134 kOutputReference); | 140 kOutputReference); |
| 135 } | 141 } |
| 136 | 142 |
| 137 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Mono32kHzLow) { | 143 TEST(NoiseSuppresionBitExactnessTest, Mono32kHzLow) { |
| 138 #if defined(WEBRTC_ARCH_ARM64) | 144 #if defined(WEBRTC_ARCH_ARM64) |
| 139 const float kSpeechProbabilityReference = -4.0f; | 145 const float kSpeechProbabilityReference = -4.0f; |
| 140 const float kNoiseEstimateReference[] = {2.480526f, 6.169749f, 14.102388f}; | 146 const float kNoiseEstimateReference[] = |
| 147 {2540.059082f, 6317.822754f, 14440.845703f}; |
| 141 const float kOutputReference[] = {0.001679f, 0.002411f, 0.002594f}; | 148 const float kOutputReference[] = {0.001679f, 0.002411f, 0.002594f}; |
| 142 #elif defined(WEBRTC_ARCH_ARM) | 149 #elif defined(WEBRTC_ARCH_ARM) |
| 143 const float kSpeechProbabilityReference = -4.0f; | 150 const float kSpeechProbabilityReference = -4.0f; |
| 144 const float kNoiseEstimateReference[] = {2.480526f, 6.169749f, 14.102388f}; | 151 const float kNoiseEstimateReference[] = |
| 152 {2540.059082f, 6317.822754f, 14440.845703f}; |
| 145 const float kOutputReference[] = {0.001679f, 0.002411f, 0.002594f}; | 153 const float kOutputReference[] = {0.001679f, 0.002411f, 0.002594f}; |
| 146 #else | 154 #else |
| 147 const float kSpeechProbabilityReference = 0.67999554f; | 155 const float kSpeechProbabilityReference = 0.67999554f; |
| 148 const float kNoiseEstimateReference[] = {0.065606f, 0.215971f, 0.455931f}; | 156 const float kNoiseEstimateReference[] = |
| 157 {2149.780518f, 7076.936035f, 14939.945312f}; |
| 149 const float kOutputReference[] = {0.001221f, 0.001984f, 0.002228f}; | 158 const float kOutputReference[] = {0.001221f, 0.001984f, 0.002228f}; |
| 150 #endif | 159 #endif |
| 151 | 160 |
| 152 RunBitexactnessTest(32000, 1, NoiseSuppression::Level::kLow, | 161 RunBitexactnessTest(32000, 1, NoiseSuppression::Level::kLow, |
| 153 kSpeechProbabilityReference, kNoiseEstimateReference, | 162 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 154 kOutputReference); | 163 kOutputReference); |
| 155 } | 164 } |
| 156 | 165 |
| 157 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Mono48kHzLow) { | 166 TEST(NoiseSuppresionBitExactnessTest, Mono48kHzLow) { |
| 158 #if defined(WEBRTC_ARCH_ARM64) | 167 #if defined(WEBRTC_ARCH_ARM64) |
| 159 const float kSpeechProbabilityReference = -4.0f; | 168 const float kSpeechProbabilityReference = -4.0f; |
| 160 const float kNoiseEstimateReference[] = {2.504498f, 6.068024f, 13.058871f}; | 169 const float kNoiseEstimateReference[] = |
| 170 {2564.605713f, 6213.656250f, 13372.284180f}; |
| 161 const float kOutputReference[] = {-0.013185f, -0.012769f, -0.012023f}; | 171 const float kOutputReference[] = {-0.013185f, -0.012769f, -0.012023f}; |
| 162 #elif defined(WEBRTC_ARCH_ARM) | 172 #elif defined(WEBRTC_ARCH_ARM) |
| 163 const float kSpeechProbabilityReference = -4.0f; | 173 const float kSpeechProbabilityReference = -4.0f; |
| 164 const float kNoiseEstimateReference[] = {2.504498f, 6.068024f, 13.058871f}; | 174 const float kNoiseEstimateReference[] = |
| 175 {2564.605713f, 6213.656250f, 13372.284180f}; |
| 165 const float kOutputReference[] = {-0.013185f, -0.012769f, -0.012023f}; | 176 const float kOutputReference[] = {-0.013185f, -0.012769f, -0.012023f}; |
| 166 #else | 177 #else |
| 167 const float kSpeechProbabilityReference = 0.70645678f; | 178 const float kSpeechProbabilityReference = 0.70645678f; |
| 168 const float kNoiseEstimateReference[] = {0.066186f, 0.210660f, 0.402548f}; | 179 const float kNoiseEstimateReference[] = |
| 180 {2168.783203f, 6902.895508f, 13190.677734f}; |
| 169 const float kOutputReference[] = {-0.013062f, -0.012657f, -0.011934f}; | 181 const float kOutputReference[] = {-0.013062f, -0.012657f, -0.011934f}; |
| 170 #endif | 182 #endif |
| 171 | 183 |
| 172 RunBitexactnessTest(48000, 1, NoiseSuppression::Level::kLow, | 184 RunBitexactnessTest(48000, 1, NoiseSuppression::Level::kLow, |
| 173 kSpeechProbabilityReference, kNoiseEstimateReference, | 185 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 174 kOutputReference); | 186 kOutputReference); |
| 175 } | 187 } |
| 176 | 188 |
| 177 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Stereo16kHzLow) { | 189 TEST(NoiseSuppresionBitExactnessTest, Stereo16kHzLow) { |
| 178 #if defined(WEBRTC_ARCH_ARM64) | 190 #if defined(WEBRTC_ARCH_ARM64) |
| 179 const float kSpeechProbabilityReference = -4.0f; | 191 const float kSpeechProbabilityReference = -4.0f; |
| 180 const float kNoiseEstimateReference[] = {9.757937f, 12.392158f, 11.317673f}; | 192 const float kNoiseEstimateReference[] = |
| 193 {9992.127930f, 12689.569336f, 11589.296875f}; |
| 181 const float kOutputReference[] = {-0.011108f, -0.007904f, -0.012390f, | 194 const float kOutputReference[] = {-0.011108f, -0.007904f, -0.012390f, |
| 182 -0.002441f, 0.000855f, -0.003204f}; | 195 -0.002441f, 0.000855f, -0.003204f}; |
| 183 #elif defined(WEBRTC_ARCH_ARM) | 196 #elif defined(WEBRTC_ARCH_ARM) |
| 184 const float kSpeechProbabilityReference = -4.0f; | 197 const float kSpeechProbabilityReference = -4.0f; |
| 185 const float kNoiseEstimateReference[] = {10.079447f, 11.849465f, 10.667051f}; | 198 const float kNoiseEstimateReference[] = |
| 199 {10321.353516f, 12133.852539f, 10923.060547f}; |
| 186 const float kOutputReference[] = {-0.011108f, -0.007904f, -0.012390f, | 200 const float kOutputReference[] = {-0.011108f, -0.007904f, -0.012390f, |
| 187 -0.002472f, 0.000916f, -0.003235f}; | 201 -0.002472f, 0.000916f, -0.003235f}; |
| 188 #else | 202 #else |
| 189 const float kSpeechProbabilityReference = 0.67230678f; | 203 const float kSpeechProbabilityReference = 0.67230678f; |
| 190 const float kNoiseEstimateReference[] = {0.298195f, 0.345745f, 0.320528f}; | 204 const float kNoiseEstimateReference[] = |
| 205 {9771.250000f, 11329.377930f, 10503.052734f}; |
| 191 const float kOutputReference[] = {-0.011459f, -0.008110f, -0.012728f, | 206 const float kOutputReference[] = {-0.011459f, -0.008110f, -0.012728f, |
| 192 -0.002399f, 0.001018f, -0.003189f}; | 207 -0.002399f, 0.001018f, -0.003189f}; |
| 193 #endif | 208 #endif |
| 194 | 209 |
| 195 RunBitexactnessTest(16000, 2, NoiseSuppression::Level::kLow, | 210 RunBitexactnessTest(16000, 2, NoiseSuppression::Level::kLow, |
| 196 kSpeechProbabilityReference, kNoiseEstimateReference, | 211 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 197 kOutputReference); | 212 kOutputReference); |
| 198 } | 213 } |
| 199 | 214 |
| 200 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Mono16kHzModerate) { | 215 TEST(NoiseSuppresionBitExactnessTest, Mono16kHzModerate) { |
| 201 #if defined(WEBRTC_ARCH_ARM64) | 216 #if defined(WEBRTC_ARCH_ARM64) |
| 202 const float kSpeechProbabilityReference = -4.0f; | 217 const float kSpeechProbabilityReference = -4.0f; |
| 203 const float kNoiseEstimateReference[] = {1.004436f, 3.711453f, 9.602631f}; | 218 const float kNoiseEstimateReference[] = |
| 219 {2057.085938f, 7601.055176f, 19666.187500f}; |
| 204 const float kOutputReference[] = {0.004669f, 0.005524f, 0.005432f}; | 220 const float kOutputReference[] = {0.004669f, 0.005524f, 0.005432f}; |
| 205 #elif defined(WEBRTC_ARCH_ARM) | 221 #elif defined(WEBRTC_ARCH_ARM) |
| 206 const float kSpeechProbabilityReference = -4.0f; | 222 const float kSpeechProbabilityReference = -4.0f; |
| 207 const float kNoiseEstimateReference[] = {1.095946f, 3.351643f, 8.167248f}; | 223 const float kNoiseEstimateReference[] = |
| 224 {2244.497803f, 6864.164062f, 16726.523438f}; |
| 208 const float kOutputReference[] = {0.004669f, 0.005615f, 0.005585f}; | 225 const float kOutputReference[] = {0.004669f, 0.005615f, 0.005585f}; |
| 209 #else | 226 #else |
| 210 const float kSpeechProbabilityReference = 0.70897013f; | 227 const float kSpeechProbabilityReference = 0.70897013f; |
| 211 const float kNoiseEstimateReference[] = {0.066269f, 0.199999f, 0.476885f}; | 228 const float kNoiseEstimateReference[] = |
| 229 {2171.490723f, 6553.567871f, 15626.562500f}; |
| 212 const float kOutputReference[] = {0.004513f, 0.005590f, 0.005614f}; | 230 const float kOutputReference[] = {0.004513f, 0.005590f, 0.005614f}; |
| 213 #endif | 231 #endif |
| 214 | 232 |
| 215 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kModerate, | 233 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kModerate, |
| 216 kSpeechProbabilityReference, kNoiseEstimateReference, | 234 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 217 kOutputReference); | 235 kOutputReference); |
| 218 } | 236 } |
| 219 | 237 |
| 220 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Mono16kHzHigh) { | 238 TEST(NoiseSuppresionBitExactnessTest, Mono16kHzHigh) { |
| 221 #if defined(WEBRTC_ARCH_ARM64) | 239 #if defined(WEBRTC_ARCH_ARM64) |
| 222 const float kSpeechProbabilityReference = -4.0f; | 240 const float kSpeechProbabilityReference = -4.0f; |
| 223 const float kNoiseEstimateReference[] = {1.023022f, 3.759059f, 9.614030f}; | 241 const float kNoiseEstimateReference[] = |
| 242 {2095.148193f, 7698.553711f, 19689.533203f}; |
| 224 const float kOutputReference[] = {0.004639f, 0.005402f, 0.005310f}; | 243 const float kOutputReference[] = {0.004639f, 0.005402f, 0.005310f}; |
| 225 #elif defined(WEBRTC_ARCH_ARM) | 244 #elif defined(WEBRTC_ARCH_ARM) |
| 226 const float kSpeechProbabilityReference = -4.0f; | 245 const float kSpeechProbabilityReference = -4.0f; |
| 227 const float kNoiseEstimateReference[] = {1.114510f, 3.410356f, 8.262188f}; | 246 const float kNoiseEstimateReference[] = |
| 247 {2282.515625f, 6984.408203f, 16920.960938f}; |
| 228 const float kOutputReference[] = {0.004547f, 0.005432f, 0.005402f}; | 248 const float kOutputReference[] = {0.004547f, 0.005432f, 0.005402f}; |
| 229 #else | 249 #else |
| 230 const float kSpeechProbabilityReference = 0.70106733f; | 250 const float kSpeechProbabilityReference = 0.70106733f; |
| 231 const float kNoiseEstimateReference[] = {0.067901f, 0.204835f, 0.481723f}; | 251 const float kNoiseEstimateReference[] = |
| 252 {2224.968506f, 6712.025879f, 15785.087891f}; |
| 232 const float kOutputReference[] = {0.004394f, 0.005406f, 0.005416f}; | 253 const float kOutputReference[] = {0.004394f, 0.005406f, 0.005416f}; |
| 233 #endif | 254 #endif |
| 234 | 255 |
| 235 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kHigh, | 256 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kHigh, |
| 236 kSpeechProbabilityReference, kNoiseEstimateReference, | 257 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 237 kOutputReference); | 258 kOutputReference); |
| 238 } | 259 } |
| 239 | 260 |
| 240 TEST(NoiseSuppresionBitExactnessTest, DISABLED_Mono16kHzVeryHigh) { | 261 TEST(NoiseSuppresionBitExactnessTest, Mono16kHzVeryHigh) { |
| 241 #if defined(WEBRTC_ARCH_ARM64) | 262 #if defined(WEBRTC_ARCH_ARM64) |
| 242 const float kSpeechProbabilityReference = -4.0f; | 263 const float kSpeechProbabilityReference = -4.0f; |
| 243 const float kNoiseEstimateReference[] = {2.614974f, 6.041980f, 14.029047f}; | 264 const float kNoiseEstimateReference[] = |
| 265 {2677.733398f, 6186.987305f, 14365.744141f}; |
| 244 const float kOutputReference[] = {0.004273f, 0.005127f, 0.005188f}; | 266 const float kOutputReference[] = {0.004273f, 0.005127f, 0.005188f}; |
| 245 #elif defined(WEBRTC_ARCH_ARM) | 267 #elif defined(WEBRTC_ARCH_ARM) |
| 246 const float kSpeechProbabilityReference = -4.0f; | 268 const float kSpeechProbabilityReference = -4.0f; |
| 247 const float kNoiseEstimateReference[] = {2.614974f, 6.041980f, 14.029047f}; | 269 const float kNoiseEstimateReference[] = |
| 270 {2677.733398f, 6186.987305f, 14365.744141f}; |
| 248 const float kOutputReference[] = {0.004273f, 0.005127f, 0.005188f}; | 271 const float kOutputReference[] = {0.004273f, 0.005127f, 0.005188f}; |
| 249 #else | 272 #else |
| 250 const float kSpeechProbabilityReference = 0.70281971f; | 273 const float kSpeechProbabilityReference = 0.70281971f; |
| 251 const float kNoiseEstimateReference[] = {0.068797f, 0.205191f, 0.481312f}; | 274 const float kNoiseEstimateReference[] = |
| 275 {2254.347900f, 6723.699707f, 15771.625977f}; |
| 252 const float kOutputReference[] = {0.004321f, 0.005247f, 0.005263f}; | 276 const float kOutputReference[] = {0.004321f, 0.005247f, 0.005263f}; |
| 253 #endif | 277 #endif |
| 254 | 278 |
| 255 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kVeryHigh, | 279 RunBitexactnessTest(16000, 1, NoiseSuppression::Level::kVeryHigh, |
| 256 kSpeechProbabilityReference, kNoiseEstimateReference, | 280 kSpeechProbabilityReference, kNoiseEstimateReference, |
| 257 kOutputReference); | 281 kOutputReference); |
| 258 } | 282 } |
| 259 | 283 |
| 260 } // namespace webrtc | 284 } // namespace webrtc |
| OLD | NEW |