Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-10-26 15:36:06 +0300
committerAnton Khirnov <anton@khirnov.net>2020-10-28 15:53:23 +0300
commit717503f7166d7032e32b935f2819d450524125d1 (patch)
treef18317021078c2ebec76216af00023c836c49d2e /libavcodec/put_bits.h
parent886c601a7064333708f2fdbaf970eb783b5a2008 (diff)
put_bits: make avpriv_align_put_bits() inline
This function is so extremely simple that it is preferable to make it inline rather than deal with all the complications arising from it being an exported symbol. Keep avpriv_align_put_bits() around until the next major bump to preserve ABI compatibility.
Diffstat (limited to 'libavcodec/put_bits.h')
-rw-r--r--libavcodec/put_bits.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 3ba9549948..d7eaa1792e 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -33,6 +33,8 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/avassert.h"
+#include "version.h"
+
#if ARCH_X86_64
// TODO: Benchmark and optionally enable on other 64-bit architectures.
typedef uint64_t BitBuf;
@@ -145,15 +147,14 @@ static inline void flush_put_bits_le(PutBitContext *s)
s->bit_buf = 0;
}
+#if FF_API_AVPRIV_PUT_BITS
+void avpriv_align_put_bits(PutBitContext *s);
+#endif
+
#ifdef BITSTREAM_WRITER_LE
-#define avpriv_align_put_bits align_put_bits_unsupported_here
#define avpriv_put_string ff_put_string_unsupported_here
#define avpriv_copy_bits avpriv_copy_bits_unsupported_here
#else
-/**
- * Pad the bitstream with zeros up to the next byte boundary.
- */
-void avpriv_align_put_bits(PutBitContext *s);
/**
* Put the string string in the bitstream.
@@ -385,6 +386,14 @@ static inline void set_put_bits_buffer_size(PutBitContext *s, int size)
s->size_in_bits = 8*size;
}
+/**
+ * Pad the bitstream with zeros up to the next byte boundary.
+ */
+static inline void align_put_bits(PutBitContext *s)
+{
+ put_bits(s, s->bit_left & 7, 0);
+}
+
#undef AV_WBBUF
#undef AV_WLBUF