NetEq4: Small change to reduce allocs in AudioMultiVector
This change reduced the allocation count by 20000 in the bit-exactness test. BUG=Issue 1363 TEST=out/Debug/modules_unittests --gtest_filter=NetEqDecodingTest.TestBitExactness R=turaj@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2157004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4678 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -73,6 +73,11 @@ template<typename T>
|
||||
void AudioMultiVector<T>::PushBackInterleaved(const T* append_this,
|
||||
size_t length) {
|
||||
assert(length % Channels() == 0);
|
||||
if (Channels() == 1) {
|
||||
// Special case to avoid extra allocation and data shuffling.
|
||||
channels_[0]->PushBack(append_this, length);
|
||||
return;
|
||||
}
|
||||
size_t length_per_channel = length / Channels();
|
||||
T* temp_array = new T[length_per_channel]; // Intermediate storage.
|
||||
for (size_t channel = 0; channel < Channels(); ++channel) {
|
||||
|
Reference in New Issue
Block a user