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

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

Issue 1318283007: H264 Decoder: move cut off logic from Construct to ModifyRefPicList(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address pawel's comments. Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/h264_decoder.cc
diff --git a/content/common/gpu/media/h264_decoder.cc b/content/common/gpu/media/h264_decoder.cc
index 9953ff21a593d28c9508f51715091f8b10f81203..07466e74d49d3f3384488ccdab6b476b0cdd31b5 100644
--- a/content/common/gpu/media/h264_decoder.cc
+++ b/content/common/gpu/media/h264_decoder.cc
@@ -362,9 +362,6 @@ void H264Decoder::ConstructReferencePicListsP(
dpb_.GetLongTermRefPicsAppending(&ref_pic_list_p0_);
std::sort(ref_pic_list_p0_.begin() + num_short_refs, ref_pic_list_p0_.end(),
LongTermPicNumAscCompare());
-
- // Cut off if we have more than requested in slice header.
- ref_pic_list_p0_.resize(slice_hdr->num_ref_idx_l0_active_minus1 + 1);
}
struct POCAscCompare {
@@ -436,12 +433,6 @@ void H264Decoder::ConstructReferencePicListsB(
std::equal(ref_pic_list_b0_.begin(), ref_pic_list_b0_.end(),
ref_pic_list_b1_.begin()))
std::swap(ref_pic_list_b1_[0], ref_pic_list_b1_[1]);
-
- // Per 8.2.4.2 it's possible for num_ref_idx_lX_active_minus1 to indicate
- // there should be more ref pics on list than we constructed.
- // Those superfluous ones should be treated as non-reference.
- ref_pic_list_b0_.resize(slice_hdr->num_ref_idx_l0_active_minus1 + 1);
- ref_pic_list_b1_.resize(slice_hdr->num_ref_idx_l1_active_minus1 + 1);
}
// See 8.2.4
@@ -492,6 +483,15 @@ bool H264Decoder::ModifyReferencePicList(media::H264SliceHeader* slice_hdr,
int num_ref_idx_lX_active_minus1;
media::H264ModificationOfPicNum* list_mod;
+ // Cut off if we have more than requested in slice header.
Pawel Osciak 2015/09/02 03:34:58 Hm, this should probably say resize instead of cut
hshi1 2015/09/02 03:49:25 Done.
+ // Note that per 8.2.4.2 it's possible for num_ref_idx_lX_active_minus1 to
+ // indicate there should be more ref pics on list than we constructed.
+ // Those superfluous ones should be treated as non-reference.
+ num_ref_idx_lX_active_minus1 = list == 0
+ ? slice_hdr->num_ref_idx_l0_active_minus1
+ : slice_hdr->num_ref_idx_l1_active_minus1;
+ ref_pic_listx->resize(num_ref_idx_lX_active_minus1 + 1);
+
Pawel Osciak 2015/09/02 03:34:58 I'm on the fence here, so completely up to you, bu
hshi1 2015/09/02 03:49:25 Done.
// This can process either ref_pic_list0 or ref_pic_list1, depending on
// the list argument. Set up pointers to proper list to be processed here.
if (list == 0) {
@@ -506,9 +506,6 @@ bool H264Decoder::ModifyReferencePicList(media::H264SliceHeader* slice_hdr,
list_mod = slice_hdr->ref_list_l1_modifications;
}
- num_ref_idx_lX_active_minus1 = ref_pic_listx->size() - 1;
- DCHECK_GE(num_ref_idx_lX_active_minus1, 0);
-
// Spec 8.2.4.3:
// Reorder pictures on the list in a way specified in the stream.
int pic_num_lx_pred = curr_pic_->pic_num;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698