| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "content/common/gpu/media/h264_dpb.h" | 9 #include "content/common/gpu/media/h264_dpb.h" |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 H264Picture* H264DPB::GetShortRefPicByPicNum(int pic_num) { | 67 H264Picture* H264DPB::GetShortRefPicByPicNum(int pic_num) { |
| 68 for (size_t i = 0; i < pics_.size(); ++i) { | 68 for (size_t i = 0; i < pics_.size(); ++i) { |
| 69 H264Picture* pic = pics_[i]; | 69 H264Picture* pic = pics_[i]; |
| 70 if (pic->ref && !pic->long_term && pic->pic_num == pic_num) | 70 if (pic->ref && !pic->long_term && pic->pic_num == pic_num) |
| 71 return pic; | 71 return pic; |
| 72 } | 72 } |
| 73 | 73 |
| 74 DVLOG(1) << "Missing short ref pic num: " << pic_num; | 74 DVLOG(1) << "Missing short ref pic num: " << pic_num; |
| 75 return NULL; | 75 return nullptr; |
| 76 } | 76 } |
| 77 | 77 |
| 78 H264Picture* H264DPB::GetLongRefPicByLongTermPicNum(int pic_num) { | 78 H264Picture* H264DPB::GetLongRefPicByLongTermPicNum(int pic_num) { |
| 79 for (size_t i = 0; i < pics_.size(); ++i) { | 79 for (size_t i = 0; i < pics_.size(); ++i) { |
| 80 H264Picture* pic = pics_[i]; | 80 H264Picture* pic = pics_[i]; |
| 81 if (pic->ref && pic->long_term && pic->long_term_pic_num == pic_num) | 81 if (pic->ref && pic->long_term && pic->long_term_pic_num == pic_num) |
| 82 return pic; | 82 return pic; |
| 83 } | 83 } |
| 84 | 84 |
| 85 DVLOG(1) << "Missing long term pic num: " << pic_num; | 85 DVLOG(1) << "Missing long term pic num: " << pic_num; |
| 86 return NULL; | 86 return nullptr; |
| 87 } | 87 } |
| 88 | 88 |
| 89 H264Picture* H264DPB::GetLowestFrameNumWrapShortRefPic() { | 89 H264Picture* H264DPB::GetLowestFrameNumWrapShortRefPic() { |
| 90 H264Picture* ret = NULL; | 90 H264Picture* ret = nullptr; |
| 91 for (size_t i = 0; i < pics_.size(); ++i) { | 91 for (size_t i = 0; i < pics_.size(); ++i) { |
| 92 H264Picture* pic = pics_[i]; | 92 H264Picture* pic = pics_[i]; |
| 93 if (pic->ref && !pic->long_term && | 93 if (pic->ref && !pic->long_term && |
| 94 (!ret || pic->frame_num_wrap < ret->frame_num_wrap)) | 94 (!ret || pic->frame_num_wrap < ret->frame_num_wrap)) |
| 95 ret = pic; | 95 ret = pic; |
| 96 } | 96 } |
| 97 return ret; | 97 return ret; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void H264DPB::GetNotOutputtedPicsAppending(H264Picture::PtrVector& out) { | 100 void H264DPB::GetNotOutputtedPicsAppending(H264Picture::PtrVector& out) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 115 | 115 |
| 116 void H264DPB::GetLongTermRefPicsAppending(H264Picture::PtrVector& out) { | 116 void H264DPB::GetLongTermRefPicsAppending(H264Picture::PtrVector& out) { |
| 117 for (size_t i = 0; i < pics_.size(); ++i) { | 117 for (size_t i = 0; i < pics_.size(); ++i) { |
| 118 H264Picture* pic = pics_[i]; | 118 H264Picture* pic = pics_[i]; |
| 119 if (pic->ref && pic->long_term) | 119 if (pic->ref && pic->long_term) |
| 120 out.push_back(pic); | 120 out.push_back(pic); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace content | 124 } // namespace content |
| OLD | NEW |