summaryrefslogtreecommitdiff
path: root/media-libs/svt-av1
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/svt-av1')
-rw-r--r--media-libs/svt-av1/Manifest5
-rw-r--r--media-libs/svt-av1/files/svt-av1-0.8.6-fix-c-only-build.patch123
-rw-r--r--media-libs/svt-av1/metadata.xml18
-rw-r--r--media-libs/svt-av1/svt-av1-0.8.6.ebuild36
-rw-r--r--media-libs/svt-av1/svt-av1-9999.ebuild34
5 files changed, 216 insertions, 0 deletions
diff --git a/media-libs/svt-av1/Manifest b/media-libs/svt-av1/Manifest
new file mode 100644
index 000000000000..71545a1de1ba
--- /dev/null
+++ b/media-libs/svt-av1/Manifest
@@ -0,0 +1,5 @@
+AUX svt-av1-0.8.6-fix-c-only-build.patch 5078 BLAKE2B c26a13dba8ac62ec2951d43d1419d6cacebbbb185841636845fb20a6aecb1c6fe4cabc1ab53748c3df0a4b2fcb8e25ff7b63447c486655fc8ec23144ed8388d4 SHA512 41f3c400bc6ff0c8df529cc5db125538367bc36468bc000936e76f58bfaff15d3fbf322ec2705ac20281753273ab834a1691e7852ede6baaec003b1d46285e1f
+DIST svt-av1-0.8.6.tar.gz 6416120 BLAKE2B c30d3bfc2dba6d7964625c4505bb135aa335adf195df91ad058fb02496276cabdc651b09854a2d14136352a434e08f4974148e03e7d54bde0924d25a1c4524cd SHA512 07e7353e35bc581b23c71913e65f5fd27566f4bf1d317d474d57d5bb2b82f380f713a00be19bd3f703935da50f81f3abf1d4ae38fbdf253385edf423737c0543
+EBUILD svt-av1-0.8.6.ebuild 1122 BLAKE2B f0f3d148a69c3a95d622d165a6091f77b6c3ce5c67ff42d1ed7875bb71192541c35c8c96476171dbbe572eee1ba3c651509cf52dab98399626bd5788b0eb962f SHA512 2ba17f2c63f9f9c746e32e93de6e692fcb12c86fbf5d684804258ca20c76159e6324e30e8cbc8a9f374acc3953627caca730a4e2278e1e22fe03e80dfa8ac46d
+EBUILD svt-av1-9999.ebuild 1055 BLAKE2B af96eb94a47185ddf01ef21ccb5044ecdaa5ea3eee428a05de6bad22022d8777d4dfa31a6de1290200504d01b27a5129fa92b02832eaeadc653b8043b98be589 SHA512 45326879f4d0069b712a1ab85a5fa4b1ab4324f7eeb21c7735821dced5e638bf7430e4f2357511cbc2f596d7364316268194a406981e6c7fa617cfa8d077535d
+MISC metadata.xml 531 BLAKE2B b276b87582bf66d16429b34b3c55c522b459700dd11010c85210ba8377538bd91b74fe65f6464dddef9f3aca809b9d2e836ce67875574960a6dbdfea34fb9172 SHA512 99100bbfcbe32caa3d5a80121a512802cf01da9b439b5baae5ca88a694658a50783d42bd047e349367a42dca2c724684bbe216fdc8e433d8aa4a58ac9cfae2c6
diff --git a/media-libs/svt-av1/files/svt-av1-0.8.6-fix-c-only-build.patch b/media-libs/svt-av1/files/svt-av1-0.8.6-fix-c-only-build.patch
new file mode 100644
index 000000000000..81c82bb1358f
--- /dev/null
+++ b/media-libs/svt-av1/files/svt-av1-0.8.6-fix-c-only-build.patch
@@ -0,0 +1,123 @@
+https://bugs.gentoo.org/766156
+https://github.com/AOMediaCodec/SVT-AV1/commit/09c90e4cfb602b9a247a8a256923bdbddaf2ed9b
+
+From 09c90e4cfb602b9a247a8a256923bdbddaf2ed9b Mon Sep 17 00:00:00 2001
+From: Slawomir Pawlowski <slawomir.pawlowski@intel.com>
+Date: Fri, 18 Dec 2020 16:47:20 +0100
+Subject: [PATCH] Fix C only build
+
+---
+ CMakeLists.txt | 5 ++++-
+ Source/Lib/Common/Codec/common_dsp_rtcd.c | 5 ++++-
+ Source/Lib/Common/Codec/common_dsp_rtcd.h | 2 ++
+ Source/Lib/Decoder/CMakeLists.txt | 5 ++++-
+ Source/Lib/Encoder/CMakeLists.txt | 5 ++++-
+ Source/Lib/Encoder/Codec/firstpass.c | 2 +-
+ 6 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8baff740b1..efdd7385fb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -302,6 +302,9 @@ if(BUILD_TESTING)
+ endif()
+
+ add_subdirectory(third_party/fastfeat)
+-add_subdirectory(third_party/cpuinfo)
++
++if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
++ add_subdirectory(third_party/cpuinfo)
++endif()
+
+ install(DIRECTORY ${PROJECT_SOURCE_DIR}/Source/API/ DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/svt-av1" FILES_MATCHING PATTERN "*.h")
+diff --git a/Source/Lib/Common/Codec/common_dsp_rtcd.c b/Source/Lib/Common/Codec/common_dsp_rtcd.c
+index e24f99f66b..c09f088b88 100644
+--- a/Source/Lib/Common/Codec/common_dsp_rtcd.c
++++ b/Source/Lib/Common/Codec/common_dsp_rtcd.c
+@@ -17,8 +17,10 @@
+ #include "EbPackUnPack_C.h"
+ #include "EbAvcStyleMcp.h"
+
++#ifdef ARCH_X86_64
+ // for get_cpu_flags
+ #include "cpuinfo.h"
++#endif
+
+ /*
+ * DSP deprecated flags
+@@ -69,7 +71,7 @@ int64_t svt_av1_block_error_c(const TranLow *coeff, const TranLow *dqcoeff,
+ /**************************************
+ * Instruction Set Support
+ **************************************/
+-
++#ifdef ARCH_X86_64
+ CPU_FLAGS get_cpu_flags() {
+ CPU_FLAGS flags = 0;
+
+@@ -105,6 +107,7 @@ CPU_FLAGS get_cpu_flags_to_use() {
+ #endif
+ return flags;
+ }
++#endif /*ARCH_X86_64*/
+
+ #ifdef ARCH_X86_64
+ #ifndef NON_AVX512_SUPPORT
+diff --git a/Source/Lib/Common/Codec/common_dsp_rtcd.h b/Source/Lib/Common/Codec/common_dsp_rtcd.h
+index b76882b003..f67243f3d4 100644
+--- a/Source/Lib/Common/Codec/common_dsp_rtcd.h
++++ b/Source/Lib/Common/Codec/common_dsp_rtcd.h
+@@ -67,8 +67,10 @@ extern "C" {
+ #endif
+
+ // Helper Functions
++#ifdef ARCH_X86_64
+ CPU_FLAGS get_cpu_flags();
+ CPU_FLAGS get_cpu_flags_to_use();
++#endif
+ void setup_common_rtcd_internal(CPU_FLAGS flags);
+ void svt_aom_blend_a64_vmask_c(uint8_t *dst, uint32_t dst_stride, const uint8_t *src0, uint32_t src0_stride, const uint8_t *src1, uint32_t src1_stride, const uint8_t *mask, int w, int h);
+ RTCD_EXTERN void(*svt_aom_blend_a64_vmask)(uint8_t *dst, uint32_t dst_stride, const uint8_t *src0, uint32_t src0_stride, const uint8_t *src1, uint32_t src1_stride, const uint8_t *mask, int w, int h);
+diff --git a/Source/Lib/Decoder/CMakeLists.txt b/Source/Lib/Decoder/CMakeLists.txt
+index c8ffc57657..c71c4da0b8 100644
+--- a/Source/Lib/Decoder/CMakeLists.txt
++++ b/Source/Lib/Decoder/CMakeLists.txt
+@@ -99,7 +99,9 @@ set_target_properties(SvtAv1Dec PROPERTI
+ set_target_properties(SvtAv1Dec PROPERTIES SOVERSION ${DEC_VERSION_MAJOR})
+ add_dependencies(SvtAv1Dec EbVersionHeaderGen)
+ target_link_libraries(SvtAv1Dec PUBLIC ${PLATFORM_LIBS})
+-target_link_libraries(SvtAv1Dec PRIVATE cpuinfo_public)
++if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
++ target_link_libraries(SvtAv1Dec PRIVATE cpuinfo_public)
++endif()
+ install(TARGETS SvtAv1Dec DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
+ configure_file(pkg-config.pc.in ${CMAKE_BINARY_DIR}/SvtAv1Dec.pc @ONLY)
+diff --git a/Source/Lib/Encoder/CMakeLists.txt b/Source/Lib/Encoder/CMakeLists.txt
+index 936592e1ce..ab310dcef1 100644
+--- a/Source/Lib/Encoder/CMakeLists.txt
++++ b/Source/Lib/Encoder/CMakeLists.txt
+@@ -130,7 +130,9 @@ endif()
+ set_target_properties(SvtAv1Enc PROPERTIES VERSION ${ENC_VERSION})
+ set_target_properties(SvtAv1Enc PROPERTIES SOVERSION ${ENC_VERSION_MAJOR})
+ target_link_libraries(SvtAv1Enc PUBLIC ${PLATFORM_LIBS})
+-target_link_libraries(SvtAv1Enc PRIVATE cpuinfo_public)
++if(NOT COMPILE_C_ONLY AND HAVE_X86_PLATFORM)
++ target_link_libraries(SvtAv1Enc PRIVATE cpuinfo_public)
++endif()
+ install(TARGETS SvtAv1Enc DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
+ configure_file(pkg-config.pc.in ${CMAKE_BINARY_DIR}/SvtAv1Enc.pc @ONLY)
+diff --git a/Source/Lib/Encoder/Codec/firstpass.c b/Source/Lib/Encoder/Codec/firstpass.c
+index feb7a1fae7..80b7dd05d8 100644
+--- a/Source/Lib/Encoder/Codec/firstpass.c
++++ b/Source/Lib/Encoder/Codec/firstpass.c
+@@ -1189,8 +1189,8 @@ static void first_pass_setup_me_context(MotionEstimationContext_t *context_ptr,
+ // set search method
+ context_ptr->me_context_ptr->hme_search_method = SUB_SAD_SEARCH;
+
+- uint8_t *src_ptr = &(input_picture_ptr->buffer_y[buffer_index]);
+ #ifdef ARCH_X86_64
++ uint8_t *src_ptr = &(input_picture_ptr->buffer_y[buffer_index]);
+ //_MM_HINT_T0 //_MM_HINT_T1 //_MM_HINT_T2 //_MM_HINT_NTA
+ uint32_t i;
+ for (i = 0; i < sb_height; i++) {
diff --git a/media-libs/svt-av1/metadata.xml b/media-libs/svt-av1/metadata.xml
new file mode 100644
index 000000000000..ba30acda57ab
--- /dev/null
+++ b/media-libs/svt-av1/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>telans@posteo.de</email>
+ <name>Theo Anderson</name>
+ </maintainer>
+ <maintainer type="project">
+ <name>Proxy Maintainers</name>
+ <email>proxy-maint@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>media-video@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">AOMediaCodec/SVT-AV1</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-libs/svt-av1/svt-av1-0.8.6.ebuild b/media-libs/svt-av1/svt-av1-0.8.6.ebuild
new file mode 100644
index 000000000000..d7d8df53a362
--- /dev/null
+++ b/media-libs/svt-av1/svt-av1-0.8.6.ebuild
@@ -0,0 +1,36 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake flag-o-matic
+
+DESCRIPTION="Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder)"
+HOMEPAGE="https://github.com/AOMediaCodec/SVT-AV1"
+
+if [[ ${PV} = 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/AOMediaCodec/SVT-AV1.git"
+else
+ SRC_URI="https://github.com/AOMediaCodec/SVT-AV1/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~sparc -x86" # -x86: https://github.com/AOMediaCodec/SVT-AV1/issues/1231
+ S="${WORKDIR}/SVT-AV1-${PV}"
+fi
+
+# Also see "Alliance for Open Media Patent License 1.0"
+LICENSE="BSD-2 Apache-2.0 BSD ISC LGPL-2.1+ MIT"
+SLOT="0"
+
+PATCHES=( "${FILESDIR}"/${P}-fix-c-only-build.patch )
+
+src_configure() {
+ append-ldflags -Wl,-z,noexecstack
+ local mycmakeargs=(
+ # Tests require linking against https://github.com/Cidana-Developers/aom/tree/av1-normative ?
+ # undefined reference to `ifd_inspect'
+ # https://github.com/Cidana-Developers/aom/commit/cfc5c9e95bcb48a5a41ca7908b44df34ea1313c0
+ -DBUILD_TESTING=OFF
+ )
+
+ cmake_src_configure
+}
diff --git a/media-libs/svt-av1/svt-av1-9999.ebuild b/media-libs/svt-av1/svt-av1-9999.ebuild
new file mode 100644
index 000000000000..9bd9658e06a6
--- /dev/null
+++ b/media-libs/svt-av1/svt-av1-9999.ebuild
@@ -0,0 +1,34 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake flag-o-matic
+
+DESCRIPTION="Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder)"
+HOMEPAGE="https://github.com/AOMediaCodec/SVT-AV1"
+
+if [[ ${PV} = 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/AOMediaCodec/SVT-AV1.git"
+else
+ SRC_URI="https://github.com/AOMediaCodec/SVT-AV1/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 -x86" # -x86: https://github.com/AOMediaCodec/SVT-AV1/issues/1231
+ S="${WORKDIR}/SVT-AV1-${PV}"
+fi
+
+# Also see "Alliance for Open Media Patent License 1.0"
+LICENSE="BSD-2 Apache-2.0 BSD ISC LGPL-2.1+ MIT"
+SLOT="0"
+
+src_configure() {
+ append-ldflags -Wl,-z,noexecstack
+ local mycmakeargs=(
+ # Tests require linking against https://github.com/Cidana-Developers/aom/tree/av1-normative ?
+ # undefined reference to `ifd_inspect'
+ # https://github.com/Cidana-Developers/aom/commit/cfc5c9e95bcb48a5a41ca7908b44df34ea1313c0
+ -DBUILD_TESTING=OFF
+ )
+
+ cmake_src_configure
+}