aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2001-09-15 22:43:01 +0000
committerFabrice Bellard <fabrice@bellard.org>2001-09-15 22:43:01 +0000
commit9dbf9389772781b245d849a695bd9318750174e6 (patch)
treee499bf1defe76ef76e9bc293c3866b067f49c62a
parent2456e28d9139fc6b2fee59dd058ad83a7e2f3416 (diff)
downloadffmpeg-9dbf9389772781b245d849a695bd9318750174e6.tar.gz
added get_bits_count()
Originally committed as revision 120 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/common.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h
index 696ec5703d..97db97ba5a 100644
--- a/libavcodec/common.h
+++ b/libavcodec/common.h
@@ -170,7 +170,7 @@ void init_put_bits(PutBitContext *s,
void *opaque,
void (*write_data)(void *, UINT8 *, int));
void put_bits(PutBitContext *s, int n, unsigned int value);
-INT64 get_bit_count(PutBitContext *s);
+INT64 get_bit_count(PutBitContext *s); /* XXX: change function name */
void align_put_bits(PutBitContext *s);
void flush_put_bits(PutBitContext *s);
@@ -252,6 +252,10 @@ static inline void skip_bits1(GetBitContext *s){
}
}
+static inline int get_bits_count(GetBitContext *s)
+{
+ return (s->buf_ptr - s->buf) * 8 - s->bit_cnt;
+}
void align_get_bits(GetBitContext *s);
int init_vlc(VLC *vlc, int nb_bits, int nb_codes,