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

Side by Side Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h

Issue 1234463003: Integrate Intelligibility with APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updated interface, how VAD is used, other issues 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // constrained by a limit on the magnitude of the changes. 140 // constrained by a limit on the magnitude of the changes.
141 class GainApplier { 141 class GainApplier {
142 public: 142 public:
143 GainApplier(int freqs, float change_limit); 143 GainApplier(int freqs, float change_limit);
144 144
145 // Copy |in_block| to |out_block|, multiplied by the current set of gains, 145 // Copy |in_block| to |out_block|, multiplied by the current set of gains,
146 // and step the current set of gains towards the target set. 146 // and step the current set of gains towards the target set.
147 void Apply(const std::complex<float>* in_block, 147 void Apply(const std::complex<float>* in_block,
148 std::complex<float>* out_block); 148 std::complex<float>* out_block);
149 149
150 // Resets all target gain factors to 1.
151 void Clear();
152
153 // Returns true if all current and target gain factors are 1.
154 bool IsIdentity();
155
150 // Return the current target gain set. Modify this array to set the targets. 156 // Return the current target gain set. Modify this array to set the targets.
151 float* target() const { return target_.get(); } 157 float* target() const { return target_.get(); }
152 158
153 private: 159 private:
154 const int freqs_; 160 const int freqs_;
155 const float change_limit_; 161 const float change_limit_;
156 rtc::scoped_ptr<float[]> target_; 162 rtc::scoped_ptr<float[]> target_;
157 rtc::scoped_ptr<float[]> current_; 163 rtc::scoped_ptr<float[]> current_;
158 }; 164 };
159 165
160 } // namespace intelligibility 166 } // namespace intelligibility
161 167
162 } // namespace webrtc 168 } // namespace webrtc
163 169
164 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS _H_ 170 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698