Browse code

Add a macro to pack 4 bytes into native byte-order so they can be written at once using a single 32-bit store.

Originally committed as revision 23715 to svn://svn.ffmpeg.org/ffmpeg/trunk

Ronald S. Bultje authored on 2010/06/23 04:15:27
Showing 1 changed files
... ...
@@ -146,5 +146,13 @@ if ((y) < (x)) {\
146 146
 #   define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
147 147
 #endif
148 148
 
149
+#ifndef PACK4x8
150
+# if HAVE_BIGENDIAN
151
+#  define PACK4x8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
152
+# else
153
+#  define PACK4x8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
154
+# endif
155
+#endif
156
+
149 157
 #endif /* AVCODEC_MATHOPS_H */
150 158