Mercurial > libavcodec.hg
diff bitstream.h @ 7260:3ec34b551aae libavcodec
bitstream: move put_sbits() from flacenc.c to bitstream.h and use it
throughout libavcodec.
| author | ramiro |
|---|---|
| date | Sun, 13 Jul 2008 14:27:48 +0000 |
| parents | e100cf54e11e |
| children | 00858715211e |
line wrap: on
line diff
--- a/bitstream.h Sun Jul 13 14:25:31 2008 +0000 +++ b/bitstream.h Sun Jul 13 14:27:48 2008 +0000 @@ -315,6 +315,13 @@ } #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) {
