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

Side by Side Diff: webrtc/modules/audio_conference_mixer/source/level_indicator.cc

Issue 1224123002: Update audio code to use size_t more correctly, webrtc/modules/ portion. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 10 matching lines...) Expand all
21 _currentLevel(0) 21 _currentLevel(0)
22 { 22 {
23 } 23 }
24 24
25 LevelIndicator::~LevelIndicator() 25 LevelIndicator::~LevelIndicator()
26 { 26 {
27 } 27 }
28 28
29 // Level is based on the highest absolute value for all samples. 29 // Level is based on the highest absolute value for all samples.
30 void LevelIndicator::ComputeLevel(const int16_t* speech, 30 void LevelIndicator::ComputeLevel(const int16_t* speech,
31 const uint16_t nrOfSamples) 31 const size_t nrOfSamples)
32 { 32 {
33 int32_t min = 0; 33 int32_t min = 0;
34 for(uint32_t i = 0; i < nrOfSamples; i++) 34 for(size_t i = 0; i < nrOfSamples; i++)
35 { 35 {
36 if(_max < speech[i]) 36 if(_max < speech[i])
37 { 37 {
38 _max = speech[i]; 38 _max = speech[i];
39 } 39 }
40 if(min > speech[i]) 40 if(min > speech[i])
41 { 41 {
42 min = speech[i]; 42 min = speech[i];
43 } 43 }
44 } 44 }
(...skipping 22 matching lines...) Expand all
67 _count++; 67 _count++;
68 } 68 }
69 } 69 }
70 70
71 int32_t LevelIndicator::GetLevel() 71 int32_t LevelIndicator::GetLevel()
72 { 72 {
73 return _currentLevel; 73 return _currentLevel;
74 } 74 }
75 75
76 } // namespace webrtc 76 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_conference_mixer/source/level_indicator.h ('k') | webrtc/modules/interface/module_common_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698