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

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

Issue 2980943003: RtpFrameReferenceFinder VP8 reference calculation fix. (Closed)
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
« no previous file with comments | « no previous file | webrtc/modules/video_coding/rtp_frame_reference_finder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 if (last_unwrap_ == -1) 258 if (last_unwrap_ == -1)
259 last_unwrap_ = codec_header.pictureId; 259 last_unwrap_ = codec_header.pictureId;
260 260
261 if (last_picture_id_ == -1) 261 if (last_picture_id_ == -1)
262 last_picture_id_ = frame->picture_id; 262 last_picture_id_ = frame->picture_id;
263 263
264 // Find if there has been a gap in fully received frames and save the picture 264 // Find if there has been a gap in fully received frames and save the picture
265 // id of those frames in |not_yet_received_frames_|. 265 // id of those frames in |not_yet_received_frames_|.
266 if (AheadOf<uint16_t, kPicIdLength>(frame->picture_id, last_picture_id_)) { 266 if (AheadOf<uint16_t, kPicIdLength>(frame->picture_id, last_picture_id_)) {
267 last_picture_id_ = Add<kPicIdLength>(last_picture_id_, 1); 267 do {
268 while (last_picture_id_ != frame->picture_id) { 268 last_picture_id_ = Add<kPicIdLength>(last_picture_id_, 1);
269 not_yet_received_frames_.insert(last_picture_id_); 269 not_yet_received_frames_.insert(last_picture_id_);
270 last_picture_id_ = Add<kPicIdLength>(last_picture_id_, 1); 270 } while (last_picture_id_ != frame->picture_id);
271 }
272 } 271 }
273 272
274 // Clean up info for base layers that are too old. 273 // Clean up info for base layers that are too old.
275 uint8_t old_tl0_pic_idx = codec_header.tl0PicIdx - kMaxLayerInfo; 274 uint8_t old_tl0_pic_idx = codec_header.tl0PicIdx - kMaxLayerInfo;
276 auto clean_layer_info_to = layer_info_.lower_bound(old_tl0_pic_idx); 275 auto clean_layer_info_to = layer_info_.lower_bound(old_tl0_pic_idx);
277 layer_info_.erase(layer_info_.begin(), clean_layer_info_to); 276 layer_info_.erase(layer_info_.begin(), clean_layer_info_to);
278 277
279 // Clean up info about not yet received frames that are too old. 278 // Clean up info about not yet received frames that are too old.
280 uint16_t old_picture_id = 279 uint16_t old_picture_id =
281 Subtract<kPicIdLength>(frame->picture_id, kMaxNotYetReceivedFrames); 280 Subtract<kPicIdLength>(frame->picture_id, kMaxNotYetReceivedFrames);
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 if (!gof_info_.empty() && 746 if (!gof_info_.empty() &&
748 AheadOf<uint8_t>(gof_info_.begin()->first, fixed_tl0)) { 747 AheadOf<uint8_t>(gof_info_.begin()->first, fixed_tl0)) {
749 return true; 748 return true;
750 } 749 }
751 } 750 }
752 return false; 751 return false;
753 } 752 }
754 753
755 } // namespace video_coding 754 } // namespace video_coding
756 } // namespace webrtc 755 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/rtp_frame_reference_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698