codecparsers: h264: record ref_pic_list_modification().
This commit is contained in:
parent
99101a5824
commit
177451c921
@ -743,60 +743,56 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
slice_parse_ref_pic_list_modification (GstH264SliceHdr * slice, NalReader * nr)
|
slice_parse_ref_pic_list_modification_1 (GstH264SliceHdr * slice,
|
||||||
|
NalReader * nr, guint list)
|
||||||
{
|
{
|
||||||
GST_DEBUG ("parsing \"Reference picture list modification\"");
|
GstH264RefPicListModification *entries;
|
||||||
|
guint8 *ref_pic_list_modification_flag;
|
||||||
if (!GST_H264_IS_I_SLICE (slice) && !GST_H264_IS_SI_SLICE (slice)) {
|
|
||||||
guint8 ref_pic_list_modification_flag_l0;
|
|
||||||
guint32 modification_of_pic_nums_idc;
|
guint32 modification_of_pic_nums_idc;
|
||||||
|
guint i = 0;
|
||||||
|
|
||||||
READ_UINT8 (nr, ref_pic_list_modification_flag_l0, 1);
|
if (list == 0) {
|
||||||
if (ref_pic_list_modification_flag_l0)
|
entries = slice->ref_pic_list_modification_l0;
|
||||||
|
ref_pic_list_modification_flag = &slice->ref_pic_list_modification_flag_l0;
|
||||||
|
} else {
|
||||||
|
entries = slice->ref_pic_list_modification_l1;
|
||||||
|
ref_pic_list_modification_flag = &slice->ref_pic_list_modification_flag_l1;
|
||||||
|
}
|
||||||
|
|
||||||
|
READ_UINT8 (nr, *ref_pic_list_modification_flag, 1);
|
||||||
do {
|
do {
|
||||||
READ_UE (nr, modification_of_pic_nums_idc);
|
READ_UE (nr, modification_of_pic_nums_idc);
|
||||||
if (modification_of_pic_nums_idc == 0
|
if (modification_of_pic_nums_idc == 0 || modification_of_pic_nums_idc == 1) {
|
||||||
|| modification_of_pic_nums_idc == 1) {
|
READ_UE_ALLOWED (nr, entries[i].value.abs_diff_pic_num_minus1, 0,
|
||||||
guint32 abs_diff_pic_num_minus1 G_GNUC_UNUSED;
|
|
||||||
|
|
||||||
READ_UE_ALLOWED (nr, abs_diff_pic_num_minus1, 0,
|
|
||||||
slice->max_pic_num - 1);
|
slice->max_pic_num - 1);
|
||||||
} else if (modification_of_pic_nums_idc == 2) {
|
} else if (modification_of_pic_nums_idc == 2) {
|
||||||
guint32 long_term_pic_num;
|
READ_UE (nr, entries[i].value.long_term_pic_num);
|
||||||
|
|
||||||
READ_UE (nr, long_term_pic_num);
|
|
||||||
}
|
}
|
||||||
} while (modification_of_pic_nums_idc != 3);
|
} while (modification_of_pic_nums_idc != 3);
|
||||||
}
|
|
||||||
|
|
||||||
if (GST_H264_IS_B_SLICE (slice)) {
|
|
||||||
guint8 ref_pic_list_modification_flag_l1;
|
|
||||||
guint32 modification_of_pic_nums_idc;
|
|
||||||
|
|
||||||
READ_UINT8 (nr, ref_pic_list_modification_flag_l1, 1);
|
|
||||||
if (ref_pic_list_modification_flag_l1)
|
|
||||||
do {
|
|
||||||
READ_UE (nr, modification_of_pic_nums_idc);
|
|
||||||
if (modification_of_pic_nums_idc == 0
|
|
||||||
|| modification_of_pic_nums_idc == 1) {
|
|
||||||
guint32 abs_diff_num_minus1;
|
|
||||||
|
|
||||||
READ_UE (nr, abs_diff_num_minus1);
|
|
||||||
} else if (modification_of_pic_nums_idc == 2) {
|
|
||||||
guint32 long_term_pic_num;
|
|
||||||
|
|
||||||
READ_UE (nr, long_term_pic_num);
|
|
||||||
}
|
|
||||||
} while (modification_of_pic_nums_idc != 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
GST_WARNING ("error parsing \"Reference picture list modification\"");
|
GST_WARNING ("error parsing \"Reference picture list %u modification\"",
|
||||||
|
list);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
slice_parse_ref_pic_list_modification (GstH264SliceHdr * slice, NalReader * nr)
|
||||||
|
{
|
||||||
|
if (!GST_H264_IS_I_SLICE (slice) && !GST_H264_IS_SI_SLICE (slice)) {
|
||||||
|
if (!slice_parse_ref_pic_list_modification_1 (slice, nr, 0))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GST_H264_IS_B_SLICE (slice)) {
|
||||||
|
if (!slice_parse_ref_pic_list_modification_1 (slice, nr, 1))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_h264_slice_parse_dec_ref_pic_marking (GstH264SliceHdr * slice,
|
gst_h264_slice_parse_dec_ref_pic_marking (GstH264SliceHdr * slice,
|
||||||
GstH264NalUnit * nalu, NalReader * nr)
|
GstH264NalUnit * nalu, NalReader * nr)
|
||||||
|
@ -177,6 +177,7 @@ typedef struct _GstH264PPS GstH264PPS;
|
|||||||
typedef struct _GstH264HRDParams GstH264HRDParams;
|
typedef struct _GstH264HRDParams GstH264HRDParams;
|
||||||
typedef struct _GstH264VUIParams GstH264VUIParams;
|
typedef struct _GstH264VUIParams GstH264VUIParams;
|
||||||
|
|
||||||
|
typedef struct _GstH264RefPicListModification GstH264RefPicListModification;
|
||||||
typedef struct _GstH264DecRefPicMarking GstH264DecRefPicMarking;
|
typedef struct _GstH264DecRefPicMarking GstH264DecRefPicMarking;
|
||||||
typedef struct _GstH264RefPicMarking GstH264RefPicMarking;
|
typedef struct _GstH264RefPicMarking GstH264RefPicMarking;
|
||||||
typedef struct _GstH264PredWeightTable GstH264PredWeightTable;
|
typedef struct _GstH264PredWeightTable GstH264PredWeightTable;
|
||||||
@ -485,6 +486,18 @@ struct _GstH264PPS
|
|||||||
gboolean valid;
|
gboolean valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _GstH264RefPicListModification
|
||||||
|
{
|
||||||
|
guint8 modification_of_pic_nums_idc;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
/* if modification_of_pic_nums_idc == 0 || 1 */
|
||||||
|
guint32 abs_diff_pic_num_minus1;
|
||||||
|
/* if modification_of_pic_nums_idc == 2 */
|
||||||
|
guint32 long_term_pic_num;
|
||||||
|
} value;
|
||||||
|
};
|
||||||
|
|
||||||
struct _GstH264PredWeightTable
|
struct _GstH264PredWeightTable
|
||||||
{
|
{
|
||||||
guint8 luma_log2_weight_denom;
|
guint8 luma_log2_weight_denom;
|
||||||
@ -559,6 +572,11 @@ struct _GstH264SliceHdr
|
|||||||
guint8 num_ref_idx_l0_active_minus1;
|
guint8 num_ref_idx_l0_active_minus1;
|
||||||
guint8 num_ref_idx_l1_active_minus1;
|
guint8 num_ref_idx_l1_active_minus1;
|
||||||
|
|
||||||
|
guint8 ref_pic_list_modification_flag_l0;
|
||||||
|
GstH264RefPicListModification ref_pic_list_modification_l0[32];
|
||||||
|
guint8 ref_pic_list_modification_flag_l1;
|
||||||
|
GstH264RefPicListModification ref_pic_list_modification_l1[32];
|
||||||
|
|
||||||
GstH264PredWeightTable pred_weight_table;
|
GstH264PredWeightTable pred_weight_table;
|
||||||
/* if nal_unit.ref_idc != 0 */
|
/* if nal_unit.ref_idc != 0 */
|
||||||
GstH264DecRefPicMarking dec_ref_pic_marking;
|
GstH264DecRefPicMarking dec_ref_pic_marking;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user