[FFmpeg-cvslog] put_bits: make avpriv_copy_bits() lavc-local

Anton Khirnov git at videolan.org
Wed Oct 28 15:26:30 EET 2020


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Oct 26 13:41:39 2020 +0100| [dc1099442e2d772b440b0c37d465538a7fe5a684] | committer: Anton Khirnov

put_bits: make avpriv_copy_bits() lavc-local

It is not used outside of lavc anymore. Keep the avpriv exported symbol
around until the next bump to preserve ABI compatibility.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc1099442e2d772b440b0c37d465538a7fe5a684
---

 libavcodec/bitstream.c      | 6 +++++-
 libavcodec/mpeg4videoenc.c  | 4 ++--
 libavcodec/mpegvideo_enc.c  | 8 ++++----
 libavcodec/put_bits.h       | 5 +++--
 libavcodec/svq1enc.c        | 2 +-
 libavcodec/wmalosslessdec.c | 4 ++--
 libavcodec/wmaprodec.c      | 4 ++--
 libavcodec/wmavoice.c       | 4 ++--
 8 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 36ffdf4abe..c7a87734e5 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -50,6 +50,10 @@ void avpriv_align_put_bits(PutBitContext *s)
 {
     align_put_bits(s);
 }
+void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
+{
+    ff_copy_bits(pb, src, length);
+}
 #endif
 
 void ff_put_string(PutBitContext *pb, const char *string, int terminate_string)
@@ -62,7 +66,7 @@ void ff_put_string(PutBitContext *pb, const char *string, int terminate_string)
         put_bits(pb, 8, 0);
 }
 
-void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
+void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
 {
     int words = length >> 4;
     int bits  = length & 15;
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 72e6f99eaa..b3fa910c64 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -1354,8 +1354,8 @@ void ff_mpeg4_merge_partitions(MpegEncContext *s)
     flush_put_bits(&s->tex_pb);
 
     set_put_bits_buffer_size(&s->pb, s->pb2.buf_end - s->pb.buf);
-    avpriv_copy_bits(&s->pb, s->pb2.buf, pb2_len);
-    avpriv_copy_bits(&s->pb, s->tex_pb.buf, tex_pb_len);
+    ff_copy_bits(&s->pb, s->pb2.buf, pb2_len);
+    ff_copy_bits(&s->pb, s->tex_pb.buf, tex_pb_len);
     s->last_bits = put_bits_count(&s->pb);
 }
 
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index b16faf6b55..f16b26c9f2 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -3351,18 +3351,18 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
                 pb_bits_count= put_bits_count(&s->pb);
                 flush_put_bits(&s->pb);
-                avpriv_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count);
+                ff_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count);
                 s->pb= backup_s.pb;
 
                 if(s->data_partitioning){
                     pb2_bits_count= put_bits_count(&s->pb2);
                     flush_put_bits(&s->pb2);
-                    avpriv_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count);
+                    ff_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count);
                     s->pb2= backup_s.pb2;
 
                     tex_pb_bits_count= put_bits_count(&s->tex_pb);
                     flush_put_bits(&s->tex_pb);
-                    avpriv_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count);
+                    ff_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count);
                     s->tex_pb= backup_s.tex_pb;
                 }
                 s->last_bits= put_bits_count(&s->pb);
@@ -3589,7 +3589,7 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src)
 
     av_assert1(put_bits_count(&src->pb) % 8 ==0);
     av_assert1(put_bits_count(&dst->pb) % 8 ==0);
-    avpriv_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb));
+    ff_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb));
     flush_put_bits(&dst->pb);
 }
 
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 3cdd8a80a8..cd66a82a44 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -149,11 +149,12 @@ static inline void flush_put_bits_le(PutBitContext *s)
 
 #if FF_API_AVPRIV_PUT_BITS
 void avpriv_align_put_bits(PutBitContext *s);
+void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
 #endif
 
 #ifdef BITSTREAM_WRITER_LE
 #define ff_put_string ff_put_string_unsupported_here
-#define avpriv_copy_bits avpriv_copy_bits_unsupported_here
+#define ff_copy_bits ff_copy_bits_unsupported_here
 #else
 
 /**
@@ -169,7 +170,7 @@ void ff_put_string(PutBitContext *pb, const char *string,
  *
  * @param length the number of bits of src to copy
  */
-void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
+void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
 #endif
 
 static inline void put_bits_no_assert(PutBitContext *s, int n, BitBuf value)
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index 9e249aefe4..4fac0c26e5 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -472,7 +472,7 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane,
 
             if (best != 2)
             for (i = 5; i >= 0; i--)
-                avpriv_copy_bits(&s->pb, reorder_buffer[best][i],
+                ff_copy_bits(&s->pb, reorder_buffer[best][i],
                                  count[best][i]);
             if (best == 0)
                 s->hdsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index b8d0f6220d..a8fd99774e 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -1160,14 +1160,14 @@ static void save_bits(WmallDecodeCtx *s, GetBitContext* gb, int len,
 
     s->num_saved_bits += len;
     if (!append) {
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
+        ff_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
                          s->num_saved_bits);
     } else {
         int align = 8 - (get_bits_count(gb) & 7);
         align = FFMIN(align, len);
         put_bits(&s->pb, align, get_bits(gb, align));
         len -= align;
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
+        ff_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
     }
     skip_bits_long(gb, len);
 
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index cbf5fa7fd5..63e7680f9a 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1579,14 +1579,14 @@ static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
 
     s->num_saved_bits += len;
     if (!append) {
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
+        ff_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
                      s->num_saved_bits);
     } else {
         int align = 8 - (get_bits_count(gb) & 7);
         align = FFMIN(align, len);
         put_bits(&s->pb, align, get_bits(gb, align));
         len -= align;
-        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
+        ff_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
     }
     skip_bits_long(gb, len);
 
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index f6550c6a71..a588bb6c84 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -1865,7 +1865,7 @@ static int parse_packet_header(WMAVoiceContext *s)
  * @param size size of the source data, in bytes
  * @param gb bit I/O context specifying the current position in the source.
  *           data. This function might use this to align the bit position to
- *           a whole-byte boundary before calling #avpriv_copy_bits() on aligned
+ *           a whole-byte boundary before calling #ff_copy_bits() on aligned
  *           source data
  * @param nbits the amount of bits to copy from source to target
  *
@@ -1886,7 +1886,7 @@ static void copy_bits(PutBitContext *pb,
     rmn_bits &= 7; rmn_bytes >>= 3;
     if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0)
         put_bits(pb, rmn_bits, get_bits(gb, rmn_bits));
-    avpriv_copy_bits(pb, data + size - rmn_bytes,
+    ff_copy_bits(pb, data + size - rmn_bytes,
                  FFMIN(nbits - rmn_bits, rmn_bytes << 3));
 }
 



More information about the ffmpeg-cvslog mailing list