diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-07-10 20:05:42 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-07-10 20:05:42 +0000 |
commit | 08dce7b02fc08a72a4f815db9b32a2a814561506 (patch) | |
tree | 2057402aac2c64f4996ca1903f06569de91afe63 /libavcodec/common.h | |
parent | 63e0d4ac59363f6328e7c6fe6bd8b78b59d8b9c5 (diff) | |
download | ffmpeg-08dce7b02fc08a72a4f815db9b32a2a814561506.tar.gz |
get_vlc() optimizations
Originally committed as revision 737 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.h')
-rw-r--r-- | libavcodec/common.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h index 35c04a8758..08f396ec34 100644 --- a/libavcodec/common.h +++ b/libavcodec/common.h @@ -766,6 +766,7 @@ void free_vlc(VLC *vlc); SKIP_BITS(name, gb, n)\ } +// deprecated, dont use get_vlc for new code, use get_vlc2 instead or use GET_VLC directly static inline int get_vlc(GetBitContext *s, VLC *vlc) { int code; @@ -780,6 +781,19 @@ static inline int get_vlc(GetBitContext *s, VLC *vlc) return code; } +static inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2], int bits, int max_depth) +{ + int code; + + OPEN_READER(re, s) + UPDATE_CACHE(re, s) + + GET_VLC(code, re, s, table, bits, max_depth) + + CLOSE_READER(re, s) + return code; +} + /* define it to include statistics code (useful only for optimizing codec efficiency */ //#define STATS |