[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec bitstream.h,1.160,1.161
Måns Rullgård CVS
mru
Fri May 12 01:17:25 CEST 2006
- Previous message: [Ffmpeg-cvslog] CVS: ffmpeg/libavformat oggparseogm.c, NONE, 1.1 Makefile, 1.129, 1.130 ogg2.c, 1.13, 1.14 ogg2.h, 1.4, 1.5
- Next message: [Ffmpeg-cvslog] CVS: ffmpeg/libavformat ogg2.c, 1.14, 1.15 oggparseflac.c, 1.4, 1.5 oggparseogm.c, 1.1, 1.2 oggparsetheora.c, 1.6, 1.7 oggparsevorbis.c, 1.5, 1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv16365
Modified Files:
bitstream.h
Log Message:
add unaligned16() and unaligned64()
Index: bitstream.h
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/bitstream.h,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- bitstream.h 31 Mar 2006 20:40:22 -0000 1.160
+++ bitstream.h 11 May 2006 23:17:23 -0000 1.161
@@ -141,25 +141,34 @@
/* used to avoid missaligned exceptions on some archs (alpha, ...) */
#if defined(ARCH_X86) || defined(ARCH_X86_64)
+# define unaligned16(a) (*(const uint16_t*)(a))
# define unaligned32(a) (*(const uint32_t*)(a))
+# define unaligned64(a) (*(const uint64_t*)(a))
#else
# ifdef __GNUC__
-static inline uint32_t unaligned32(const void *v) {
- struct Unaligned {
- uint32_t i;
- } __attribute__((packed));
-
- return ((const struct Unaligned *) v)->i;
+# define unaligned(x) \
+static inline uint##x##_t unaligned##x(const void *v) { \
+ struct Unaligned { \
+ uint##x##_t i; \
+ } __attribute__((packed)); \
+ \
+ return ((const struct Unaligned *) v)->i; \
}
# elif defined(__DECC)
-static inline uint32_t unaligned32(const void *v) {
- return *(const __unaligned uint32_t *) v;
+# define unaligned(x) \
+static inline uint##x##_t unaligned##x##(const void *v) { \
+ return *(const __unaligned uint##x##_t *) v; \
}
# else
-static inline uint32_t unaligned32(const void *v) {
- return *(const uint32_t *) v;
+# define unaligned(x) \
+static inline uint##x##_t unaligned##x##(const void *v) { \
+ return *(const uint##x##_t *) v; \
}
# endif
+unaligned(16)
+unaligned(32)
+unaligned(64)
+#undef unaligned
#endif //!ARCH_X86
#ifndef ALT_BITSTREAM_WRITER
- Previous message: [Ffmpeg-cvslog] CVS: ffmpeg/libavformat oggparseogm.c, NONE, 1.1 Makefile, 1.129, 1.130 ogg2.c, 1.13, 1.14 ogg2.h, 1.4, 1.5
- Next message: [Ffmpeg-cvslog] CVS: ffmpeg/libavformat ogg2.c, 1.14, 1.15 oggparseflac.c, 1.4, 1.5 oggparseogm.c, 1.1, 1.2 oggparsetheora.c, 1.6, 1.7 oggparsevorbis.c, 1.5, 1.6
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ffmpeg-cvslog
mailing list