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

Side by Side Diff: webrtc/modules/audio_processing/agc/agc.cc

Issue 1335923002: Add RTC_ prefix to (D)CHECKs and related macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 5 years, 3 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 ++num_clipped; 47 ++num_clipped;
48 } 48 }
49 return 1.0f * num_clipped / length; 49 return 1.0f * num_clipped / length;
50 } 50 }
51 51
52 int Agc::Process(const int16_t* audio, size_t length, int sample_rate_hz) { 52 int Agc::Process(const int16_t* audio, size_t length, int sample_rate_hz) {
53 vad_.ProcessChunk(audio, length, sample_rate_hz); 53 vad_.ProcessChunk(audio, length, sample_rate_hz);
54 const std::vector<double>& rms = vad_.chunkwise_rms(); 54 const std::vector<double>& rms = vad_.chunkwise_rms();
55 const std::vector<double>& probabilities = 55 const std::vector<double>& probabilities =
56 vad_.chunkwise_voice_probabilities(); 56 vad_.chunkwise_voice_probabilities();
57 DCHECK_EQ(rms.size(), probabilities.size()); 57 RTC_DCHECK_EQ(rms.size(), probabilities.size());
58 for (size_t i = 0; i < rms.size(); ++i) { 58 for (size_t i = 0; i < rms.size(); ++i) {
59 histogram_->Update(rms[i], probabilities[i]); 59 histogram_->Update(rms[i], probabilities[i]);
60 } 60 }
61 return 0; 61 return 0;
62 } 62 }
63 63
64 bool Agc::GetRmsErrorDb(int* error) { 64 bool Agc::GetRmsErrorDb(int* error) {
65 if (!error) { 65 if (!error) {
66 assert(false); 66 assert(false);
67 return false; 67 return false;
(...skipping 24 matching lines...) Expand all
92 // limits. The upper limit should be chosen such that the risk of clipping is 92 // limits. The upper limit should be chosen such that the risk of clipping is
93 // low. The lower limit should not result in a too quiet signal. 93 // low. The lower limit should not result in a too quiet signal.
94 if (level >= 0 || level <= -100) 94 if (level >= 0 || level <= -100)
95 return -1; 95 return -1;
96 target_level_dbfs_ = level; 96 target_level_dbfs_ = level;
97 target_level_loudness_ = Dbfs2Loudness(level); 97 target_level_loudness_ = Dbfs2Loudness(level);
98 return 0; 98 return 0;
99 } 99 }
100 100
101 } // namespace webrtc 101 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/mac/audio_device_mac.cc ('k') | webrtc/modules/audio_processing/beamformer/complex_matrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698