Mitigate RTP pic ID errors in VP9 SVC non-flexible mode

The code changes in this CL configure VP9 SVC to drop a superframe when
the spatial base layer is dropped and to not drop upper spatial layers
when the spatial base layer is not dropped. The changes are effective in
non-flexible mode when codec_.mode == kRealtimeVideo and
number of spatial layers > 1.

Bug: none
Change-Id: I27481b78f733cfc6c007d1ad9f45d69263853149
Reviewed-on: https://webrtc-review.googlesource.com/74261
Commit-Queue: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23127}
This commit is contained in:
“Michael
2018-05-04 08:37:40 -05:00
committed by Commit Bot
parent ec6e550a8f
commit e8492fee6b

View File

@ -602,6 +602,19 @@ int VP9EncoderImpl::Encode(const VideoFrame& input_image,
layer_id.spatial_layer_id = settings.start_layer;
vpx_codec_control(encoder_, VP9E_SET_SVC_LAYER_ID, &layer_id);
vpx_codec_control(encoder_, VP9E_SET_SVC_REF_FRAME_CONFIG, &enc_layer_conf);
} else if (codec_.mode == kRealtimeVideo && num_spatial_layers_ > 1) {
// In RTP non-flexible mode, frame dropping of individual layers in a
// superframe leads to incorrect reference picture ID values in the
// RTP header. Dropping the entire superframe if the base is dropped
// or not dropping upper layers if base is not dropped mitigates
// the problem.
vpx_svc_frame_drop_t svc_drop_frame;
svc_drop_frame.framedrop_mode = CONSTRAINED_LAYER_DROP;
for (size_t i = 0; i < num_spatial_layers_; ++i) {
svc_drop_frame.framedrop_thresh[i] =
(i == 0) ? config_->rc_dropframe_thresh : 0;
}
vpx_codec_control(encoder_, VP9E_SET_SVC_FRAME_DROP_LAYER, &svc_drop_frame);
}
RTC_CHECK_GT(codec_.maxFramerate, 0);