summaryrefslogtreecommitdiff
path: root/bitstream.h
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2009-10-18 22:40:06 +0200
committerAndre Noll <maan@systemlinux.org>2009-11-18 19:34:24 +0100
commit7978ce515fc2c19ffd8fd7d8fe356f5fa628d7ff (patch)
tree711d41cec923964d7711ba222bfe2133d7ba78a4 /bitstream.h
parent4163d3460d5dc61264636ebeb7b3fe8052b93568 (diff)
get rid of AV_RB32().
Diffstat (limited to 'bitstream.h')
-rw-r--r--bitstream.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/bitstream.h b/bitstream.h
index d13ef4c2..0c0a1eba 100644
--- a/bitstream.h
+++ b/bitstream.h
@@ -9,11 +9,6 @@
/** \file bitstream.h Bitstream structures and inline functions. */
-#define AV_RB32(x) ((((const uint8_t*)(x))[0] << 24) | \
- (((const uint8_t*)(x))[1] << 16) | \
- (((const uint8_t*)(x))[2] << 8) | \
- ((const uint8_t*)(x))[3])
-
/** Structure for bistream I/O. */
struct getbit_context {
/* Start of the internal buffer. */
@@ -35,8 +30,9 @@ struct vlc {
static inline uint32_t show_bits(struct getbit_context *gbc, int num)
{
int idx = gbc->index;
- uint32_t x = AV_RB32(gbc->buffer + (idx >> 3)) << (idx & 7);
- return x >> (32 - num);
+ const uint8_t *p = gbc->buffer + (idx >> 3);
+ uint32_t x = ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
+ return (x << (idx & 7)) >> (32 - num);
}
static inline int get_bits_count(struct getbit_context *gbc)