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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc

Issue 2529073003: Fix perf regression in screenshare temporal layer bitrate allocation (Closed)
Patch Set: Yet another failing test Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc b/webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc
index a3e65e4ce0d8c159f6ec68ea7bbf407338d4bfc5..7807d45d7aaf70403343d692e9cad9773bde1ede 100644
--- a/webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/realtime_temporal_layers.cc
@@ -179,11 +179,11 @@ class RealTimeTemporalLayers : public TemporalLayers {
uint32_t layer_bitrate = bitrates[i];
RTC_DCHECK_LE(sum, bitrates[i]);
bitrates[i] -= sum;
- sum += layer_bitrate;
+ sum = layer_bitrate;
- if (sum == static_cast<uint32_t>(bitrate_kbps)) {
+ if (sum >= static_cast<uint32_t>(bitrate_kbps)) {
// Sum adds up; any subsequent layers will be 0.
- bitrates.resize(i);
+ bitrates.resize(i + 1);
break;
}
}
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/vp8/screenshare_layers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698