summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2011-08-16 15:14:03 +0200
committerThibault Saunier <thibault.saunier@collabora.com>2011-08-31 09:28:31 -0300
commit4757a49c817b022a03cccb0cfc3c7f42c08b9c4e (patch)
treece07d650cd9fe94642cedd26e354210edc868572
parente08a027aba36ccf04ec49a6c98630ffcfb2ccd66 (diff)
codecparsers: h264: fix slice_header() parsing.
We were not parsing the slice headers until the actual end, we are now parsing until the end.
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.c24
-rw-r--r--gst-libs/gst/codecparsers/gsth264parser.h10
2 files changed, 34 insertions, 0 deletions
diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c
index bdd2899bd..a89dc1cfd 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.c
+++ b/gst-libs/gst/codecparsers/gsth264parser.c
@@ -109,6 +109,30 @@ const guint8 zigzag_4x4[16] = {
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 ******/
typedef struct
diff --git a/gst-libs/gst/codecparsers/gsth264parser.h b/gst-libs/gst/codecparsers/gsth264parser.h
index 5d38db9f2..ed34feb12 100644
--- a/gst-libs/gst/codecparsers/gsth264parser.h
+++ b/gst-libs/gst/codecparsers/gsth264parser.h
@@ -546,6 +546,16 @@ struct _GstH264SliceHdr
/* if nal_unit.ref_idc != 0 */
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 */
guint32 max_pic_num;
gboolean valid;