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}
This commit is contained in:
Alejandro Luebs
2016-06-30 15:33:37 -07:00
parent e59122889f
commit a181c9ad17
11 changed files with 158 additions and 14 deletions

View File

@ -123,6 +123,8 @@ class AudioBuffer {
void MergeFrequencyBands();
private:
FRIEND_TEST_ALL_PREFIXES(AudioBufferTest,
SetNumChannelsSetsChannelBuffersNumChannels);
// Called from DeinterleaveFrom() and CopyFrom().
void InitForNewData();