NetEq4: Removing templatization for AudioMultiVector

This saves approx 6% runtime for neteq4_speed_test.
$ time out/Release/neteq4_speed_test --runtime_ms=50000000

BUG=1363
R=minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2320006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4885 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2013-09-30 20:38:44 +00:00
parent 6ad6a07fd3
commit fd11bbfb56
31 changed files with 145 additions and 170 deletions

View File

@ -20,10 +20,10 @@ size_t SyncBuffer::FutureLength() const {
return Size() - next_index_;
}
void SyncBuffer::PushBack(const AudioMultiVector<int16_t>& append_this) {
void SyncBuffer::PushBack(const AudioMultiVector& append_this) {
size_t samples_added = append_this.Size();
AudioMultiVector<int16_t>::PushBack(append_this);
AudioMultiVector<int16_t>::PopFront(samples_added);
AudioMultiVector::PushBack(append_this);
AudioMultiVector::PopFront(samples_added);
if (samples_added <= next_index_) {
next_index_ -= samples_added;
} else {
@ -44,7 +44,7 @@ void SyncBuffer::PushFrontZeros(size_t length) {
void SyncBuffer::InsertZerosAtIndex(size_t length, size_t position) {
position = std::min(position, Size());
length = std::min(length, Size() - position);
AudioMultiVector<int16_t>::PopBack(length);
AudioMultiVector::PopBack(length);
for (size_t channel = 0; channel < Channels(); ++channel) {
channels_[channel]->InsertZerosAt(length, position);
}
@ -58,15 +58,15 @@ void SyncBuffer::InsertZerosAtIndex(size_t length, size_t position) {
}
}
void SyncBuffer::ReplaceAtIndex(const AudioMultiVector<int16_t>& insert_this,
void SyncBuffer::ReplaceAtIndex(const AudioMultiVector& insert_this,
size_t length,
size_t position) {
position = std::min(position, Size()); // Cap |position| in the valid range.
length = std::min(length, Size() - position);
AudioMultiVector<int16_t>::OverwriteAt(insert_this, length, position);
AudioMultiVector::OverwriteAt(insert_this, length, position);
}
void SyncBuffer::ReplaceAtIndex(const AudioMultiVector<int16_t>& insert_this,
void SyncBuffer::ReplaceAtIndex(const AudioMultiVector& insert_this,
size_t position) {
ReplaceAtIndex(insert_this, insert_this.Size(), position);
}