summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authoraconverse <aconverse@chromium.org>2015-04-24 14:38:51 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-24 21:38:55 +0000
commitd194235c54b414571f6fbdedf47b00592fbfc690 (patch)
treeaa35ba6e106943045af90cb9fbc89e24fa260b9f /remoting
parent5120892497bc7707e492c045f1afebba3199a640 (diff)
downloadchromium_src-d194235c54b414571f6fbdedf47b00592fbfc690.zip
chromium_src-d194235c54b414571f6fbdedf47b00592fbfc690.tar.gz
chromium_src-d194235c54b414571f6fbdedf47b00592fbfc690.tar.bz2
Switch VP9 lossy to CBR encoding.
CBR is required for cyclic refresh. BUG=134202 Review URL: https://codereview.chromium.org/1079593004 Cr-Commit-Position: refs/heads/master@{#326881}
Diffstat (limited to 'remoting')
-rw-r--r--remoting/codec/video_encoder_vpx.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/remoting/codec/video_encoder_vpx.cc b/remoting/codec/video_encoder_vpx.cc
index e0d768b..724fbec 100644
--- a/remoting/codec/video_encoder_vpx.cc
+++ b/remoting/codec/video_encoder_vpx.cc
@@ -45,10 +45,6 @@ void SetCommonCodecParameters(vpx_codec_enc_cfg_t* config,
config->g_timebase.num = 1;
config->g_timebase.den = 1000;
- // Adjust default target bit-rate to account for actual desktop size.
- config->rc_target_bitrate = size.width() * size.height() *
- config->rc_target_bitrate / config->g_w / config->g_h;
-
config->g_w = size.width();
config->g_h = size.height();
config->g_pass = VPX_RC_ONE_PASS;
@@ -71,6 +67,10 @@ void SetCommonCodecParameters(vpx_codec_enc_cfg_t* config,
void SetVp8CodecParameters(vpx_codec_enc_cfg_t* config,
const webrtc::DesktopSize& size) {
+ // Adjust default target bit-rate to account for actual desktop size.
+ config->rc_target_bitrate = size.width() * size.height() *
+ config->rc_target_bitrate / config->g_w / config->g_h;
+
SetCommonCodecParameters(config, size);
// Value of 2 means using the real time profile. This is basically a
@@ -97,10 +97,14 @@ void SetVp9CodecParameters(vpx_codec_enc_cfg_t* config,
// Disable quantization entirely, putting the encoder in "lossless" mode.
config->rc_min_quantizer = 0;
config->rc_max_quantizer = 0;
+ config->rc_end_usage = VPX_VBR;
} else {
- // Lossy encode using the same settings as for VP8.
- config->rc_min_quantizer = 20;
+ config->rc_min_quantizer = 4;
config->rc_max_quantizer = 30;
+ config->rc_end_usage = VPX_CBR;
+ // In the absence of a good bandwidth estimator set the target bitrate to a
+ // conservative default.
+ config->rc_target_bitrate = 500;
}
}