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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h

Issue 2029593002: Update RateStatistics to handle too-little-data case. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comment Created 4 years, 6 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_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_ 11 #ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_
12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_ 12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_
13 13
14 #include "webrtc/base/optional.h"
14 #include "webrtc/typedefs.h" 15 #include "webrtc/typedefs.h"
15 16
16 #define BWE_MAX(a, b) ((a) > (b) ? (a) : (b)) 17 #define BWE_MAX(a, b) ((a) > (b) ? (a) : (b))
17 #define BWE_MIN(a, b) ((a) < (b) ? (a) : (b)) 18 #define BWE_MIN(a, b) ((a) < (b) ? (a) : (b))
18 19
19 namespace webrtc { 20 namespace webrtc {
20 21
21 static const int64_t kBitrateWindowMs = 1000; 22 static const int64_t kBitrateWindowMs = 1000;
22 23
23 enum BandwidthUsage { 24 enum BandwidthUsage {
24 kBwNormal = 0, 25 kBwNormal = 0,
25 kBwUnderusing = 1, 26 kBwUnderusing = 1,
26 kBwOverusing = 2, 27 kBwOverusing = 2,
27 }; 28 };
28 29
29 enum RateControlState { kRcHold, kRcIncrease, kRcDecrease }; 30 enum RateControlState { kRcHold, kRcIncrease, kRcDecrease };
30 31
31 enum RateControlRegion { kRcNearMax, kRcAboveMax, kRcMaxUnknown }; 32 enum RateControlRegion { kRcNearMax, kRcAboveMax, kRcMaxUnknown };
32 33
33 struct RateControlInput { 34 struct RateControlInput {
34 RateControlInput(BandwidthUsage bw_state, 35 RateControlInput(BandwidthUsage bw_state,
35 uint32_t incoming_bitrate, 36 const rtc::Optional<uint32_t>& incoming_bitrate,
36 double noise_var) 37 double noise_var)
37 : bw_state(bw_state), 38 : bw_state(bw_state),
38 incoming_bitrate(incoming_bitrate), 39 incoming_bitrate(incoming_bitrate),
39 noise_var(noise_var) {} 40 noise_var(noise_var) {}
40 41
41 BandwidthUsage bw_state; 42 BandwidthUsage bw_state;
42 uint32_t incoming_bitrate; 43 rtc::Optional<uint32_t> incoming_bitrate;
43 double noise_var; 44 double noise_var;
44 }; 45 };
45 } // namespace webrtc 46 } // namespace webrtc
46 47
47 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_ 48 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_BWE_DEFINES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698