diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-01-18 16:35:16 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-01-20 18:40:29 +0000 |
commit | c92efe38e9f3e60509449ce1bb0d5a6d880c337a (patch) | |
tree | 28d3a0d6c5a1f8192957f4695cb7d5704bddef3e /gst-libs/gst | |
parent | ee0fc47447b8f4c4914925a930233608d1c917c8 (diff) | |
download | gstreamer-plugins-bad-c92efe38e9f3e60509449ce1bb0d5a6d880c337a.tar.gz |
codecparsers: h264: fix ref_pic_list_modification()
The entries were not filled in linearly and the termination was not
recorded either. Now, the actual number of modifications is recorded
similarly to dec_ref_pic_marking(). i.e. an explicit counter instead
of storing the termination value in the array.
https://bugzilla.gnome.org/show_bug.cgi?id=668192
Diffstat (limited to 'gst-libs/gst')
-rw-r--r-- | gst-libs/gst/codecparsers/gsth264parser.c | 13 | ||||
-rw-r--r-- | gst-libs/gst/codecparsers/gsth264parser.h | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c index 6a164ecb1..45039f780 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.c +++ b/gst-libs/gst/codecparsers/gsth264parser.c @@ -747,22 +747,26 @@ slice_parse_ref_pic_list_modification_1 (GstH264SliceHdr * slice, NalReader * nr, guint list) { GstH264RefPicListModification *entries; - guint8 *ref_pic_list_modification_flag; + guint8 *ref_pic_list_modification_flag, *n_ref_pic_list_modification; guint32 modification_of_pic_nums_idc; guint i = 0; if (list == 0) { entries = slice->ref_pic_list_modification_l0; ref_pic_list_modification_flag = &slice->ref_pic_list_modification_flag_l0; + n_ref_pic_list_modification = &slice->n_ref_pic_list_modification_l0; } else { entries = slice->ref_pic_list_modification_l1; ref_pic_list_modification_flag = &slice->ref_pic_list_modification_flag_l1; + n_ref_pic_list_modification = &slice->n_ref_pic_list_modification_l1; } READ_UINT8 (nr, *ref_pic_list_modification_flag, 1); if (*ref_pic_list_modification_flag) { - do { + while (1) { READ_UE (nr, modification_of_pic_nums_idc); + if (modification_of_pic_nums_idc == 3) + break; if (modification_of_pic_nums_idc == 0 || modification_of_pic_nums_idc == 1) { READ_UE_ALLOWED (nr, entries[i].value.abs_diff_pic_num_minus1, 0, @@ -770,9 +774,10 @@ slice_parse_ref_pic_list_modification_1 (GstH264SliceHdr * slice, } else if (modification_of_pic_nums_idc == 2) { READ_UE (nr, entries[i].value.long_term_pic_num); } - } while (modification_of_pic_nums_idc != 3); + entries[i++].modification_of_pic_nums_idc = modification_of_pic_nums_idc; + } } - + *n_ref_pic_list_modification = i; return TRUE; error: diff --git a/gst-libs/gst/codecparsers/gsth264parser.h b/gst-libs/gst/codecparsers/gsth264parser.h index d58f1b07d..3c221560e 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.h +++ b/gst-libs/gst/codecparsers/gsth264parser.h @@ -573,8 +573,10 @@ struct _GstH264SliceHdr guint8 num_ref_idx_l1_active_minus1; guint8 ref_pic_list_modification_flag_l0; + guint8 n_ref_pic_list_modification_l0; GstH264RefPicListModification ref_pic_list_modification_l0[32]; guint8 ref_pic_list_modification_flag_l1; + guint8 n_ref_pic_list_modification_l1; GstH264RefPicListModification ref_pic_list_modification_l1[32]; GstH264PredWeightTable pred_weight_table; |