mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
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
This commit is contained in:
parent
ee0fc47447
commit
c92efe38e9
2 changed files with 11 additions and 4 deletions
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue