aboutsummaryrefslogtreecommitdiff
path: root/libavutil/intreadwrite.h
diff options
context:
space:
mode:
authorAlex Beregszaszi2007-03-06 13:04:47 +0000
committerAlex Beregszaszi2007-03-06 13:04:47 +0000
commit1586238717d4d4e8d0aebcce890082bd0826b8a3 (patch)
tree6dff83d955fbdfb4bf15eed398bb35334343a4b9 /libavutil/intreadwrite.h
parentcb50328dbb4d29efd393b1ff8ba082b3e3d73cef (diff)
add little endian 24bit read/write
Originally committed as revision 8269 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/intreadwrite.h')
-rw-r--r--libavutil/intreadwrite.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h
index 09144f25a5..7225f0b673 100644
--- a/libavutil/intreadwrite.h
+++ b/libavutil/intreadwrite.h
@@ -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) | \