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:
@ -99,7 +99,6 @@ AudioBuffer::AudioBuffer(int input_samples_per_channel,
|
||||
num_mixed_low_pass_channels_(0),
|
||||
reference_copied_(false),
|
||||
activity_(AudioFrame::kVadUnknown),
|
||||
is_muted_(false),
|
||||
data_(NULL),
|
||||
keyboard_data_(NULL),
|
||||
channels_(new ChannelBuffer<int16_t>(proc_samples_per_channel_,
|
||||
@ -223,7 +222,6 @@ void AudioBuffer::InitForNewData() {
|
||||
num_mixed_low_pass_channels_ = 0;
|
||||
reference_copied_ = false;
|
||||
activity_ = AudioFrame::kVadUnknown;
|
||||
is_muted_ = false;
|
||||
}
|
||||
|
||||
const int16_t* AudioBuffer::data(int channel) const {
|
||||
@ -307,10 +305,6 @@ AudioFrame::VADActivity AudioBuffer::activity() const {
|
||||
return activity_;
|
||||
}
|
||||
|
||||
bool AudioBuffer::is_muted() const {
|
||||
return is_muted_;
|
||||
}
|
||||
|
||||
int AudioBuffer::num_channels() const {
|
||||
return num_proc_channels_;
|
||||
}
|
||||
@ -336,9 +330,6 @@ void AudioBuffer::DeinterleaveFrom(AudioFrame* frame) {
|
||||
assert(frame->samples_per_channel_ == proc_samples_per_channel_);
|
||||
InitForNewData();
|
||||
activity_ = frame->vad_activity_;
|
||||
if (frame->energy_ == 0) {
|
||||
is_muted_ = true;
|
||||
}
|
||||
|
||||
if (num_proc_channels_ == 1) {
|
||||
// We can get away with a pointer assignment in this case.
|
||||
|
||||
Reference in New Issue
Block a user