Index: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
index 715f8ff5758df847477e2a78e761081eafe33871..2b896aeb78d31288a904dd862928b14126279a3d 100644 |
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc |
@@ -118,6 +118,7 @@ VP8EncoderImpl::VP8EncoderImpl() |
feedback_mode_(false), |
qp_max_(56), // Setting for max quantizer. |
cpu_speed_default_(-6), |
+ number_of_cores_(0), |
rc_max_intra_target_(0), |
token_partitions_(VP8_ONE_TOKENPARTITION), |
down_scale_requested_(false), |
@@ -357,6 +358,7 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst, |
feedback_mode_ = inst->VP8().feedbackModeOn; |
+ number_of_cores_ = number_of_cores; |
timestamp_ = 0; |
codec_ = *inst; |
rate_allocator_.reset(new SimulcastRateAllocator(codec_)); |
@@ -567,9 +569,10 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst, |
int VP8EncoderImpl::SetCpuSpeed(int width, int height) { |
#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) || defined(ANDROID) |
- // On mobile platform, always set to -12 to leverage between cpu usage |
- // and video quality. |
- return -12; |
+ // On mobile platform, use a lower speed setting for lower resolutions for |
+ // CPUs with 4 or more cores. |
+ RTC_DCHECK_GT(number_of_cores_, 0); |
+ return (number_of_cores_ >= 4 && width * height <= 352 * 288) ? -10 : -12; |
AlexG
2016/10/31 19:15:31
May be use -10 for VGA as well? For 352 x 288 use
marpan
2016/10/31 20:07:54
Agree to use -8 for low resolutions and -10 otherw
åsapersson
2016/10/31 21:56:38
Done.
åsapersson
2016/10/31 21:56:38
Did you mean -10 for > VGA?
marpan
2016/10/31 22:32:20
sorry i meant -10 for VGA
|
#else |
// For non-ARM, increase encoding complexity (i.e., use lower speed setting) |
// if resolution is below CIF. Otherwise, keep the default/user setting |