You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/put_bits: Allow to mark places where PutBitContext is flushed
This will allow the compiler to optimize the "is the cache full?" branches away from some put_bits(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -74,6 +74,16 @@ static inline void init_put_bits(PutBitContext *s, uint8_t *buffer,
|
|||||||
s->bit_buf = 0;
|
s->bit_buf = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inform the compiler that a PutBitContext is flushed (i.e. if it has just
|
||||||
|
* been initialized or flushed). Undefined behaviour occurs if this is used
|
||||||
|
* with a PutBitContext for which this is not true.
|
||||||
|
*/
|
||||||
|
static inline void put_bits_assume_flushed(const PutBitContext *s)
|
||||||
|
{
|
||||||
|
av_assume(s->bit_left == BUF_BITS);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the total number of bits written to the bitstream.
|
* @return the total number of bits written to the bitstream.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user