| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 resampler.kernel_storage_.get() + 1, resampler.kernel_storage_.get(), | 156 resampler.kernel_storage_.get() + 1, resampler.kernel_storage_.get(), |
| 157 resampler.kernel_storage_.get(), kKernelInterpolationFactor); | 157 resampler.kernel_storage_.get(), kKernelInterpolationFactor); |
| 158 result2 = resampler.CONVOLVE_FUNC( | 158 result2 = resampler.CONVOLVE_FUNC( |
| 159 resampler.kernel_storage_.get() + 1, resampler.kernel_storage_.get(), | 159 resampler.kernel_storage_.get() + 1, resampler.kernel_storage_.get(), |
| 160 resampler.kernel_storage_.get(), kKernelInterpolationFactor); | 160 resampler.kernel_storage_.get(), kKernelInterpolationFactor); |
| 161 EXPECT_NEAR(result2, result, kEpsilon); | 161 EXPECT_NEAR(result2, result, kEpsilon); |
| 162 } | 162 } |
| 163 #endif | 163 #endif |
| 164 | 164 |
| 165 // Benchmark for the various Convolve() methods. Make sure to build with | 165 // Benchmark for the various Convolve() methods. Make sure to build with |
| 166 // branding=Chrome so that DCHECKs are compiled out when benchmarking. Original | 166 // branding=Chrome so that RTC_DCHECKs are compiled out when benchmarking. |
| 167 // benchmarks were run with --convolve-iterations=50000000. | 167 // Original benchmarks were run with --convolve-iterations=50000000. |
| 168 TEST(SincResamplerTest, ConvolveBenchmark) { | 168 TEST(SincResamplerTest, ConvolveBenchmark) { |
| 169 // Initialize a dummy resampler. | 169 // Initialize a dummy resampler. |
| 170 MockSource mock_source; | 170 MockSource mock_source; |
| 171 SincResampler resampler(kSampleRateRatio, SincResampler::kDefaultRequestSize, | 171 SincResampler resampler(kSampleRateRatio, SincResampler::kDefaultRequestSize, |
| 172 &mock_source); | 172 &mock_source); |
| 173 | 173 |
| 174 // Retrieve benchmark iterations from command line. | 174 // Retrieve benchmark iterations from command line. |
| 175 // TODO(ajm): Reintroduce this as a command line option. | 175 // TODO(ajm): Reintroduce this as a command line option. |
| 176 const int kConvolveIterations = 1000000; | 176 const int kConvolveIterations = 1000000; |
| 177 | 177 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 std::tr1::make_tuple(11025, 192000, kResamplingRMSError, -62.61), | 380 std::tr1::make_tuple(11025, 192000, kResamplingRMSError, -62.61), |
| 381 std::tr1::make_tuple(16000, 192000, kResamplingRMSError, -63.14), | 381 std::tr1::make_tuple(16000, 192000, kResamplingRMSError, -63.14), |
| 382 std::tr1::make_tuple(22050, 192000, kResamplingRMSError, -62.42), | 382 std::tr1::make_tuple(22050, 192000, kResamplingRMSError, -62.42), |
| 383 std::tr1::make_tuple(32000, 192000, kResamplingRMSError, -63.38), | 383 std::tr1::make_tuple(32000, 192000, kResamplingRMSError, -63.38), |
| 384 std::tr1::make_tuple(44100, 192000, kResamplingRMSError, -62.63), | 384 std::tr1::make_tuple(44100, 192000, kResamplingRMSError, -62.63), |
| 385 std::tr1::make_tuple(48000, 192000, kResamplingRMSError, -73.44), | 385 std::tr1::make_tuple(48000, 192000, kResamplingRMSError, -73.44), |
| 386 std::tr1::make_tuple(96000, 192000, kResamplingRMSError, -73.52), | 386 std::tr1::make_tuple(96000, 192000, kResamplingRMSError, -73.52), |
| 387 std::tr1::make_tuple(192000, 192000, kResamplingRMSError, -73.52))); | 387 std::tr1::make_tuple(192000, 192000, kResamplingRMSError, -73.52))); |
| 388 | 388 |
| 389 } // namespace webrtc | 389 } // namespace webrtc |
| OLD | NEW |