Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: webrtc/modules/audio_processing/audio_buffer.cc

Issue 1571013002: Remove additional channel constraints when Beamforming is enabled in AudioProcessing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebasing Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/media/webrtc/fakewebrtcvoiceengine.h ('k') | webrtc/modules/audio_processing/audio_processing_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/audio_buffer.cc
diff --git a/webrtc/modules/audio_processing/audio_buffer.cc b/webrtc/modules/audio_processing/audio_buffer.cc
index c1c4061f4884c727866fd185ec394974a4ed7bb8..77bda79a0c49411b43f3151b78addd48b92f8eaf 100644
--- a/webrtc/modules/audio_processing/audio_buffer.cc
+++ b/webrtc/modules/audio_processing/audio_buffer.cc
@@ -150,7 +150,7 @@ void AudioBuffer::CopyFrom(const float* const* data,
void AudioBuffer::CopyTo(const StreamConfig& stream_config,
float* const* data) {
assert(stream_config.num_frames() == output_num_frames_);
- assert(stream_config.num_channels() == num_channels_);
+ assert(stream_config.num_channels() == num_channels_ || num_channels_ == 1);
// Convert to the float range.
float* const* data_ptr = data;
@@ -173,6 +173,11 @@ void AudioBuffer::CopyTo(const StreamConfig& stream_config,
output_num_frames_);
}
}
+
+ // Upmix.
+ for (int i = num_channels_; i < stream_config.num_channels(); ++i) {
+ memcpy(data[i], data[0], output_num_frames_ * sizeof(**data));
+ }
}
void AudioBuffer::InitForNewData() {
« no previous file with comments | « talk/media/webrtc/fakewebrtcvoiceengine.h ('k') | webrtc/modules/audio_processing/audio_processing_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698