diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2008-07-13 14:27:48 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2008-07-13 14:27:48 +0000 |
commit | 6647ab80e36aa2484a145029141984843958b246 (patch) | |
tree | 48875bae682ea15a8e2ef0163cef880fc63f49f2 /libavcodec/bitstream.h | |
parent | f9bd305694747b0bb51700c8fe1745beaaf886e3 (diff) | |
download | ffmpeg-6647ab80e36aa2484a145029141984843958b246.tar.gz |
bitstream: move put_sbits() from flacenc.c to bitstream.h and use it
throughout libavcodec.
Originally committed as revision 14204 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/bitstream.h')
-rw-r--r-- | libavcodec/bitstream.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h index b0e4ce9984..a90d48df53 100644 --- a/libavcodec/bitstream.h +++ b/libavcodec/bitstream.h @@ -315,6 +315,13 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value) } #endif +static inline void put_sbits(PutBitContext *pb, int bits, int32_t val) +{ + assert(bits >= 0 && bits <= 31); + + put_bits(pb, bits, val & ((1<<bits)-1)); +} + static inline uint8_t* pbBufPtr(PutBitContext *s) { |