Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1412)

Unified Diff: webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc

Issue 1589953002: Removing webrtc::AudioFrame::energy_. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: after review Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc
diff --git a/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc b/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc
index 9c5d3b939d951c6ee8ac9d20c7a62cd5ea573b35..1e679af914b3664746971037a6a2b7cc7a60f0bc 100644
--- a/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc
+++ b/webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.cc
@@ -39,16 +39,16 @@ const size_t rampSize = sizeof(rampArray)/sizeof(rampArray[0]);
} // namespace
namespace webrtc {
-void CalculateEnergy(AudioFrame& audioFrame)
+uint32_t CalculateEnergy(const AudioFrame& audioFrame)
{
- audioFrame.energy_ = 0;
+ uint32_t energy = 0;
for(size_t position = 0; position < audioFrame.samples_per_channel_;
position++)
{
// TODO(andrew): this can easily overflow.
- audioFrame.energy_ += audioFrame.data_[position] *
- audioFrame.data_[position];
+ energy += audioFrame.data_[position] * audioFrame.data_[position];
}
+ return energy;
}
void RampIn(AudioFrame& audioFrame)
« no previous file with comments | « webrtc/modules/audio_conference_mixer/source/audio_frame_manipulator.h ('k') | webrtc/modules/include/module_common_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698