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

Side by Side Diff: webrtc/modules/video_coding/rtp_frame_reference_finder.cc

Issue 2990463002: [EXPERIMENTAL] Generic stereo codec with index header sending merged frames
Patch Set: Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return ManageFrameVp9(frame); 93 return ManageFrameVp9(frame);
94 // Since the EndToEndTests use kVicdeoCodecUnknow we treat it the same as 94 // Since the EndToEndTests use kVicdeoCodecUnknow we treat it the same as
95 // kVideoCodecGeneric. 95 // kVideoCodecGeneric.
96 // TODO(philipel): Take a look at the EndToEndTests and see if maybe they 96 // TODO(philipel): Take a look at the EndToEndTests and see if maybe they
97 // should be changed to use kVideoCodecGeneric instead. 97 // should be changed to use kVideoCodecGeneric instead.
98 case kVideoCodecUnknown: 98 case kVideoCodecUnknown:
99 case kVideoCodecH264: 99 case kVideoCodecH264:
100 case kVideoCodecI420: 100 case kVideoCodecI420:
101 case kVideoCodecGeneric: 101 case kVideoCodecGeneric:
102 return ManageFrameGeneric(frame, kNoPictureId); 102 return ManageFrameGeneric(frame, kNoPictureId);
103 case kVideoCodecStereo:
104 return ManageFrameVp9(frame);
103 } 105 }
104 106
105 // If not all code paths return a value it makes the win compiler sad. 107 // If not all code paths return a value it makes the win compiler sad.
106 RTC_NOTREACHED(); 108 RTC_NOTREACHED();
107 return kDrop; 109 return kDrop;
108 } 110 }
109 111
110 void RtpFrameReferenceFinder::PaddingReceived(uint16_t seq_num) { 112 void RtpFrameReferenceFinder::PaddingReceived(uint16_t seq_num) {
111 rtc::CritScope lock(&crit_); 113 rtc::CritScope lock(&crit_);
112 auto clean_padding_to = 114 auto clean_padding_to =
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 RTC_DCHECK(rtp_codec_header); 399 RTC_DCHECK(rtp_codec_header);
398 const RTPVideoHeaderVP9& codec_header = rtp_codec_header->VP9; 400 const RTPVideoHeaderVP9& codec_header = rtp_codec_header->VP9;
399 401
400 bool old_frame = Vp9PidTl0Fix(*frame, &rtp_codec_header->VP9.picture_id, 402 bool old_frame = Vp9PidTl0Fix(*frame, &rtp_codec_header->VP9.picture_id,
401 &rtp_codec_header->VP9.tl0_pic_idx); 403 &rtp_codec_header->VP9.tl0_pic_idx);
402 if (old_frame) 404 if (old_frame)
403 return kDrop; 405 return kDrop;
404 406
405 if (codec_header.picture_id == kNoPictureId || 407 if (codec_header.picture_id == kNoPictureId ||
406 codec_header.temporal_idx == kNoTemporalIdx) { 408 codec_header.temporal_idx == kNoTemporalIdx) {
407 return ManageFrameGeneric(std::move(frame), codec_header.picture_id); 409 return ManageFrameGeneric(std::move(frame), kNoPictureId);
408 } 410 }
409 411
410 frame->spatial_layer = codec_header.spatial_idx; 412 frame->spatial_layer = codec_header.spatial_idx;
411 frame->inter_layer_predicted = codec_header.inter_layer_predicted; 413 frame->inter_layer_predicted = codec_header.inter_layer_predicted;
412 frame->picture_id = codec_header.picture_id % kPicIdLength; 414 frame->picture_id = codec_header.picture_id % kPicIdLength;
413
414 if (last_unwrap_ == -1) 415 if (last_unwrap_ == -1)
415 last_unwrap_ = codec_header.picture_id; 416 last_unwrap_ = codec_header.picture_id;
416 417
417 if (last_picture_id_ == -1) 418 if (last_picture_id_ == -1)
418 last_picture_id_ = frame->picture_id; 419 last_picture_id_ = frame->picture_id;
419 420
420 if (codec_header.flexible_mode) { 421 if (codec_header.flexible_mode) {
421 frame->num_references = codec_header.num_ref_pics; 422 frame->num_references = codec_header.num_ref_pics;
422 for (size_t i = 0; i < frame->num_references; ++i) { 423 for (size_t i = 0; i < frame->num_references; ++i) {
423 frame->references[i] = 424 frame->references[i] =
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 if (!gof_info_.empty() && 747 if (!gof_info_.empty() &&
747 AheadOf<uint8_t>(gof_info_.begin()->first, fixed_tl0)) { 748 AheadOf<uint8_t>(gof_info_.begin()->first, fixed_tl0)) {
748 return true; 749 return true;
749 } 750 }
750 } 751 }
751 return false; 752 return false;
752 } 753 }
753 754
754 } // namespace video_coding 755 } // namespace video_coding
755 } // namespace webrtc 756 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/packet_buffer.cc ('k') | webrtc/modules/video_coding/video_codec_initializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698