summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Bull <[email protected]>2019-02-01 11:50:42 -0500
committerBradley Sepos <[email protected]>2019-09-17 17:10:51 -0400
commit01e909bffccf71b4be4cb8ff5efdeb2d12b9e189 (patch)
treea2dd69ac54bfc669fb745dbc09ddbfdfd57b3c07
parentd0fea86cfdf710b24fbe99f99590f6f73cc98a7e (diff)
contrib: Use libdav1d for AV1 decoding in FFmpeg.
-rw-r--r--THANKS.markdown1
-rw-r--r--contrib/ffmpeg/module.defs4
-rw-r--r--contrib/libdav1d/A00-add-cross-file.patch19
-rw-r--r--contrib/libdav1d/module.defs27
-rw-r--r--contrib/libdav1d/module.rules2
-rw-r--r--gtk/configure.ac2
-rw-r--r--libhb/module.defs4
-rw-r--r--make/configure.py2
-rw-r--r--make/include/main.defs1
-rw-r--r--test/module.defs2
10 files changed, 59 insertions, 5 deletions
diff --git a/THANKS.markdown b/THANKS.markdown
index 6b0b78a2f..6783e1d56 100644
--- a/THANKS.markdown
+++ b/THANKS.markdown
@@ -8,6 +8,7 @@ HandBrake uses many cool libraries from the GNU/Linux world. We thank them and t
- [libass](https://github.com/libass/libass)
- [libbluray](https://www.videolan.org/developers/libbluray.html)
- [libbzip2](http://bzip.org/)
+- [libdav1d](https://code.videolan.org/videolan/dav1d)
- [libdvdnav](https://dvdnav.mplayerhq.hu/)
- [libdvdread](https://dvdnav.mplayerhq.hu/)
- [libfdk-aac](https://sourceforge.net/projects/opencore-amr/)
diff --git a/contrib/ffmpeg/module.defs b/contrib/ffmpeg/module.defs
index afbe4881a..f826a07d4 100644
--- a/contrib/ffmpeg/module.defs
+++ b/contrib/ffmpeg/module.defs
@@ -1,4 +1,4 @@
-__deps__ := BZIP2 ZLIB FDKAAC LIBVPX LAME LIBOPUS LIBSPEEX XZ
+__deps__ := BZIP2 ZLIB FDKAAC LIBDAV1D LIBVPX LAME LIBOPUS LIBSPEEX XZ
ifeq (1,$(FEATURE.qsv))
__deps__ += LIBMFX
endif
@@ -55,6 +55,8 @@ FFMPEG.CONFIGURE.extra = \
--enable-encoder=libvpx_vp8 \
--enable-encoder=libvpx_vp9 \
--disable-decoder=*_crystalhd \
+ --enable-libdav1d \
+ --enable-decoder=libdav1d \
--cc="$(FFMPEG.GCC.gcc)" \
--extra-ldflags="$(call fn.ARGS,FFMPEG.GCC,*archs *sysroot *minver ?extra) -L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib)"
diff --git a/contrib/libdav1d/A00-add-cross-file.patch b/contrib/libdav1d/A00-add-cross-file.patch
new file mode 100644
index 000000000..9f5327b44
--- /dev/null
+++ b/contrib/libdav1d/A00-add-cross-file.patch
@@ -0,0 +1,19 @@
+diff -Naur /dev/null dav1d-f1b756ef5bdc0bb759b2b140f15362fec024c1ff/x86_64-w64-mingw32.meson
+--- /dev/null 2019-02-01 11:36:25.027425148 -0500
++++ dav1d-f1b756ef5bdc0bb759b2b140f15362fec024c1ff/x86_64-w64-mingw32.meson 2019-02-01 12:10:45.582462644 -0500
+@@ -0,0 +1,15 @@
++[binaries]
++c = 'x86_64-w64-mingw32-gcc'
++cpp = 'x86_64-w64-mingw32-g++'
++ar = 'x86_64-w64-mingw32-ar'
++strip = 'x86_64-w64-mingw32-strip'
++windres = 'x86_64-w64-mingw32-windres'
++
++[properties]
++c_link_args = ['-static-libgcc']
++
++[host_machine]
++system = 'windows'
++cpu_family = 'x86_64'
++cpu = 'x86_64'
++endian = 'little'
diff --git a/contrib/libdav1d/module.defs b/contrib/libdav1d/module.defs
new file mode 100644
index 000000000..6dae46251
--- /dev/null
+++ b/contrib/libdav1d/module.defs
@@ -0,0 +1,27 @@
+$(eval $(call import.MODULE.defs,LIBDAV1D,libdav1d,PTHREADW32))
+$(eval $(call import.CONTRIB.defs,LIBDAV1D))
+
+LIBDAV1D.FETCH.url = https://code.videolan.org/videolan/dav1d/-/archive/0.4.0/dav1d-0.4.0.tar.bz2
+LIBDAV1D.FETCH.sha256 = 18bf96c5168b8c704422387620fefaa953e8dbd4eacb0f0796c03d6e741f8924
+
+LIBDAV1D.build_dir = build/
+
+LIBDAV1D.CONFIGURE.exe = $(MESON.exe)
+LIBDAV1D.CONFIGURE.deps =
+LIBDAV1D.CONFIGURE.shared =
+LIBDAV1D.CONFIGURE.host =
+LIBDAV1D.CONFIGURE.build =
+LIBDAV1D.CONFIGURE.static = -Ddefault_library=static
+LIBDAV1D.CONFIGURE.extra = --libdir=$(call fn.ABSOLUTE,$(CONTRIB.build/))lib/ --buildtype=release
+LIBDAV1D.CONFIGURE.env =
+
+ifeq (1-mingw,$(HOST.cross)-$(HOST.system))
+ LIBDAV1D.CONFIGURE.extra += --cross-file=$(call fn.ABSOLUTE,$(LIBDAV1D.EXTRACT.dir/))x86_64-w64-mingw32.meson
+endif
+
+LIBDAV1D.BUILD.make = $(NINJA.exe)
+LIBDAV1D.BUILD.extra = -v
+
+LIBDAV1D.INSTALL.make = $(NINJA.exe)
+
+LIBDAV1D.CLEAN.make = $(NINJA.exe)
diff --git a/contrib/libdav1d/module.rules b/contrib/libdav1d/module.rules
new file mode 100644
index 000000000..dcfa3f8cb
--- /dev/null
+++ b/contrib/libdav1d/module.rules
@@ -0,0 +1,2 @@
+$(eval $(call import.MODULE.rules,LIBDAV1D))
+$(eval $(call import.CONTRIB.rules,LIBDAV1D))
diff --git a/gtk/configure.ac b/gtk/configure.ac
index 0f4f33f85..92aabcbe8 100644
--- a/gtk/configure.ac
+++ b/gtk/configure.ac
@@ -199,7 +199,7 @@ PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
GHB_CFLAGS="$HBINC $GHB_CFLAGS"
-HB_LIBS="-lhandbrake -lavformat -lavfilter -lavcodec -lavutil -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex -llzma"
+HB_LIBS="-lhandbrake -lavformat -lavfilter -lavcodec -lavutil -ldav1d -lswresample -lpostproc -ldvdnav -ldvdread -lmp3lame -lvorbis -lvorbisenc -logg -lx264 -lswscale -ltheoraenc -ltheoradec -lvpx -lz -lbz2 -lbluray -lass -lfontconfig -lfreetype -lxml2 -ljansson -lopus -lspeex -llzma"
if test "x$use_fdk_aac" = "xyes" ; then
HB_LIBS="$HB_LIBS -lfdk-aac"
diff --git a/libhb/module.defs b/libhb/module.defs
index a2d444447..80cc52b34 100644
--- a/libhb/module.defs
+++ b/libhb/module.defs
@@ -1,7 +1,7 @@
__deps__ := A52DEC BZIP2 LIBVPX FFMPEG FREETYPE LAME LIBASS LIBDCA \
LIBDVDREAD LIBDVDNAV LIBICONV LIBSAMPLERATE LIBTHEORA LIBVORBIS LIBOGG \
LIBXML2 X264 X265 ZLIB LIBBLURAY FDKAAC LIBMFX LIBGNURX JANSSON \
- HARFBUZZ LIBOPUS LIBSPEEX
+ HARFBUZZ LIBOPUS LIBSPEEX LIBDAV1D
ifeq (,$(filter $(HOST.system),darwin cygwin mingw))
__deps__ += FONTCONFIG
@@ -103,7 +103,7 @@ LIBHB.lib = $(LIBHB.build/)hb.lib
LIBHB.dll.libs = $(foreach n, \
ass avformat avfilter avcodec avutil swresample postproc dvdnav dvdread \
freetype mp3lame swscale vpx theora vorbis vorbisenc ogg \
- x264 xml2 bluray jansson harfbuzz opus speex, \
+ x264 xml2 bluray jansson harfbuzz opus speex dav1d, \
$(CONTRIB.build/)lib/lib$(n).a )
ifeq (1,$(FEATURE.fdk_aac))
diff --git a/make/configure.py b/make/configure.py
index 3dfba1106..486ebd47f 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -1562,7 +1562,9 @@ try:
gmake = ToolProbe( 'GMAKE.exe', 'make', 'gmake', 'make', abort=True )
m4 = ToolProbe( 'M4.exe', 'm4', 'gm4', 'm4', abort=True )
+ meson = ToolProbe( 'MESON.exe', 'meson', 'meson', abort=True )
mkdir = ToolProbe( 'MKDIR.exe', 'mkdir', 'mkdir', abort=True )
+ ninja = ToolProbe( 'NINJA.exe', 'ninja', 'ninja', abort=True )
patch = ToolProbe( 'PATCH.exe', 'patch', 'gpatch', 'patch', abort=True )
rm = ToolProbe( 'RM.exe', 'rm', 'rm', abort=True )
ranlib = ToolProbe( 'RANLIB.exe', 'ranlib', 'ranlib', abort=True )
diff --git a/make/include/main.defs b/make/include/main.defs
index b11d00d28..0123b54f5 100644
--- a/make/include/main.defs
+++ b/make/include/main.defs
@@ -46,6 +46,7 @@ ifeq (1,$(FEATURE.x265))
MODULES += contrib/x265_12bit
endif
+MODULES += contrib/libdav1d
MODULES += contrib/ffmpeg
MODULES += contrib/libdvdread
MODULES += contrib/libdvdnav
diff --git a/test/module.defs b/test/module.defs
index 22000f73c..ffc00a8b2 100644
--- a/test/module.defs
+++ b/test/module.defs
@@ -17,7 +17,7 @@ TEST.GCC.l = \
ass avformat avfilter avcodec avutil swresample postproc mp3lame dvdnav \
dvdread fribidi \
swscale vpx theoraenc theoradec vorbis vorbisenc ogg x264 \
- bluray freetype xml2 bz2 z jansson harfbuzz opus speex lzma
+ bluray freetype xml2 bz2 z jansson harfbuzz opus speex lzma dav1d
ifeq (,$(filter $(HOST.system),darwin cygwin mingw))
TEST.GCC.l += fontconfig