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

Side by Side Diff: webrtc/common_video/include/bitrate_adjuster.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 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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 29 matching lines...) Expand all
40 40
41 // Sets the desired bitrate in bps (bits per second). 41 // Sets the desired bitrate in bps (bits per second).
42 // Should be called at least once before Update. 42 // Should be called at least once before Update.
43 void SetTargetBitrateBps(uint32_t bitrate_bps); 43 void SetTargetBitrateBps(uint32_t bitrate_bps);
44 uint32_t GetTargetBitrateBps() const; 44 uint32_t GetTargetBitrateBps() const;
45 45
46 // Returns the adjusted bitrate in bps. 46 // Returns the adjusted bitrate in bps.
47 uint32_t GetAdjustedBitrateBps() const; 47 uint32_t GetAdjustedBitrateBps() const;
48 48
49 // Returns what we think the current bitrate is. 49 // Returns what we think the current bitrate is.
50 uint32_t GetEstimatedBitrateBps(); 50 rtc::Optional<uint32_t> GetEstimatedBitrateBps();
51 51
52 // This should be called after each frame is encoded. The timestamp at which 52 // This should be called after each frame is encoded. The timestamp at which
53 // it is called is used to estimate the output bitrate of the encoder. 53 // it is called is used to estimate the output bitrate of the encoder.
54 // Should be called from only one thread. 54 // Should be called from only one thread.
55 void Update(size_t frame_size); 55 void Update(size_t frame_size);
56 56
57 private: 57 private:
58 // Returns true if the bitrate is within kBitrateTolerancePct of bitrate_bps. 58 // Returns true if the bitrate is within kBitrateTolerancePct of bitrate_bps.
59 bool IsWithinTolerance(uint32_t bitrate_bps, uint32_t target_bitrate_bps); 59 bool IsWithinTolerance(uint32_t bitrate_bps, uint32_t target_bitrate_bps);
60 60
(...skipping 19 matching lines...) Expand all
80 RateStatistics bitrate_tracker_ GUARDED_BY(crit_); 80 RateStatistics bitrate_tracker_ GUARDED_BY(crit_);
81 // The last time we tried to adjust the bitrate. 81 // The last time we tried to adjust the bitrate.
82 uint32_t last_bitrate_update_time_ms_ GUARDED_BY(crit_); 82 uint32_t last_bitrate_update_time_ms_ GUARDED_BY(crit_);
83 // The number of frames since the last time we tried to adjust the bitrate. 83 // The number of frames since the last time we tried to adjust the bitrate.
84 uint32_t frames_since_last_update_ GUARDED_BY(crit_); 84 uint32_t frames_since_last_update_ GUARDED_BY(crit_);
85 }; 85 };
86 86
87 } // namespace webrtc 87 } // namespace webrtc
88 88
89 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_ 89 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_BITRATE_ADJUSTER_H_
OLDNEW
« no previous file with comments | « webrtc/common_video/bitrate_adjuster_unittest.cc ('k') | webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698