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

Unified Diff: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc

Issue 2489843002: Revert of Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: 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 | « webrtc/modules/video_coding/codecs/vp9/vp9_impl.h ('k') | webrtc/modules/video_coding/generic_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
index 7ab4a79bd2b2d1e569ffbaaf09a0f5346e0c3822..8c798db66529b5131d63aaa218e8c6f419cac2e7 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -77,7 +77,6 @@
frames_since_kf_(0),
num_temporal_layers_(0),
num_spatial_layers_(0),
- is_flexible_mode_(false),
frames_encoded_(0),
// Use two spatial when screensharing with flexible mode.
spatial_layer_(new ScreenshareLayersVP9(2)) {
@@ -194,28 +193,24 @@
return true;
}
-int VP9EncoderImpl::SetRateAllocation(
- const BitrateAllocation& bitrate_allocation,
- uint32_t frame_rate) {
+int VP9EncoderImpl::SetRates(uint32_t new_bitrate_kbit,
+ uint32_t new_framerate) {
if (!inited_) {
return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
}
if (encoder_->err) {
return WEBRTC_VIDEO_CODEC_ERROR;
}
- if (frame_rate < 1) {
+ if (new_framerate < 1) {
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
}
// Update bit rate
- if (codec_.maxBitrate > 0 &&
- bitrate_allocation.get_sum_kbps() > codec_.maxBitrate) {
- return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
- }
-
- // TODO(sprang): Actually use BitrateAllocation layer info.
- config_->rc_target_bitrate = bitrate_allocation.get_sum_kbps();
- codec_.maxFramerate = frame_rate;
- spatial_layer_->ConfigureBitrate(bitrate_allocation.get_sum_kbps(), 0);
+ if (codec_.maxBitrate > 0 && new_bitrate_kbit > codec_.maxBitrate) {
+ new_bitrate_kbit = codec_.maxBitrate;
+ }
+ config_->rc_target_bitrate = new_bitrate_kbit;
+ codec_.maxFramerate = new_framerate;
+ spatial_layer_->ConfigureBitrate(new_bitrate_kbit, 0);
if (!SetSvcRates()) {
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp9/vp9_impl.h ('k') | webrtc/modules/video_coding/generic_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698