codecparsers: h264: record pic_order_cnt elements size

Some hardware decoders, for example Hantro G1, have to be told the
size of the pic_order_cnt related syntax elements pic_order_cnt_lsb,
delta_pic_order_cnt_bottom, delta_pic_order_cnt[0], and
delta_pic_order_cnt[1] in bits.
This commit is contained in:
Philipp Zabel 2019-09-04 16:48:29 +02:00 committed by Philipp Zabel
parent d0d65fa875
commit 0cc7d6f093
2 changed files with 12 additions and 0 deletions

View file

@ -2143,6 +2143,7 @@ gst_h264_parser_parse_slice_hdr (GstH264NalParser * nalparser,
gint pps_id;
GstH264PPS *pps;
GstH264SPS *sps;
guint start_pos;
memset (slice, 0, sizeof (*slice));
@ -2208,6 +2209,8 @@ gst_h264_parser_parse_slice_hdr (GstH264NalParser * nalparser,
if (nalu->idr_pic_flag)
READ_UE_MAX (&nr, slice->idr_pic_id, G_MAXUINT16);
start_pos = nal_reader_get_pos (&nr);
if (sps->pic_order_cnt_type == 0) {
READ_UINT16 (&nr, slice->pic_order_cnt_lsb,
sps->log2_max_pic_order_cnt_lsb_minus4 + 4);
@ -2222,6 +2225,8 @@ gst_h264_parser_parse_slice_hdr (GstH264NalParser * nalparser,
READ_SE (&nr, slice->delta_pic_order_cnt[1]);
}
slice->pic_order_cnt_bit_size = nal_reader_get_pos (&nr) - start_pos;
if (pps->redundant_pic_cnt_present_flag)
READ_UE_MAX (&nr, slice->redundant_pic_cnt, G_MAXINT8);

View file

@ -938,6 +938,13 @@ struct _GstH264SliceHdr
/* Since: 1.18 */
guint8 num_ref_idx_active_override_flag;
guint8 sp_for_switch_flag;
/*
* Size of the pic_order_cnt related syntax elements pic_order_cnt_lsb,
* delta_pic_order_cnt_bottom, delta_pic_order_cnt[0], and
* delta_pic_order_cnt[1]. (Since: 1.18)
*/
guint pic_order_cnt_bit_size;
};