Chromium Code Reviews| Index: content/renderer/media/video_track_recorder.cc |
| diff --git a/content/renderer/media/video_track_recorder.cc b/content/renderer/media/video_track_recorder.cc |
| index 82ae3ea9ba7dc9ed25e19f9277f1e0fd758de253..0f6657f7f1512675609c5a4fa51174b1b1b91486 100644 |
| --- a/content/renderer/media/video_track_recorder.cc |
| +++ b/content/renderer/media/video_track_recorder.cc |
| @@ -260,9 +260,8 @@ void VideoTrackRecorder::VpxEncoder::ConfigureEncoding(const gfx::Size& size) { |
| const vpx_codec_iface_t* interface = |
| use_vp9_ ? vpx_codec_vp9_cx() : vpx_codec_vp8_cx(); |
| - const vpx_codec_err_t result = vpx_codec_enc_config_default(interface, |
| - &codec_config_, |
| - 0 /* reserved */); |
| + vpx_codec_err_t result = |
| + vpx_codec_enc_config_default(interface, &codec_config_, 0 /* reserved */); |
| DCHECK_EQ(VPX_CODEC_OK, result); |
| DCHECK_EQ(320u, codec_config_.g_w); |
| @@ -285,6 +284,17 @@ void VideoTrackRecorder::VpxEncoder::ConfigureEncoding(const gfx::Size& size) { |
| // DCHECK that the profile selected by default is I420 (magic number 0). |
| DCHECK_EQ(0u, codec_config_.g_profile); |
| + |
| + // Request the lowest-CPU usage that VP9 supports. Values greater than 0 |
| + // will increase encoder speed at the expense of quality. Note that this is |
| + // configured via the same parameter as for VP8. |
| + const int kCpuUsage = 6; |
| + result = vpx_codec_control(encoder_.get(), VP8E_SET_CPUUSED, kCpuUsage); |
|
miu
2016/02/25 20:22:09
6 is actually a high-end setting (4 being the high
mcasas
2016/02/26 01:34:32
Let's go for a compromise of 10. Users can still u
|
| + DLOG_IF(WARNING, VPX_CODEC_OK != result) << "Failed to set CPUUSED"; |
| + |
| + // Clamping the quantizer constrains the worst-case quality and CPU usage. |
| + codec_config_.rc_min_quantizer = 20; |
|
miu
2016/02/25 20:22:09
When you clamp the quantizer values this way, the
mcasas
2016/02/26 01:34:32
Done.
|
| + codec_config_.rc_max_quantizer = 30; |
| } else { |
| // VP8 always produces frames instantaneously. |
| DCHECK_EQ(0u, codec_config_.g_lag_in_frames); |