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

Unified Diff: remoting/base/encoder_vp8.cc

Issue 7084013: Update VP8 encode options to speed up encoding for remoting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: done Created 9 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 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/base/encoder_vp8.cc
diff --git a/remoting/base/encoder_vp8.cc b/remoting/base/encoder_vp8.cc
index 0bba179a97cd397ef3b6002163ea013053fcf0f2..c1bb814dc957feab2d5d9af1ca9443d0e41aa7b4 100644
--- a/remoting/base/encoder_vp8.cc
+++ b/remoting/base/encoder_vp8.cc
@@ -99,14 +99,19 @@ bool EncoderVp8::Init(const gfx::Size& size) {
active_map_height_ = (size.height() + kMacroBlockSize - 1) / kMacroBlockSize;
active_map_.reset(new uint8[active_map_width_ * active_map_height_]);
- // TODO(hclam): Tune the parameters to better suit the application.
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;
- config.g_profile = 1;
- config.g_threads = 1;
+
+ // Value of 2 means using the real time profile. This is basically a
+ // redundant option since we explicitly select real time mode when doing
+ // encoding.
+ config.g_profile = 2;
Wez 2011/06/20 19:55:01 Is the value 2 not defined somewhere as e.g. kVpxR
Alpha Left Google 2011/06/20 20:02:08 The value is not defined in the VP8 API. It basica
+
+ // Use 2 threads to do encoding.
+ config.g_threads = 2;
Wez 2011/06/20 19:55:01 nit: Why use 2, not 3 or 4 or 7? I'd expect a com
Lambros 2011/06/20 20:02:07 Drive-by: I'd also like to know where the numbers
config.rc_min_quantizer = 20;
config.rc_max_quantizer = 30;
config.g_timebase.num = 1;
@@ -114,6 +119,16 @@ bool EncoderVp8::Init(const gfx::Size& size) {
if (vpx_codec_enc_init(codec_.get(), algo, &config, 0))
return false;
+
+ // Value of 16 will have the smallest CPU load. This turns off subpixel
+ // motion search.
+ if (vpx_codec_control(codec_.get(), VP8E_SET_CPUUSED, 16))
+ return false;
+
+ // Use the lowest level of noise sensitivity so as to spend less time
+ // on motion estimation and inter-prediction mode.
+ if (vpx_codec_control(codec_.get(), VP8E_SET_NOISE_SENSITIVITY, 0))
+ return false;
return true;
}
« 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