video_coding: Updating sync state based on the layer flag

Review URL: http://webrtc-codereview.appspot.com/333004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1236 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org 2011-12-19 18:53:05 +00:00
parent 303158588b
commit 884d8e7f4b

View File

@ -121,8 +121,7 @@ void VCMDecodingState::UpdateSyncState(const VCMFrameBuffer* frame) {
if (frame->TemporalId() == kNoTemporalIdx || if (frame->TemporalId() == kNoTemporalIdx ||
frame->Tl0PicId() == kNoTl0PicIdx) { frame->Tl0PicId() == kNoTl0PicIdx) {
full_sync_ = true; full_sync_ = true;
} else if (frame->FrameType() == kVideoFrameKey || } else if (frame->FrameType() == kVideoFrameKey || frame->LayerSync()) {
frame->NonReference()) {
full_sync_ = true; full_sync_ = true;
} else if (full_sync_) { } else if (full_sync_) {
// Verify that we are still in sync. // Verify that we are still in sync.
@ -149,7 +148,9 @@ bool VCMDecodingState::ContinuousFrame(const VCMFrameBuffer* frame) const {
if (!ContinuousLayer(frame->TemporalId(), frame->Tl0PicId())) { if (!ContinuousLayer(frame->TemporalId(), frame->Tl0PicId())) {
// Base layers are not continuous or temporal layers are inactive. // Base layers are not continuous or temporal layers are inactive.
if (!full_sync_) // In the presence of temporal layers, check for Picture ID/sequence number
// continuity if sync can be restored by this frame.
if (!full_sync_ && !frame->LayerSync())
return false; return false;
else if (!ContinuousPictureId(frame->PictureId())) else if (!ContinuousPictureId(frame->PictureId()))
return ContinuousSeqNum(static_cast<uint16_t>(frame->GetLowSeqNum())); return ContinuousSeqNum(static_cast<uint16_t>(frame->GetLowSeqNum()));
@ -193,7 +194,7 @@ bool VCMDecodingState::ContinuousLayer(int temporal_id,
temporal_id == 0) temporal_id == 0)
return true; return true;
// Current implementation: applicable for base layer only. // Current implementation: Look for base layer continuity.
if (temporal_id != 0) if (temporal_id != 0)
return false; return false;
return (static_cast<uint8_t>(tl0_pic_id_ + 1) == return (static_cast<uint8_t>(tl0_pic_id_ + 1) ==