# HG changeset patch # User alex # Date 1173186287 0 # Node ID 85ee113e8336f6b7296b3f2084eabc2c0d3cf7be # Parent 411c8cbd578abbdc1c3aa9e4783872ca146688b5 add little endian 24bit read/write diff -r 411c8cbd578a -r 85ee113e8336 intreadwrite.h --- 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) | \