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

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: 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"
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // processing. It is being introduced gradually and until it is fully 245 // processing. It is being introduced gradually and until it is fully
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 {
255 LevelController();
256 ~LevelController();
the sun 2016/09/14 10:00:59 is the dtor really necessary?
peah-webrtc 2016/09/16 07:11:07 clang complains if I remove it. So I guess it is n
254 bool enabled = false; 257 bool enabled = false;
258
259 // Sets the initial peak level to use inside the level controller in order
260 // to compute the signal gain. The unit for the peak level is dBFS and
261 // the allowed range is [-100, 0].
262 rtc::Optional<float> initial_level;
the sun 2016/09/14 10:00:59 Why don't we always have an initial level?
peah-webrtc 2016/09/16 07:11:06 We do. One way would be to hardcode the default in
the sun 2016/09/16 08:00:40 If I picture myself as someone who'd consider usin
peah-webrtc 2016/09/16 11:36:05 That is true. I agree.
255 } level_controller; 263 } level_controller;
256 }; 264 };
257 265
258 // TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone. 266 // TODO(mgraczyk): Remove once all methods that use ChannelLayout are gone.
259 enum ChannelLayout { 267 enum ChannelLayout {
260 kMono, 268 kMono,
261 // Left, right. 269 // Left, right.
262 kStereo, 270 kStereo,
263 // Mono, keyboard, and mic. 271 // Mono, keyboard, and mic.
264 kMonoAndKeyboard, 272 kMonoAndKeyboard,
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 // This does not impact the size of frames passed to |ProcessStream()|. 997 // This does not impact the size of frames passed to |ProcessStream()|.
990 virtual int set_frame_size_ms(int size) = 0; 998 virtual int set_frame_size_ms(int size) = 0;
991 virtual int frame_size_ms() const = 0; 999 virtual int frame_size_ms() const = 0;
992 1000
993 protected: 1001 protected:
994 virtual ~VoiceDetection() {} 1002 virtual ~VoiceDetection() {}
995 }; 1003 };
996 } // namespace webrtc 1004 } // namespace webrtc
997 1005
998 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_ 1006 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_PROCESSING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698