mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
h265parser: Calculate short term RPS size in slice header
The calculated size of short_term_ref_pic_set is not a part of HEVC syntax but the value is used by some stateless decoders (e.g., vaapi, dxva, vdpau and nvdec) for the purpose of skipping parsing the syntax by the accelerator.
This commit is contained in:
parent
29d4db0f8f
commit
6f2ab31d10
2 changed files with 8 additions and 0 deletions
|
@ -2271,10 +2271,13 @@ gst_h265_parser_parse_slice_hdr (GstH265Parser * parser,
|
||||||
|
|
||||||
READ_UINT8 (&nr, slice->short_term_ref_pic_set_sps_flag, 1);
|
READ_UINT8 (&nr, slice->short_term_ref_pic_set_sps_flag, 1);
|
||||||
if (!slice->short_term_ref_pic_set_sps_flag) {
|
if (!slice->short_term_ref_pic_set_sps_flag) {
|
||||||
|
guint pos = nal_reader_get_pos (&nr);
|
||||||
if (!gst_h265_parser_parse_short_term_ref_pic_sets
|
if (!gst_h265_parser_parse_short_term_ref_pic_sets
|
||||||
(&slice->short_term_ref_pic_sets, &nr,
|
(&slice->short_term_ref_pic_sets, &nr,
|
||||||
sps->num_short_term_ref_pic_sets, sps))
|
sps->num_short_term_ref_pic_sets, sps))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
slice->short_term_ref_pic_set_size = nal_reader_get_pos (&nr) - pos;
|
||||||
} else if (sps->num_short_term_ref_pic_sets > 1) {
|
} else if (sps->num_short_term_ref_pic_sets > 1) {
|
||||||
const guint n = ceil_log2 (sps->num_short_term_ref_pic_sets);
|
const guint n = ceil_log2 (sps->num_short_term_ref_pic_sets);
|
||||||
READ_UINT8 (&nr, slice->short_term_ref_pic_set_idx, n);
|
READ_UINT8 (&nr, slice->short_term_ref_pic_set_idx, n);
|
||||||
|
|
|
@ -1189,6 +1189,8 @@ struct _GstH265PredWeightTable
|
||||||
* @header_size: the calculated size of the slice_header() in bits.
|
* @header_size: the calculated size of the slice_header() in bits.
|
||||||
* @n_emulation_prevention_bytes: number of emulation prevention bytes (EPB)
|
* @n_emulation_prevention_bytes: number of emulation prevention bytes (EPB)
|
||||||
* in this slice_header()
|
* in this slice_header()
|
||||||
|
* @short_term_ref_pic_set_size: the calculated size of short_term_ref_pic_set()
|
||||||
|
* in bits. (Since: 1.18)
|
||||||
*/
|
*/
|
||||||
struct _GstH265SliceHdr
|
struct _GstH265SliceHdr
|
||||||
{
|
{
|
||||||
|
@ -1260,6 +1262,9 @@ struct _GstH265SliceHdr
|
||||||
guint header_size;
|
guint header_size;
|
||||||
/* Number of emulation prevention bytes (EPB) in this slice_header() */
|
/* Number of emulation prevention bytes (EPB) in this slice_header() */
|
||||||
guint n_emulation_prevention_bytes;
|
guint n_emulation_prevention_bytes;
|
||||||
|
|
||||||
|
/* Size of short_term_ref_pic_set() in bits */
|
||||||
|
guint short_term_ref_pic_set_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstH265PicTiming
|
struct _GstH265PicTiming
|
||||||
|
|
Loading…
Reference in a new issue