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

Unified Diff: content/common/gpu/media/h264_dpb.cc

Issue 852103002: Revert of Add accelerated video decoder interface, VP8 and H.264 implementations and hook up to V4L2SVDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/h264_dpb.h ('k') | content/common/gpu/media/tegra_v4l2_video_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/h264_dpb.cc
diff --git a/content/common/gpu/media/h264_dpb.cc b/content/common/gpu/media/h264_dpb.cc
index dfefc18f65445440dd51cdd6504f1d6d09aaa9a0..371d61283139a4df1084b653d6e645ae9edd8a8e 100644
--- a/content/common/gpu/media/h264_dpb.cc
+++ b/content/common/gpu/media/h264_dpb.cc
@@ -9,20 +9,6 @@
#include "content/common/gpu/media/h264_dpb.h"
namespace content {
-
-H264PictureBase::H264PictureBase() {
- memset(this, 0, sizeof(*this));
-}
-
-H264Picture::H264Picture() {
-}
-
-H264Picture::~H264Picture() {
-}
-
-V4L2H264Picture* H264Picture::AsV4L2H264Picture() {
- return nullptr;
-}
H264DPB::H264DPB() : max_num_pics_(0) {}
H264DPB::~H264DPB() {}
@@ -38,20 +24,10 @@
pics_.resize(max_num_pics_);
}
-void H264DPB::UpdatePicPositions() {
- size_t i = 0;
- for (auto& pic : pics_) {
- pic->dpb_position = i;
- ++i;
- }
-}
-
void H264DPB::DeleteByPOC(int poc) {
- for (H264Picture::Vector::iterator it = pics_.begin();
- it != pics_.end(); ++it) {
+ for (Pictures::iterator it = pics_.begin(); it != pics_.end(); ++it) {
if ((*it)->pic_order_cnt == poc) {
pics_.erase(it);
- UpdatePicPositions();
return;
}
}
@@ -59,20 +35,18 @@
}
void H264DPB::DeleteUnused() {
- for (H264Picture::Vector::iterator it = pics_.begin(); it != pics_.end(); ) {
+ for (Pictures::iterator it = pics_.begin(); it != pics_.end(); ) {
if ((*it)->outputted && !(*it)->ref)
it = pics_.erase(it);
else
++it;
}
- UpdatePicPositions();
}
-void H264DPB::StorePic(const scoped_refptr<H264Picture>& pic) {
+void H264DPB::StorePic(H264Picture* pic) {
DCHECK_LT(pics_.size(), max_num_pics_);
DVLOG(3) << "Adding PicNum: " << pic->pic_num << " ref: " << (int)pic->ref
<< " longterm: " << (int)pic->long_term << " to DPB";
- pic->dpb_position = pics_.size();
pics_.push_back(pic);
}
@@ -90,29 +64,32 @@
pics_[i]->ref = false;
}
-scoped_refptr<H264Picture> H264DPB::GetShortRefPicByPicNum(int pic_num) {
- for (const auto& pic : pics_) {
+H264Picture* H264DPB::GetShortRefPicByPicNum(int pic_num) {
+ for (size_t i = 0; i < pics_.size(); ++i) {
+ H264Picture* pic = pics_[i];
if (pic->ref && !pic->long_term && pic->pic_num == pic_num)
return pic;
}
DVLOG(1) << "Missing short ref pic num: " << pic_num;
- return nullptr;
+ return NULL;
}
-scoped_refptr<H264Picture> H264DPB::GetLongRefPicByLongTermPicNum(int pic_num) {
- for (const auto& pic : pics_) {
+H264Picture* H264DPB::GetLongRefPicByLongTermPicNum(int pic_num) {
+ for (size_t i = 0; i < pics_.size(); ++i) {
+ H264Picture* pic = pics_[i];
if (pic->ref && pic->long_term && pic->long_term_pic_num == pic_num)
return pic;
}
DVLOG(1) << "Missing long term pic num: " << pic_num;
- return nullptr;
+ return NULL;
}
-scoped_refptr<H264Picture> H264DPB::GetLowestFrameNumWrapShortRefPic() {
- scoped_refptr<H264Picture> ret;
- for (const auto& pic : pics_) {
+H264Picture* H264DPB::GetLowestFrameNumWrapShortRefPic() {
+ H264Picture* ret = NULL;
+ for (size_t i = 0; i < pics_.size(); ++i) {
+ H264Picture* pic = pics_[i];
if (pic->ref && !pic->long_term &&
(!ret || pic->frame_num_wrap < ret->frame_num_wrap))
ret = pic;
@@ -120,24 +97,27 @@
return ret;
}
-void H264DPB::GetNotOutputtedPicsAppending(H264Picture::Vector* out) {
- for (const auto& pic : pics_) {
+void H264DPB::GetNotOutputtedPicsAppending(H264Picture::PtrVector& out) {
+ for (size_t i = 0; i < pics_.size(); ++i) {
+ H264Picture* pic = pics_[i];
if (!pic->outputted)
- out->push_back(pic);
+ out.push_back(pic);
}
}
-void H264DPB::GetShortTermRefPicsAppending(H264Picture::Vector* out) {
- for (const auto& pic : pics_) {
+void H264DPB::GetShortTermRefPicsAppending(H264Picture::PtrVector& out) {
+ for (size_t i = 0; i < pics_.size(); ++i) {
+ H264Picture* pic = pics_[i];
if (pic->ref && !pic->long_term)
- out->push_back(pic);
+ out.push_back(pic);
}
}
-void H264DPB::GetLongTermRefPicsAppending(H264Picture::Vector* out) {
- for (const auto& pic : pics_) {
+void H264DPB::GetLongTermRefPicsAppending(H264Picture::PtrVector& out) {
+ for (size_t i = 0; i < pics_.size(); ++i) {
+ H264Picture* pic = pics_[i];
if (pic->ref && pic->long_term)
- out->push_back(pic);
+ out.push_back(pic);
}
}
« no previous file with comments | « content/common/gpu/media/h264_dpb.h ('k') | content/common/gpu/media/tegra_v4l2_video_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698