diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-12-23 21:05:47 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-12-23 21:05:47 +0000 |
commit | 0e921e97c10f37c5ba2bc90cfb00248b633ed21a (patch) | |
tree | 0722edb7b73a7f6df57e34ed738d02a28f8330bd /libavcodec/golomb.h | |
parent | be8497b0acbf1ee6f73f3617e206d1ab6b52fce6 (diff) | |
download | ffmpeg-0e921e97c10f37c5ba2bc90cfb00248b633ed21a.tar.gz |
Add get_ue_golomb_31()
Originally committed as revision 16298 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r-- | libavcodec/golomb.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 627fcdc40f..3c3f75987d 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -74,6 +74,23 @@ static inline int get_ue_golomb(GetBitContext *gb){ } } + /** + * read unsigned exp golomb code, constraint to a max of 31 + */ +static inline int get_ue_golomb_31(GetBitContext *gb){ + unsigned int buf; + + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf=GET_CACHE(re, gb); + + buf >>= 32 - 9; + LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]); + CLOSE_READER(re, gb); + + return ff_ue_golomb_vlc_code[buf]; +} + static inline int svq3_get_ue_golomb(GetBitContext *gb){ uint32_t buf; |