Remove the use of AudioFrame::energy_ from AudioProcessing and VoE.

We want to remove energy_ entirely as we've seen that carrying around
this potentially invalid value is dangerous.

Results in the removal of AudioBuffer::is_muted(). This wasn't used in
practice any longer, after the level calculation moved directly to
channel.cc

Instead, now use ProcessMuted() in channel.cc, to shortcut the level
computation when the signal is muted.

BUG=3315
TESTED=Muting the channel in voe_cmd_test results in rms=127.
R=bjornv@webrtc.org, kwiberg@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6159 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org
2014-05-14 19:00:59 +00:00
parent 688ed699e0
commit 21299d4e00
9 changed files with 21 additions and 41 deletions

View File

@ -12,6 +12,7 @@
#include "webrtc/modules/audio_processing/audio_buffer.h"
#include "webrtc/modules/audio_processing/include/audio_processing.h"
#include "webrtc/modules/audio_processing/rms_level.h"
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
namespace webrtc {
@ -29,13 +30,8 @@ int LevelEstimatorImpl::ProcessStream(AudioBuffer* audio) {
}
RMSLevel* rms_level = static_cast<RMSLevel*>(handle(0));
if (audio->is_muted()) {
rms_level->ProcessMuted(audio->samples_per_channel() *
audio->num_channels());
} else {
for (int i = 0; i < audio->num_channels(); ++i) {
rms_level->Process(audio->data(i), audio->samples_per_channel());
}
for (int i = 0; i < audio->num_channels(); ++i) {
rms_level->Process(audio->data(i), audio->samples_per_channel());
}
return AudioProcessing::kNoError;