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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Dummy input/output speech data. | 44 // Dummy input/output speech data. |
45 static const int kSamplesPerChunk = 160; | 45 static const int kSamplesPerChunk = 160; |
46 float far_[kSamplesPerChunk]; | 46 float far_[kSamplesPerChunk]; |
47 float near_[kSamplesPerChunk]; | 47 float near_[kSamplesPerChunk]; |
48 float out_[kSamplesPerChunk]; | 48 float out_[kSamplesPerChunk]; |
49 const float* near_ptr_; | 49 const float* near_ptr_; |
50 float* out_ptr_; | 50 float* out_ptr_; |
51 }; | 51 }; |
52 | 52 |
53 SystemDelayTest::SystemDelayTest() | 53 SystemDelayTest::SystemDelayTest() |
54 : handle_(NULL), self_(NULL), samples_per_frame_(0) { | 54 : handle_(nullptr), self_(nullptr), samples_per_frame_(0) { |
55 // Dummy input data are set with more or less arbitrary non-zero values. | 55 // Dummy input data are set with more or less arbitrary non-zero values. |
56 for (int i = 0; i < kSamplesPerChunk; i++) { | 56 for (int i = 0; i < kSamplesPerChunk; i++) { |
57 far_[i] = 257.0; | 57 far_[i] = 257.0; |
58 near_[i] = 514.0; | 58 near_[i] = 514.0; |
59 } | 59 } |
60 memset(out_, 0, sizeof(out_)); | 60 memset(out_, 0, sizeof(out_)); |
61 near_ptr_ = near_; | 61 near_ptr_ = near_; |
62 out_ptr_ = out_; | 62 out_ptr_ = out_; |
63 } | 63 } |
64 | 64 |
65 void SystemDelayTest::SetUp() { | 65 void SystemDelayTest::SetUp() { |
66 handle_ = WebRtcAec_Create(); | 66 handle_ = WebRtcAec_Create(); |
67 ASSERT_TRUE(handle_); | 67 ASSERT_TRUE(handle_); |
68 self_ = reinterpret_cast<Aec*>(handle_); | 68 self_ = reinterpret_cast<Aec*>(handle_); |
69 } | 69 } |
70 | 70 |
71 void SystemDelayTest::TearDown() { | 71 void SystemDelayTest::TearDown() { |
72 // Free AEC | 72 // Free AEC |
73 WebRtcAec_Free(handle_); | 73 WebRtcAec_Free(handle_); |
74 handle_ = NULL; | 74 handle_ = nullptr; |
75 } | 75 } |
76 | 76 |
77 // In SWB mode nothing is added to the buffer handling with respect to | 77 // In SWB mode nothing is added to the buffer handling with respect to |
78 // functionality compared to WB. We therefore only verify behavior in NB and WB. | 78 // functionality compared to WB. We therefore only verify behavior in NB and WB. |
79 static const int kSampleRateHz[] = {8000, 16000}; | 79 static const int kSampleRateHz[] = {8000, 16000}; |
80 static const size_t kNumSampleRates = | 80 static const size_t kNumSampleRates = |
81 sizeof(kSampleRateHz) / sizeof(*kSampleRateHz); | 81 sizeof(kSampleRateHz) / sizeof(*kSampleRateHz); |
82 | 82 |
83 // Default audio device buffer size used. | 83 // Default audio device buffer size used. |
84 static const int kDeviceBufMs = 100; | 84 static const int kDeviceBufMs = 100; |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 } | 590 } |
591 // Verify we are not in a non-causal state. | 591 // Verify we are not in a non-causal state. |
592 EXPECT_FALSE(non_causal); | 592 EXPECT_FALSE(non_causal); |
593 } | 593 } |
594 } | 594 } |
595 } | 595 } |
596 } | 596 } |
597 | 597 |
598 } // namespace | 598 } // namespace |
599 } // namespace webrtc | 599 } // namespace webrtc |
OLD | NEW |