From 557e92515d56b2e5d8f354921e8b037349518ac2 Mon Sep 17 00:00:00 2001 From: "marpan@webrtc.org" Date: Tue, 9 Apr 2013 21:21:32 +0000 Subject: [PATCH] Reapply the reverted r3747. https://code.google.com/p/webrtc/source/detail?r=3747 r3747 timed-out on a tsan test. Verified that it passes the test and reduced the execution time of that test (r3782). TBR=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1292006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3807 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc index 7516d4655..a6be604a7 100644 --- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc +++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc @@ -225,12 +225,12 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst, } config_->g_lag_in_frames = 0; // 0- no frame lagging - // Determining number of threads based on the image size - if (codec_.width * codec_.height > 704 * 576 && number_of_cores > 1) { - // 2 threads when larger than 4CIF - config_->g_threads = 2; + if (codec_.width * codec_.height > 640 * 480 && number_of_cores >= 4) { + config_->g_threads = 4; // 4 threads for qHD/HD. + } else if (codec_.width * codec_.height > 320 * 240 && number_of_cores >= 2) { + config_->g_threads = 2; // 2 threads for HVGA/VGA. } else { - config_->g_threads = 1; + config_->g_threads = 1; // 1 thread for QVGA. } // rate control settings