ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Wed Jun  5 11:39:46 2024 +0200| [4482b3353d07684fdd5822b80814ebac1c9de765] | 
committer: Andreas Rheinhardt

avformat/vvc: Don't use ff_copy_bits()

There is no benefit in using it: The fast path of copying
is not taken because of misalignment; furthermore we are
only dealing with a few byte here anyway, so simply copy
the bytes manually, avoiding the dependency on bitstream.c
in lavf (which also contains a function that is completely
unused in lavf).

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

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

 libavformat/Makefile    | 1 -
 libavformat/bitstream.c | 1 -
 libavformat/vvc.c       | 4 ++--
 tests/ref/fate/source   | 1 -
 4 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 1c4d9deccd..af31d6f795 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -728,7 +728,6 @@ OBJS-$(CONFIG_LIBZMQ_PROTOCOL)           += libzmq.o
 # Objects duplicated from other libraries for shared builds
 SHLIBOBJS                                += log2_tab.o to_upper4.o
 SHLIBOBJS-$(CONFIG_ISO_MEDIA)            += mpegaudiotabs.o
-SHLIBOBJS-$(CONFIG_ISO_WRITER)           += bitstream.o
 SHLIBOBJS-$(CONFIG_FLV_MUXER)            += mpeg4audio_sample_rates.o
 SHLIBOBJS-$(CONFIG_HLS_DEMUXER)          += ac3_channel_layout_tab.o
 SHLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER)    += jpegxl_parse.o
diff --git a/libavformat/bitstream.c b/libavformat/bitstream.c
deleted file mode 100644
index 2afda37c30..0000000000
--- a/libavformat/bitstream.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "libavcodec/bitstream.c"
diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index d8195f0fd2..679bb07a4d 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -757,8 +757,8 @@ static int vvcc_write(AVIOContext *pb, 
VVCDecoderConfigurationRecord *vvcc)
         put_bits(&pbc, 1, vvcc->ptl.ptl_frame_only_constraint_flag);
         put_bits(&pbc, 1, vvcc->ptl.ptl_multilayer_enabled_flag);
         av_assert0(vvcc->ptl.num_bytes_constraint_info);
-        if (vvcc->ptl.num_bytes_constraint_info > 1)
-            ff_copy_bits(&pbc, vvcc->ptl.general_constraint_info, 
(vvcc->ptl.num_bytes_constraint_info - 1) * 8);
+        for (int i = 0; i < vvcc->ptl.num_bytes_constraint_info - 1; i++)
+            put_bits(&pbc, 8, vvcc->ptl.general_constraint_info[i]);
         put_bits(&pbc, 6, 
vvcc->ptl.general_constraint_info[vvcc->ptl.num_bytes_constraint_info - 1] & 
0x3f);
         flush_put_bits(&pbc);
         avio_write(pb, buf, put_bytes_output(&pbc));
diff --git a/tests/ref/fate/source b/tests/ref/fate/source
index a3beb35093..d7b48a8b85 100644
--- a/tests/ref/fate/source
+++ b/tests/ref/fate/source
@@ -7,7 +7,6 @@ libavdevice/file_open.c
 libavdevice/reverse.c
 libavfilter/file_open.c
 libavfilter/log2_tab.c
-libavformat/bitstream.c
 libavformat/file_open.c
 libavformat/golomb_tab.c
 libavformat/log2_tab.c

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to