From 00ac85e2e331c34c1e52f8e26884cfec2b36e3ca Mon Sep 17 00:00:00 2001 From: asapersson Date: Wed, 11 Nov 2015 05:30:48 -0800 Subject: [PATCH] Update temporal up switch field for non-flexible mode according to updates in the RTP payload profile. The U bit is no longer obtained from the SS data. https://tools.ietf.org/id/draft-ietf-payload-vp9-01.txt BUG=chromium:500602 Review URL: https://codereview.webrtc.org/1433273002 Cr-Commit-Position: refs/heads/master@{#10601} --- webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc index 4dd59b268d..5053b64d55 100644 --- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -562,8 +562,6 @@ void VP9EncoderImpl::PopulateCodecSpecific(CodecSpecificInfo* codec_specific, !codec_.codecSpecific.VP9.flexibleMode) ? true : false; - if (pkt.data.frame.flags & VPX_FRAME_IS_KEY) - frames_since_kf_ = 0; vpx_svc_layer_id_t layer_id = {0}; vpx_codec_control(encoder_, VP9E_GET_SVC_LAYER_ID, &layer_id); @@ -601,11 +599,16 @@ void VP9EncoderImpl::PopulateCodecSpecific(CodecSpecificInfo* codec_specific, picture_id_ = (picture_id_ + 1) & 0x7FFF; // TODO(asapersson): this info has to be obtained from the encoder. vp9_info->inter_layer_predicted = false; + ++frames_since_kf_; } else { // TODO(asapersson): this info has to be obtained from the encoder. vp9_info->inter_layer_predicted = true; } + if (pkt.data.frame.flags & VPX_FRAME_IS_KEY) { + frames_since_kf_ = 0; + } + vp9_info->picture_id = picture_id_; if (!vp9_info->flexible_mode) { @@ -629,8 +632,8 @@ void VP9EncoderImpl::PopulateCodecSpecific(CodecSpecificInfo* codec_specific, } else { vp9_info->gof_idx = static_cast(frames_since_kf_ % gof_.num_frames_in_gof); + vp9_info->temporal_up_switch = gof_.temporal_up_switch[vp9_info->gof_idx]; } - ++frames_since_kf_; if (vp9_info->ss_data_available) { vp9_info->spatial_layer_resolution_present = true;