]> git.sesse.net Git - ffmpeg/commitdiff
add little endian 24bit read/write
authorAlex Beregszaszi <alex@rtfs.hu>
Tue, 6 Mar 2007 13:04:47 +0000 (13:04 +0000)
committerAlex Beregszaszi <alex@rtfs.hu>
Tue, 6 Mar 2007 13:04:47 +0000 (13:04 +0000)
Originally committed as revision 8269 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavutil/intreadwrite.h

index 09144f25a55b59cd2dfbc902dfe3e77bb78b5536..7225f0b6734e2f5fa9109e1ba786591ec96c3f15 100644 (file)
@@ -78,6 +78,14 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
                     ((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) | \