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

Side by Side Diff: webrtc/modules/audio_processing/include/audio_processing.h

Issue 2337083002: Reland of added functionality for specifying the initial signal level to use for the gain estimation (Closed)
Patch Set: Changed parameter name from initial_level to the more correct initial_peak_level Created 4 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
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
13 13
14 // MSVC++ requires this to be set before any other includes to get M_PI. 14 // MSVC++ requires this to be set before any other includes to get M_PI.
15 #define _USE_MATH_DEFINES 15 #define _USE_MATH_DEFINES
16 16
17 #include <math.h> 17 #include <math.h>
18 #include <stddef.h> // size_t 18 #include <stddef.h> // size_t
19 #include <stdio.h> // FILE 19 #include <stdio.h> // FILE
20 #include <vector> 20 #include <vector>
21 21
22 #include "webrtc/base/arraysize.h" 22 #include "webrtc/base/arraysize.h"
23 #include "webrtc/base/optional.h"
the sun 2016/09/16 12:40:24 remove
peah-webrtc 2016/09/19 16:37:10 Done.
23 #include "webrtc/base/platform_file.h" 24 #include "webrtc/base/platform_file.h"
24 #include "webrtc/modules/audio_processing/beamformer/array_util.h" 25 #include "webrtc/modules/audio_processing/beamformer/array_util.h"
25 #include "webrtc/modules/audio_processing/include/config.h" 26 #include "webrtc/modules/audio_processing/include/config.h"
26 #include "webrtc/typedefs.h" 27 #include "webrtc/typedefs.h"
27 28
28 namespace webrtc { 29 namespace webrtc {
29 30
30 struct AecCore; 31 struct AecCore;
31 32
32 class AudioFrame; 33 class AudioFrame;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // introduced, it is prone to change. 246 // introduced, it is prone to change.
246 // TODO(peah): Remove this comment once the new config scheme is fully rolled 247 // TODO(peah): Remove this comment once the new config scheme is fully rolled
247 // out. 248 // out.
248 // 249 //
249 // The parameters and behavior of the audio processing module are controlled 250 // The parameters and behavior of the audio processing module are controlled
250 // by changing the default values in the AudioProcessing::Config struct. 251 // by changing the default values in the AudioProcessing::Config struct.
251 // The config is applied by passing the struct to the ApplyConfig method. 252 // The config is applied by passing the struct to the ApplyConfig method.
252 struct Config { 253 struct Config {
253 struct LevelController { 254 struct LevelController {
254 bool enabled = false; 255 bool enabled = false;
256
257 // Sets the initial peak level to use inside the level controller in order
258 // to compute the signal gain. The unit for the peak level is dBFS and
259 // the allowed range is [-100, 0].
260 float initial_peak_level = -6.0206;
the sun 2016/09/16 12:40:24 -6.0206f adding _db to the parameter name would m
hlundin-webrtc 2016/09/19 12:03:03 Acknowledged.
peah-webrtc 2016/09/19 16:37:10 Done.
peah-webrtc 2016/09/19 16:37:10 Acknowledged.
255 } level_controller; 261 } level_controller;
256 }; 262 };
257 263
258 // TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone. 264 // TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone.
259 enum ChannelLayout { 265 enum ChannelLayout {
260 kMono, 266 kMono,
261 // Left, right. 267 // Left, right.
262 kStereo, 268 kStereo,
263 // Mono, keyboard, and mic. 269 // Mono, keyboard, and mic.
264 kMonoAndKeyboard, 270 kMonoAndKeyboard,
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 // This does not impact the size of frames passed to |ProcessStream()|. 1001 // This does not impact the size of frames passed to |ProcessStream()|.
996 virtual int set_frame_size_ms(int size) = 0; 1002 virtual int set_frame_size_ms(int size) = 0;
997 virtual int frame_size_ms() const = 0; 1003 virtual int frame_size_ms() const = 0;
998 1004
999 protected: 1005 protected:
1000 virtual ~VoiceDetection() {} 1006 virtual ~VoiceDetection() {}
1001 }; 1007 };
1002 } // namespace webrtc 1008 } // namespace webrtc
1003 1009
1004 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ 1010 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698