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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 output->AssertSize(output_length); | 147 output->AssertSize(output_length); |
148 } else { | 148 } else { |
149 assert(output->Size() == output_length); | 149 assert(output->Size() == output_length); |
150 } | 150 } |
151 (*output)[channel].OverwriteAt(temp_data_.data(), output_length, 0); | 151 (*output)[channel].OverwriteAt(temp_data_.data(), output_length, 0); |
152 } | 152 } |
153 | 153 |
154 // Copy back the first part of the data to |sync_buffer_| and remove it from | 154 // Copy back the first part of the data to |sync_buffer_| and remove it from |
155 // |output|. | 155 // |output|. |
156 sync_buffer_->ReplaceAtIndex(*output, old_length, sync_buffer_->next_index()); | 156 sync_buffer_->ReplaceAtIndex(*output, old_length, sync_buffer_->next_index()); |
157 RTC_DCHECK_EQ(output_length, output->Size()); | |
minyue-webrtc
2017/05/05 07:14:00
I don't quite see how this relates to the changes
hlundin-webrtc
2017/05/05 07:42:14
I basically just wanted to make sure that the retu
minyue-webrtc
2017/05/05 07:50:39
Acknowledged.
| |
158 RTC_DCHECK_GE(output_length, old_length); | |
157 output->PopFront(old_length); | 159 output->PopFront(old_length); |
160 RTC_DCHECK_EQ(output_length - old_length, output->Size()); | |
158 | 161 |
159 // Return new added length. |old_length| samples were borrowed from | 162 // Return new added length. |old_length| samples were borrowed from |
160 // |sync_buffer_|. | 163 // |sync_buffer_|. |
161 return output_length - old_length; | 164 return output_length - old_length; |
162 } | 165 } |
163 | 166 |
164 size_t Merge::GetExpandedSignal(size_t* old_length, size_t* expand_period) { | 167 size_t Merge::GetExpandedSignal(size_t* old_length, size_t* expand_period) { |
165 // Check how much data that is left since earlier. | 168 // Check how much data that is left since earlier. |
166 *old_length = sync_buffer_->FutureLength(); | 169 *old_length = sync_buffer_->FutureLength(); |
167 // Should never be less than overlap_length. | 170 // Should never be less than overlap_length. |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 } | 374 } |
372 return best_correlation_index; | 375 return best_correlation_index; |
373 } | 376 } |
374 | 377 |
375 size_t Merge::RequiredFutureSamples() { | 378 size_t Merge::RequiredFutureSamples() { |
376 return fs_hz_ / 100 * num_channels_; // 10 ms. | 379 return fs_hz_ / 100 * num_channels_; // 10 ms. |
377 } | 380 } |
378 | 381 |
379 | 382 |
380 } // namespace webrtc | 383 } // namespace webrtc |
OLD | NEW |