From c11348b5d7163a040d777d1cfedafde758d461e0 Mon Sep 17 00:00:00 2001 From: "minyue@webrtc.org" Date: Tue, 10 Feb 2015 08:35:38 +0000 Subject: [PATCH] Fixing a bug in expand_rate calculation for stereo signal. BUG= R=henrik.lundin@webrtc.org Review URL: https://webrtc-codereview.appspot.com/41849004 Cr-Commit-Position: refs/heads/master@{#8307} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8307 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_coding/neteq/neteq_impl.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc index a2f7a4190..7ce4238ef 100644 --- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc +++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc @@ -1349,14 +1349,16 @@ void NetEqImpl::DoMerge(int16_t* decoded_buffer, size_t decoded_length, int new_length = merge_->Process(decoded_buffer, decoded_length, mute_factor_array_.get(), algorithm_buffer_.get()); + int expand_length_correction = new_length - + static_cast(decoded_length / algorithm_buffer_->Channels()); // Update in-call and post-call statistics. if (expand_->MuteFactor(0) == 0) { // Expand generates only noise. - stats_.ExpandedNoiseSamples(new_length - static_cast(decoded_length)); + stats_.ExpandedNoiseSamples(expand_length_correction); } else { // Expansion generates more than only noise. - stats_.ExpandedVoiceSamples(new_length - static_cast(decoded_length)); + stats_.ExpandedVoiceSamples(expand_length_correction); } last_mode_ = kModeMerge;