|
|
|
@@ -1,20 +1,23 @@
|
|
|
|
|
From 7951dc4c7e8461da1ca003776ebd318d631ee6cb Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 976b0ab59e4eb5242729d960539cb2714c6cba28 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: Daryl Seah <daryl.seah@intel.com>
|
|
|
|
|
Date: Fri, 18 Jan 2019 02:11:38 +0000
|
|
|
|
|
Subject: [PATCH] Add ability for ffmpeg to run svt-av1
|
|
|
|
|
Subject: [PATCH 1/1] Add ability for ffmpeg to run svt-av1
|
|
|
|
|
|
|
|
|
|
Change-Id: I37ee5414fdd99e0b3f112a6e5ede166f3e48d819
|
|
|
|
|
Signed-off-by: Daryl Seah <daryl.seah@intel.com>
|
|
|
|
|
Signed-off-by: Jing SUN <jing.a.sun@intel.com>
|
|
|
|
|
---
|
|
|
|
|
configure | 4 +
|
|
|
|
|
libavcodec/Makefile | 1 +
|
|
|
|
|
libavcodec/allcodecs.c | 1 +
|
|
|
|
|
libavcodec/libsvt_av1.c | 498 ++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
4 files changed, 504 insertions(+)
|
|
|
|
|
libavcodec/libsvt_av1.c | 491 ++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
|
4 files changed, 497 insertions(+)
|
|
|
|
|
create mode 100644 libavcodec/libsvt_av1.c
|
|
|
|
|
|
|
|
|
|
Index: ffmpeg-4.1/configure
|
|
|
|
|
===================================================================
|
|
|
|
|
--- ffmpeg-4.1.orig/configure
|
|
|
|
|
+++ ffmpeg-4.1/configure
|
|
|
|
|
diff --git a/configure b/configure
|
|
|
|
|
index a70c5f9..5b5238a 100755
|
|
|
|
|
--- a/configure
|
|
|
|
|
+++ b/configure
|
|
|
|
|
@@ -262,6 +262,7 @@ External library support:
|
|
|
|
|
--enable-libspeex enable Speex de/encoding via libspeex [no]
|
|
|
|
|
--enable-libsrt enable Haivision SRT protocol via libsrt [no]
|
|
|
|
@@ -31,7 +34,7 @@ Index: ffmpeg-4.1/configure
|
|
|
|
|
libtensorflow
|
|
|
|
|
libtesseract
|
|
|
|
|
libtheora
|
|
|
|
|
@@ -3124,6 +3126,7 @@ libshine_encoder_select="audio_frame_que
|
|
|
|
|
@@ -3125,6 +3127,7 @@ libshine_encoder_select="audio_frame_queue"
|
|
|
|
|
libspeex_decoder_deps="libspeex"
|
|
|
|
|
libspeex_encoder_deps="libspeex"
|
|
|
|
|
libspeex_encoder_select="audio_frame_queue"
|
|
|
|
@@ -39,7 +42,7 @@ Index: ffmpeg-4.1/configure
|
|
|
|
|
libtheora_encoder_deps="libtheora"
|
|
|
|
|
libtwolame_encoder_deps="libtwolame"
|
|
|
|
|
libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
|
|
|
|
|
@@ -6134,6 +6137,7 @@ enabled libsoxr && require lib
|
|
|
|
|
@@ -6135,6 +6138,7 @@ enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
|
|
|
|
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
|
|
|
|
|
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
|
|
|
|
|
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
|
|
|
|
@@ -47,11 +50,11 @@ Index: ffmpeg-4.1/configure
|
|
|
|
|
enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
|
|
|
|
|
enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
|
|
|
|
|
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
|
|
|
|
|
Index: ffmpeg-4.1/libavcodec/Makefile
|
|
|
|
|
===================================================================
|
|
|
|
|
--- ffmpeg-4.1.orig/libavcodec/Makefile
|
|
|
|
|
+++ ffmpeg-4.1/libavcodec/Makefile
|
|
|
|
|
@@ -981,6 +981,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER)
|
|
|
|
|
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
|
|
|
|
|
index 3e41497..9b2e663 100644
|
|
|
|
|
--- a/libavcodec/Makefile
|
|
|
|
|
+++ b/libavcodec/Makefile
|
|
|
|
|
@@ -981,6 +981,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER) += libopusenc.o libopus.o \
|
|
|
|
|
OBJS-$(CONFIG_LIBSHINE_ENCODER) += libshine.o
|
|
|
|
|
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
|
|
|
|
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
|
|
|
@@ -59,10 +62,10 @@ Index: ffmpeg-4.1/libavcodec/Makefile
|
|
|
|
|
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
|
|
|
|
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
|
|
|
|
|
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
|
|
|
|
Index: ffmpeg-4.1/libavcodec/allcodecs.c
|
|
|
|
|
===================================================================
|
|
|
|
|
--- ffmpeg-4.1.orig/libavcodec/allcodecs.c
|
|
|
|
|
+++ ffmpeg-4.1/libavcodec/allcodecs.c
|
|
|
|
|
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
|
|
|
|
|
index 1b8144a..f7df66c 100644
|
|
|
|
|
--- a/libavcodec/allcodecs.c
|
|
|
|
|
+++ b/libavcodec/allcodecs.c
|
|
|
|
|
@@ -697,6 +697,7 @@ extern AVCodec ff_librsvg_decoder;
|
|
|
|
|
extern AVCodec ff_libshine_encoder;
|
|
|
|
|
extern AVCodec ff_libspeex_encoder;
|
|
|
|
@@ -71,11 +74,12 @@ Index: ffmpeg-4.1/libavcodec/allcodecs.c
|
|
|
|
|
extern AVCodec ff_libtheora_encoder;
|
|
|
|
|
extern AVCodec ff_libtwolame_encoder;
|
|
|
|
|
extern AVCodec ff_libvo_amrwbenc_encoder;
|
|
|
|
|
Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
|
|
|
|
|
===================================================================
|
|
|
|
|
diff --git a/libavcodec/libsvt_av1.c b/libavcodec/libsvt_av1.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..1eba049
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ ffmpeg-4.1/libavcodec/libsvt_av1.c
|
|
|
|
|
@@ -0,0 +1,498 @@
|
|
|
|
|
+++ b/libavcodec/libsvt_av1.c
|
|
|
|
|
@@ -0,0 +1,491 @@
|
|
|
|
|
+/*
|
|
|
|
|
+* Scalable Video Technology for AV1 encoder library plugin
|
|
|
|
|
+*
|
|
|
|
@@ -122,7 +126,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
|
|
|
|
|
+ int eos_flag;
|
|
|
|
|
+
|
|
|
|
|
+ // User options.
|
|
|
|
|
+ int vui_info;
|
|
|
|
|
+ int hierarchical_level;
|
|
|
|
|
+ int la_depth;
|
|
|
|
|
+ int enc_mode;
|
|
|
|
@@ -274,9 +277,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
|
|
|
|
|
+ param->intra_refresh_type =
|
|
|
|
|
+ !!(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) + 1;
|
|
|
|
|
+
|
|
|
|
|
+ if (svt_enc->vui_info)
|
|
|
|
|
+ param->video_usability_info = svt_enc->vui_info;
|
|
|
|
|
+
|
|
|
|
|
+ if (svt_enc->la_depth != -1)
|
|
|
|
|
+ param->look_ahead_distance = svt_enc->la_depth;
|
|
|
|
|
+
|
|
|
|
@@ -477,9 +477,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
|
|
|
|
|
+#define OFFSET(x) offsetof(SvtContext, x)
|
|
|
|
|
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
|
|
|
|
+static const AVOption options[] = {
|
|
|
|
|
+ { "vui", "Enable vui info", OFFSET(vui_info),
|
|
|
|
|
+ AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
|
|
|
|
|
+
|
|
|
|
|
+ { "aud", "Include AUD", OFFSET(aud),
|
|
|
|
|
+ AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
|
|
|
|
|
+
|
|
|
|
@@ -574,3 +571,6 @@ Index: ffmpeg-4.1/libavcodec/libsvt_av1.c
|
|
|
|
|
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
|
|
|
|
+ .wrapper_name = "libsvt_av1",
|
|
|
|
|
+};
|
|
|
|
|
--
|
|
|
|
|
1.8.3.1
|
|
|
|
|
|
|
|
|
|