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

Unified Diff: remoting/codec/video_encoder_vpx.cc

Issue 1079593004: Switch VP9 lossy to CBR encoding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/video_encoder_vpx.cc
diff --git a/remoting/codec/video_encoder_vpx.cc b/remoting/codec/video_encoder_vpx.cc
index e0d768b9eedfa13c6cc78a08457131df17fcf240..b9a04e76469dd9ce469ef46ab22b7ddf24a76daa 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
@@ -98,9 +98,10 @@ void SetVp9CodecParameters(vpx_codec_enc_cfg_t* config,
config->rc_min_quantizer = 0;
config->rc_max_quantizer = 0;
} 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;
+ config->rc_target_bitrate = 500;
Wez 2015/04/18 00:00:23 nit: Please add a comment to indicate that we are
aconverse 2015/04/20 17:12:26 Done.
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698