aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/liba52/bitstream.h
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2003-02-18 11:48:57 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2003-02-18 11:48:57 +0000
commitc947dec982117ee0b96a39f4736f6817a7522ed6 (patch)
tree8a9d1a82481ed4442db3211e1673d8eb64118b29 /libavcodec/liba52/bitstream.h
parentca390e727d165bf80445035c4b67a7239fdc87c0 (diff)
downloadffmpeg-c947dec982117ee0b96a39f4736f6817a7522ed6.tar.gz
* sync with main liba52 sources
Originally committed as revision 1590 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/liba52/bitstream.h')
-rw-r--r--libavcodec/liba52/bitstream.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/libavcodec/liba52/bitstream.h b/libavcodec/liba52/bitstream.h
index 8721428312..f559fbf833 100644
--- a/libavcodec/liba52/bitstream.h
+++ b/libavcodec/liba52/bitstream.h
@@ -1,6 +1,6 @@
/*
* bitstream.h
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
+ * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
* Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
*
* This file is part of a52dec, a free ATSC A-52 stream decoder.
@@ -46,37 +46,32 @@
# endif
#endif
-extern uint32_t a52_bits_left;
-extern uint32_t a52_current_word;
+void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf);
+uint32_t a52_bitstream_get_bh (a52_state_t * state, uint32_t num_bits);
+int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits);
-void a52_bitstream_set_ptr (uint8_t * buf);
-uint32_t a52_bitstream_get_bh(uint32_t num_bits);
-int32_t a52_bitstream_get_bh_2(uint32_t num_bits);
-
-static inline uint32_t
-bitstream_get(uint32_t num_bits)
+static inline uint32_t bitstream_get (a52_state_t * state, uint32_t num_bits)
{
uint32_t result;
- if(num_bits < a52_bits_left) {
- result = (a52_current_word << (32 - a52_bits_left)) >> (32 - num_bits);
- a52_bits_left -= num_bits;
+ if (num_bits < state->bits_left) {
+ result = (state->current_word << (32 - state->bits_left)) >> (32 - num_bits);
+ state->bits_left -= num_bits;
return result;
}
- return a52_bitstream_get_bh(num_bits);
+ return a52_bitstream_get_bh (state, num_bits);
}
-static inline int32_t
-bitstream_get_2(uint32_t num_bits)
+static inline int32_t bitstream_get_2 (a52_state_t * state, uint32_t num_bits)
{
int32_t result;
- if(num_bits < a52_bits_left) {
- result = (((int32_t)a52_current_word) << (32 - a52_bits_left)) >> (32 - num_bits);
- a52_bits_left -= num_bits;
+ if (num_bits < state->bits_left) {
+ result = (((int32_t)state->current_word) << (32 - state->bits_left)) >> (32 - num_bits);
+ state->bits_left -= num_bits;
return result;
}
- return a52_bitstream_get_bh_2(num_bits);
+ return a52_bitstream_get_bh_2 (state, num_bits);
}