| 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 <string.h> | 5 #include <string.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 H264DPB::H264DPB() : max_num_pics_(0) {} | 57 H264DPB::H264DPB() : max_num_pics_(0) {} |
| 58 H264DPB::~H264DPB() {} | 58 H264DPB::~H264DPB() {} |
| 59 | 59 |
| 60 void H264DPB::Clear() { | 60 void H264DPB::Clear() { |
| 61 pics_.clear(); | 61 pics_.clear(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void H264DPB::set_max_num_pics(size_t max_num_pics) { | 64 void H264DPB::set_max_num_pics(size_t max_num_pics) { |
| 65 DCHECK_LE(max_num_pics, kDPBMaxSize); | 65 DCHECK_LE(max_num_pics, static_cast<size_t>(kDPBMaxSize)); |
| 66 max_num_pics_ = max_num_pics; | 66 max_num_pics_ = max_num_pics; |
| 67 if (pics_.size() > max_num_pics_) | 67 if (pics_.size() > max_num_pics_) |
| 68 pics_.resize(max_num_pics_); | 68 pics_.resize(max_num_pics_); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void H264DPB::UpdatePicPositions() { | 71 void H264DPB::UpdatePicPositions() { |
| 72 size_t i = 0; | 72 size_t i = 0; |
| 73 for (auto& pic : pics_) { | 73 for (auto& pic : pics_) { |
| 74 pic->dpb_position = i; | 74 pic->dpb_position = i; |
| 75 ++i; | 75 ++i; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 void H264DPB::GetLongTermRefPicsAppending(H264Picture::Vector* out) { | 167 void H264DPB::GetLongTermRefPicsAppending(H264Picture::Vector* out) { |
| 168 for (const auto& pic : pics_) { | 168 for (const auto& pic : pics_) { |
| 169 if (pic->ref && pic->long_term) | 169 if (pic->ref && pic->long_term) |
| 170 out->push_back(pic); | 170 out->push_back(pic); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace media | 174 } // namespace media |
| OLD | NEW |