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 |
11 #include <cmath> | 11 #include <cmath> |
12 #include <cstring> | 12 #include <cstring> |
13 | 13 |
14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "webrtc/base/scoped_ptr.h" | 16 #include "webrtc/base/scoped_ptr.h" |
17 #include "webrtc/common_audio/include/audio_util.h" | 17 #include "webrtc/common_audio/include/audio_util.h" |
18 #include "webrtc/common_audio/resampler/push_sinc_resampler.h" | 18 #include "webrtc/common_audio/resampler/push_sinc_resampler.h" |
19 #include "webrtc/common_audio/resampler/sinusoidal_linear_chirp_source.h" | 19 #include "webrtc/common_audio/resampler/sinusoidal_linear_chirp_source.h" |
20 #include "webrtc/system_wrappers/interface/tick_util.h" | 20 #include "webrtc/system_wrappers/include/tick_util.h" |
21 #include "webrtc/typedefs.h" | 21 #include "webrtc/typedefs.h" |
22 | 22 |
23 namespace webrtc { | 23 namespace webrtc { |
24 namespace { | 24 namespace { |
25 | 25 |
26 // Almost all conversions have an RMS error of around -14 dbFS. | 26 // Almost all conversions have an RMS error of around -14 dbFS. |
27 const double kResamplingRMSError = -14.42; | 27 const double kResamplingRMSError = -14.42; |
28 | 28 |
29 // Used to convert errors to dbFS. | 29 // Used to convert errors to dbFS. |
30 template <typename T> | 30 template <typename T> |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // To 32 kHz | 326 // To 32 kHz |
327 ::testing::make_tuple(8000, 32000, kResamplingRMSError, -70.30), | 327 ::testing::make_tuple(8000, 32000, kResamplingRMSError, -70.30), |
328 ::testing::make_tuple(16000, 32000, kResamplingRMSError, -75.51), | 328 ::testing::make_tuple(16000, 32000, kResamplingRMSError, -75.51), |
329 ::testing::make_tuple(32000, 32000, kResamplingRMSError, -75.51), | 329 ::testing::make_tuple(32000, 32000, kResamplingRMSError, -75.51), |
330 ::testing::make_tuple(44100, 32000, -16.44, -51.10), | 330 ::testing::make_tuple(44100, 32000, -16.44, -51.10), |
331 ::testing::make_tuple(48000, 32000, -16.90, -44.03), | 331 ::testing::make_tuple(48000, 32000, -16.90, -44.03), |
332 ::testing::make_tuple(96000, 32000, -19.61, -18.04), | 332 ::testing::make_tuple(96000, 32000, -19.61, -18.04), |
333 ::testing::make_tuple(192000, 32000, -21.02, -10.94))); | 333 ::testing::make_tuple(192000, 32000, -21.02, -10.94))); |
334 | 334 |
335 } // namespace webrtc | 335 } // namespace webrtc |
OLD | NEW |