Chromium Code Reviews| Index: webrtc/modules/audio_processing/aec3/echo_canceller3.cc |
| diff --git a/webrtc/modules/audio_processing/aec3/echo_canceller3.cc b/webrtc/modules/audio_processing/aec3/echo_canceller3.cc |
| index a4b796d969d2132c3a0ee72b43d25d8662e30471..3cd7b71afc04cba07a7235a1eba1481d6d179c4d 100644 |
| --- a/webrtc/modules/audio_processing/aec3/echo_canceller3.cc |
| +++ b/webrtc/modules/audio_processing/aec3/echo_canceller3.cc |
| @@ -20,7 +20,7 @@ namespace { |
| bool DetectSaturation(rtc::ArrayView<const float> y) { |
| for (auto y_k : y) { |
| - if (y_k >= 32767.0f || y_k <= -32768.0f) { |
| + if (y_k >= 32700.0f || y_k <= -32700.0f) { |
| return true; |
| } |
| } |
| @@ -112,11 +112,8 @@ void CopyAudioBufferIntoFrame(AudioBuffer* buffer, |
| size_t frame_length, |
| std::vector<std::vector<float>>* frame) { |
| RTC_DCHECK_EQ(num_bands, frame->size()); |
|
aleloi
2017/02/23 10:56:45
Suggest renaming into 'CopyLowestBandIntoFrame' or
peah-webrtc
2017/02/23 11:18:33
Done.
|
| - for (size_t i = 0; i < num_bands; ++i) { |
| - rtc::ArrayView<float> buffer_view(&buffer->split_bands_f(0)[i][0], |
| - frame_length); |
| - std::copy(buffer_view.begin(), buffer_view.end(), (*frame)[i].begin()); |
| - } |
| + rtc::ArrayView<float> buffer_view(&buffer->channels_f()[0][0], frame_length); |
| + std::copy(buffer_view.begin(), buffer_view.end(), (*frame)[0].begin()); |
| } |
| // [B,A] = butter(2,100/4000,'high') |
| @@ -182,10 +179,9 @@ EchoCanceller3::RenderWriter::~RenderWriter() = default; |
| bool EchoCanceller3::RenderWriter::Insert(AudioBuffer* input) { |
| RTC_DCHECK_EQ(1, input->num_channels()); |
| - RTC_DCHECK_EQ(num_bands_, input->num_bands()); |
| RTC_DCHECK_EQ(frame_length_, input->num_frames_per_band()); |
| data_dumper_->DumpWav("aec3_render_input", frame_length_, |
| - &input->split_bands_f(0)[0][0], |
| + &input->channels_f()[0][0], |
| LowestBandRate(sample_rate_hz_), 1); |
| CopyAudioBufferIntoFrame(input, num_bands_, frame_length_, |