diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-04 02:48:32 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-03-04 02:48:32 +0000 |
commit | 626b7c0f1a71f30d9fa6cbdf2cd3438425a7ba15 (patch) | |
tree | 86eb8aad77d5a80979f9a8974d9003dea9878cfc /libavutil | |
parent | 5a6b9443ed6136416363c64566f8374a7d084b17 (diff) | |
download | ffmpeg-626b7c0f1a71f30d9fa6cbdf2cd3438425a7ba15.tar.gz |
add R/WB24 functions
Originally committed as revision 8216 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/intreadwrite.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h index 0e1159802c..09144f25a5 100644 --- a/libavutil/intreadwrite.h +++ b/libavutil/intreadwrite.h @@ -52,6 +52,14 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ((uint8_t*)(p))[1] = (d); \ ((uint8_t*)(p))[0] = (d)>>8; } +#define AV_RB24(x) ((((uint8_t*)(x))[0] << 16) | \ + (((uint8_t*)(x))[1] << 8) | \ + ((uint8_t*)(x))[2]) +#define AV_WB24(p, d) { \ + ((uint8_t*)(p))[2] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[0] = (d)>>16; } + #define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \ (((uint8_t*)(x))[1] << 16) | \ (((uint8_t*)(x))[2] << 8) | \ |