mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
codecparsers: h264: fix slice_header() parsing.
We were not parsing the slice headers until the actual end, we are now parsing until the end.
This commit is contained in:
parent
43e47009d5
commit
0a0c73169f
2 changed files with 34 additions and 0 deletions
|
@ -109,6 +109,30 @@ const guint8 zigzag_4x4[16] = {
|
||||||
7, 11, 14, 15,
|
7, 11, 14, 15,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Compute Ceil(Log2(v)) */
|
||||||
|
/* Derived from branchless code for integer log2(v) from:
|
||||||
|
<http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog> */
|
||||||
|
static guint
|
||||||
|
ceil_log2 (guint32 v)
|
||||||
|
{
|
||||||
|
guint r, shift;
|
||||||
|
|
||||||
|
v--;
|
||||||
|
r = (v > 0xFFFF) << 4;
|
||||||
|
v >>= r;
|
||||||
|
shift = (v > 0xFF) << 3;
|
||||||
|
v >>= shift;
|
||||||
|
r |= shift;
|
||||||
|
shift = (v > 0xF) << 2;
|
||||||
|
v >>= shift;
|
||||||
|
r |= shift;
|
||||||
|
shift = (v > 0x3) << 1;
|
||||||
|
v >>= shift;
|
||||||
|
r |= shift;
|
||||||
|
r |= (v >> 1);
|
||||||
|
return r + 1;
|
||||||
|
}
|
||||||
|
|
||||||
/****** Nal parser ******/
|
/****** Nal parser ******/
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
|
@ -546,6 +546,16 @@ struct _GstH264SliceHdr
|
||||||
/* if nal_unit.ref_idc != 0 */
|
/* if nal_unit.ref_idc != 0 */
|
||||||
GstH264DecRefPicMarking dec_ref_pic_marking;
|
GstH264DecRefPicMarking dec_ref_pic_marking;
|
||||||
|
|
||||||
|
guint8 cabac_init_idc;
|
||||||
|
gint8 slice_qp_delta;
|
||||||
|
gint8 slice_qs_delta;
|
||||||
|
|
||||||
|
guint8 disable_deblocking_filter_idc;
|
||||||
|
gint8 slice_alpha_c0_offset_div2;
|
||||||
|
gint8 slice_beta_offset_div2;
|
||||||
|
|
||||||
|
guint16 slice_group_change_cycle;
|
||||||
|
|
||||||
/* calculated values */
|
/* calculated values */
|
||||||
guint32 max_pic_num;
|
guint32 max_pic_num;
|
||||||
gboolean valid;
|
gboolean valid;
|
||||||
|
|
Loading…
Reference in a new issue