Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: webrtc/modules/video_coding/rtp_frame_reference_finder.cc

Issue 2036913003: Use picture id to check continuity between frames. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/rtp_frame_reference_finder.cc
diff --git a/webrtc/modules/video_coding/rtp_frame_reference_finder.cc b/webrtc/modules/video_coding/rtp_frame_reference_finder.cc
index 2ddfada74e5e7763d5810538d84230894437568f..f313509cf13c0e0565537168ccc2dac0d1f07b9e 100644
--- a/webrtc/modules/video_coding/rtp_frame_reference_finder.cc
+++ b/webrtc/modules/video_coding/rtp_frame_reference_finder.cc
@@ -69,7 +69,21 @@ void RtpFrameReferenceFinder::RetryStashedFrames() {
}
void RtpFrameReferenceFinder::ManageFrameGeneric(
- std::unique_ptr<RtpFrameObject> frame) {
+ std::unique_ptr<RtpFrameObject> frame,
+ int picture_id) {
+ // If |picture_id| is specified then we use that to set the frame references,
+ // otherwise we use sequence number.
+ if (picture_id != -1) {
pbos-webrtc 2016/06/03 13:26:55 Can't this check kNoPictureId?
philipel 2016/06/03 14:17:14 Done.
+ if (last_unwrap_ == -1)
+ last_unwrap_ = picture_id;
+
+ frame->picture_id = UnwrapPictureId(picture_id % kPicIdLength);
+ frame->num_references = frame->frame_type() == kVideoFrameKey ? 0 : 1;
+ frame->references[0] = frame->picture_id - 1;
+ frame_callback_->OnCompleteFrame(std::move(frame));
+ return;
+ }
+
if (frame->frame_type() == kVideoFrameKey)
last_seq_num_gop_[frame->last_seq_num()] = frame->last_seq_num();
@@ -125,7 +139,10 @@ void RtpFrameReferenceFinder::ManageFrameVp8(
if (codec_header.pictureId == kNoPictureId ||
codec_header.temporalIdx == kNoTemporalIdx ||
codec_header.tl0PicIdx == kNoTl0PicIdx) {
- ManageFrameGeneric(std::move(frame));
+ if (codec_header.pictureId != kNoPictureId)
+ ManageFrameGeneric(std::move(frame), codec_header.pictureId);
+ else
+ ManageFrameGeneric(std::move(frame));
return;
}
@@ -266,8 +283,12 @@ void RtpFrameReferenceFinder::ManageFrameVp9(
const RTPVideoHeaderVP9& codec_header = rtp_codec_header->VP9;
- if (codec_header.picture_id == kNoPictureId) {
- ManageFrameGeneric(std::move(frame));
+ if (codec_header.picture_id == kNoPictureId ||
+ codec_header.temporal_idx == kNoTemporalIdx) {
+ if (codec_header.picture_id != kNoPictureId)
+ ManageFrameGeneric(std::move(frame), codec_header.picture_id);
+ else
+ ManageFrameGeneric(std::move(frame));
return;
}

Powered by Google App Engine
This is Rietveld 408576698