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

Unified Diff: webrtc/modules/audio_processing/agc/agc.cc

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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
« no previous file with comments | « webrtc/modules/audio_processing/agc/agc.h ('k') | webrtc/modules/audio_processing/agc/agc_manager_direct.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/agc/agc.cc
diff --git a/webrtc/modules/audio_processing/agc/agc.cc b/webrtc/modules/audio_processing/agc/agc.cc
index 80c3e1fe729b75142f686fd880dee2328328cdcd..9786d7bc20ea781fc659f0ca077bbd4154be0af9 100644
--- a/webrtc/modules/audio_processing/agc/agc.cc
+++ b/webrtc/modules/audio_processing/agc/agc.cc
@@ -39,17 +39,17 @@ Agc::Agc()
Agc::~Agc() {}
-float Agc::AnalyzePreproc(const int16_t* audio, int length) {
+float Agc::AnalyzePreproc(const int16_t* audio, size_t length) {
assert(length > 0);
- int num_clipped = 0;
- for (int i = 0; i < length; ++i) {
+ size_t num_clipped = 0;
+ for (size_t i = 0; i < length; ++i) {
if (audio[i] == 32767 || audio[i] == -32768)
++num_clipped;
}
return 1.0f * num_clipped / length;
}
-int Agc::Process(const int16_t* audio, int length, int sample_rate_hz) {
+int Agc::Process(const int16_t* audio, size_t length, int sample_rate_hz) {
vad_.ProcessChunk(audio, length, sample_rate_hz);
const std::vector<double>& rms = vad_.chunkwise_rms();
const std::vector<double>& probabilities =
« no previous file with comments | « webrtc/modules/audio_processing/agc/agc.h ('k') | webrtc/modules/audio_processing/agc/agc_manager_direct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698