changeset 282:85ee113e8336 libavutil

add little endian 24bit read/write
author alex
date Tue, 06 Mar 2007 13:04:47 +0000
parents 411c8cbd578a
children 0e64c1d076ef
files intreadwrite.h
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/intreadwrite.h	Mon Mar 05 13:51:03 2007 +0000
+++ b/intreadwrite.h	Tue Mar 06 13:04:47 2007 +0000
@@ -78,6 +78,14 @@
                     ((uint8_t*)(p))[0] = (d); \
                     ((uint8_t*)(p))[1] = (d)>>8; }
 
+#define AV_RL24(x) ((((uint8_t*)(x))[2] << 16) | \
+                    (((uint8_t*)(x))[1] << 8) | \
+                     ((uint8_t*)(x))[0])
+#define AV_WL24(p, d) { \
+                    ((uint8_t*)(p))[0] = (d); \
+                    ((uint8_t*)(p))[1] = (d)>>8; \
+                    ((uint8_t*)(p))[2] = (d)>>16; }
+
 #define AV_RL32(x) ((((uint8_t*)(x))[3] << 24) | \
                    (((uint8_t*)(x))[2] << 16) | \
                    (((uint8_t*)(x))[1] << 8) | \