1- From 57e878ae0a763aae867a31457b1a5a4f4edb6b92 Mon Sep 17 00:00:00 2001
1+ From 52d1e387fa28437a2406baedbd862cef2abd3021 Mon Sep 17 00:00:00 2001
22From: Martin Pulec <
[email protected] >
3- Date: Thu, 25 Jan 2024 16:56:08 +0100
3+ Date: Wed, 16 Oct 2024 09:43:16 +0200
44Subject: [PATCH] added libde265 decoder
55
66---
77 configure | 4 +
88 libavcodec/Makefile | 1 +
99 libavcodec/allcodecs.c | 1 +
10- libavcodec/libde265dec.c | 773 +++++++++++++++++++++++++++++++++++++++
11- 4 files changed, 779 insertions(+)
10+ libavcodec/libde265dec.c | 766 +++++++++++++++++++++++++++++++++++++++
11+ 4 files changed, 772 insertions(+)
1212 create mode 100644 libavcodec/libde265dec.c
1313
1414diff --git a/configure b/configure
15- index e019d1b996..2621010a21 100755
15+ index f89e9425da..0691d33a9f 100755
1616--- a/configure
1717+++ b/configure
18- @@ -227 ,6 +227 ,7 @@ External library support:
18+ @@ -228 ,6 +228 ,7 @@ External library support:
1919 --enable-libdavs2 enable AVS2 decoding via libdavs2 [no]
2020 --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
2121 and libraw1394 [no]
2222+ --enable-libde265 enable HEVC encoding via libde265 [no]
2323 --enable-libdvdnav enable libdvdnav, needed for DVD demuxing [no]
2424 --enable-libdvdread enable libdvdread, needed for DVD demuxing [no]
2525 --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
26- @@ -1862 ,6 +1863 ,7 @@ EXTERNAL_LIBRARY_LIST="
26+ @@ -1921 ,6 +1922 ,7 @@ EXTERNAL_LIBRARY_LIST="
2727 libcodec2
2828 libdav1d
2929 libdc1394
3030+ libde265
3131 libflite
3232 libfontconfig
3333 libfreetype
34- @@ -3435 ,6 +3437 ,7 @@ libdav1d_decoder_deps="libdav1d"
35- libdav1d_decoder_select="atsc_a53"
34+ @@ -3543 ,6 +3545 ,7 @@ libdav1d_decoder_deps="libdav1d"
35+ libdav1d_decoder_select="atsc_a53 dovi_rpudec "
3636 libdavs2_decoder_deps="libdavs2"
3737 libdavs2_decoder_select="avs2_parser"
3838+ libde265_decoder_deps="libde265"
3939 libfdk_aac_decoder_deps="libfdk_aac"
4040 libfdk_aac_encoder_deps="libfdk_aac"
4141 libfdk_aac_encoder_select="audio_frame_queue"
42- @@ -6771 ,6 +6774 ,7 @@ enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lc
42+ @@ -6905 ,6 +6908 ,7 @@ enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lc
4343 enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version
4444 enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
4545 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
@@ -48,10 +48,10 @@ index e019d1b996..2621010a21 100755
4848 enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >= 6.1.1" dvdnav/dvdnav.h dvdnav_open2
4949 enabled libdvdread && require_pkg_config libdvdread "dvdread >= 6.1.2" dvdread/dvd_reader.h DVDOpen2
5050diff --git a/libavcodec/Makefile b/libavcodec/Makefile
51- index 708434ac76..96c92c1204 100644
51+ index 270f39d5b3..d0aa9bed98 100644
5252--- a/libavcodec/Makefile
5353+++ b/libavcodec/Makefile
54- @@ -1112 ,6 +1112 ,7 @@ OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o
54+ @@ -1124 ,6 +1124 ,7 @@ OBJS-$(CONFIG_LIBCODEC2_DECODER) += libcodec2.o
5555 OBJS-$(CONFIG_LIBCODEC2_ENCODER) += libcodec2.o
5656 OBJS-$(CONFIG_LIBDAV1D_DECODER) += libdav1d.o av1_parse.o
5757 OBJS-$(CONFIG_LIBDAVS2_DECODER) += libdavs2.o
@@ -60,10 +60,10 @@ index 708434ac76..96c92c1204 100644
6060 OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o
6161 OBJS-$(CONFIG_LIBGSM_DECODER) += libgsmdec.o
6262diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
63- index 2386b450a6..c9362f3753 100644
63+ index c7e5f9910c..4c7a3b53f5 100644
6464--- a/libavcodec/allcodecs.c
6565+++ b/libavcodec/allcodecs.c
66- @@ -766 ,6 +766 ,7 @@ extern const FFCodec ff_libcodec2_encoder;
66+ @@ -767 ,6 +767 ,7 @@ extern const FFCodec ff_libcodec2_encoder;
6767 extern const FFCodec ff_libcodec2_decoder;
6868 extern const FFCodec ff_libdav1d_decoder;
6969 extern const FFCodec ff_libdavs2_decoder;
@@ -73,10 +73,10 @@ index 2386b450a6..c9362f3753 100644
7373 extern const FFCodec ff_libgsm_encoder;
7474diff --git a/libavcodec/libde265dec.c b/libavcodec/libde265dec.c
7575new file mode 100644
76- index 0000000000..e5a18c4942
76+ index 0000000000..81c8894a52
7777--- /dev/null
7878+++ b/libavcodec/libde265dec.c
79- @@ -0,0 +1,773 @@
79+ @@ -0,0 +1,766 @@
8080+ /*
8181+ * H.265 decoder
8282+ *
@@ -790,12 +790,6 @@ index 0000000000..e5a18c4942
790790+ }
791791+
792792+
793- + static av_cold void ff_libde265dec_static_init(struct FFCodec *codec)
794- + {
795- + // No initialization required
796- + }
797- +
798- +
799793+ static av_cold int ff_libde265dec_ctx_init(AVCodecContext *avctx)
800794+ {
801795+ DE265Context *ctx = (DE265Context *) avctx->priv_data;
@@ -842,7 +836,6 @@ index 0000000000..e5a18c4942
842836+ .priv_data_size = sizeof(DE265Context),
843837+ .p.type = AVMEDIA_TYPE_VIDEO,
844838+ .p.id = AV_CODEC_ID_HEVC,
845- + .init_static_data = ff_libde265dec_static_init,
846839+ .init = ff_libde265dec_ctx_init,
847840+ FF_CODEC_DECODE_CB(ff_libde265dec_decode),
848841+ .close = ff_libde265dec_free,
@@ -851,5 +844,5 @@ index 0000000000..e5a18c4942
851844+ AV_CODEC_CAP_SLICE_THREADS,
852845+ };
853846- -
854- 2.44 .0
847+ 2.47 .0
855848
0 commit comments