Keep track of the user-facing number of channels in a ChannelBuffer
Before this change the ChannelBuffer had a fixed number of channels. This meant for example that when the Beamformer would reduce the number of channels to one, the merging filter bank was still merging all the channels, which was unnecessary since they were not processed and just discarded later. This change doesn't change the signal at all. It just reflects the number of channels in the ChannelBuffer, reducing the complexity.
R=henrik.lundin@webrtc.org, peah@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/2053773002 .
Cr-Commit-Position: refs/heads/master@{#13352}
diff --git a/webrtc/modules/audio_processing/audio_buffer.h b/webrtc/modules/audio_processing/audio_buffer.h
index d90219e..d0e79db 100644
--- a/webrtc/modules/audio_processing/audio_buffer.h
+++ b/webrtc/modules/audio_processing/audio_buffer.h
@@ -123,6 +123,8 @@
void MergeFrequencyBands();
private:
+ FRIEND_TEST_ALL_PREFIXES(AudioBufferTest,
+ SetNumChannelsSetsChannelBuffersNumChannels);
// Called from DeinterleaveFrom() and CopyFrom().
void InitForNewData();