summaryrefslogtreecommitdiff
path: root/tools/h264.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h264.h')
-rw-r--r--tools/h264.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/h264.h b/tools/h264.h
index e7e55189..3d6f1cae 100644
--- a/tools/h264.h
+++ b/tools/h264.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: h264.h,v 1.5 2008-07-29 12:55:28 phintuka Exp $
+ * $Id: h264.h,v 1.6 2008-07-29 14:01:35 phintuka Exp $
*
*/
@@ -22,6 +22,18 @@ extern "C" {
#define NAL_AUD 0x09 /* Access Unit Delimiter */
#define NAL_END_SEQ 0x10 /* End of Sequence */
+
+#if defined(__i386__) || defined(__x86_64__)
+# define IS_NAL_SPS(buf) (*(uint32_t*)(buf) == 0x07010000U)
+# define IS_NAL_AUD(buf) (*(uint32_t*)(buf) == 0x09010000U)
+# define IS_NAL_END_SEQ(buf) (*(uint32_t*)(buf) == 0x10010000U)
+#else
+# define IS_NAL_SPS(buf) ((buf)[0] == 0 && (buf)[1] == 0 && (buf)[2] == 1 && (buf)[3] == NAL_SPS)
+# define IS_NAL_AUD(buf) ((buf)[0] == 0 && (buf)[1] == 0 && (buf)[2] == 1 && (buf)[3] == NAL_AUD)
+# define IS_NAL_END_SEQ(buf) ((buf)[0] == 0 && (buf)[1] == 0 && (buf)[2] == 1 && (buf)[3] == NAL_END_SEQ)
+#endif
+
+
typedef struct {
int width;
int height;