Index: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
index 04bbd161ec699338a2a36ac9a6f912ee39207132..1f67e9a48cf1cb61e76ba72aa1f175e8f74b989b 100644 |
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc |
@@ -212,8 +212,8 @@ int VP9EncoderImpl::InitEncode(const VideoCodec* inst, |
if (inst->codecSpecific.VP9.numberOfTemporalLayers > 3) { |
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; |
} |
- // For now, only support one spatial layer. |
- if (inst->codecSpecific.VP9.numberOfSpatialLayers != 1) { |
+ // libvpx currently supports only one or two spatial layers. |
+ if (inst->codecSpecific.VP9.numberOfSpatialLayers > 2) { |
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; |
} |
int retVal = Release(); |
@@ -351,12 +351,11 @@ int VP9EncoderImpl::NumberOfThreads(int width, |
} |
int VP9EncoderImpl::InitAndSetControlSettings(const VideoCodec* inst) { |
- |
config_->ss_number_layers = num_spatial_layers_; |
if (num_spatial_layers_ > 1) { |
mflodman
2015/08/27 07:27:48
I don't know the background for when to set min qp
ivica
2015/08/27 08:49:23
I don't know why was it set to 0 here. I removed t
|
config_->rc_min_quantizer = 0; |
- config_->rc_max_quantizer = 63; |
+ config_->rc_max_quantizer = 52; |
mflodman
2015/08/27 07:27:48
AFAICT this isn't needed, the max quantizer is alr
ivica
2015/08/27 08:49:23
I changed from 63 to 52, because 63 looks really b
|
} |
int scaling_factor_num = 256; |
for (int i = num_spatial_layers_ - 1; i >= 0; --i) { |
@@ -404,6 +403,10 @@ int VP9EncoderImpl::InitAndSetControlSettings(const VideoCodec* inst) { |
vpx_codec_control(encoder_, VP9E_SET_NOISE_SENSITIVITY, |
inst->codecSpecific.VP9.denoisingOn ? 1 : 0); |
#endif |
+ if (codec_.mode == kScreensharing) { |
+ vpx_codec_control(encoder_, VP9E_SET_TUNE_CONTENT, 1); |
+ } |
+ vpx_codec_control(encoder_, VP8E_SET_STATIC_THRESHOLD, 1); |
inited_ = true; |
return WEBRTC_VIDEO_CODEC_OK; |
} |
@@ -540,8 +543,9 @@ void VP9EncoderImpl::PopulateCodecSpecific(CodecSpecificInfo* codec_specific, |
vp9_info->tl0_pic_idx = tl0_pic_idx_; |
} |
+ // Always populate this, so that packetizer can properly set the marker bit. |
+ vp9_info->num_spatial_layers = num_spatial_layers_; |
if (vp9_info->ss_data_available) { |
- vp9_info->num_spatial_layers = num_spatial_layers_; |
vp9_info->spatial_layer_resolution_present = true; |
for (size_t i = 0; i < vp9_info->num_spatial_layers; ++i) { |
vp9_info->width[i] = codec_.width * |