Compare commits

...

48 Commits
master ... svt

Author SHA1 Message Date
ruki 35c9a9d865
Update xmake.lua 2 years ago
ruki a9e5bec5aa add pthread patch for svt av1 2 years ago
ruki 7fbae54cc1
Update xmake.lua 2 years ago
冰雪殇璃陌梦 8747434e7b
feat(svt-av1): test with has_cfuncs 2 years ago
冰雪殇璃陌梦 06511a4f68
fix(svt-av1): fix android build error 2 years ago
冰雪殇璃陌梦 8e8cf809dd
fix(svt-av1): fix android build error 2 years ago
冰雪殇璃陌梦 9eaa09282d
chore(svt-av1): tweaks 2 years ago
冰雪殇璃陌梦 a055769313
fix(svt-av1): fix android build error 2 years ago
冰雪殇璃陌梦 e2d36036b1
chore(svt-av1): tweaks 2 years ago
冰雪殇璃陌梦 9d65d79255
fix(svt-av1): fix build error on arm 2 years ago
冰雪殇璃陌梦 5653a2018a
fix(svt-av1): fix build error on mingw 2 years ago
冰雪殇璃陌梦 04b0f11b65
chore: temporarily remove libvpx 2 years ago
冰雪殇璃陌梦 d23b2639c9
fix(libvpx): fix typos 2 years ago
冰雪殇璃陌梦 7951eed7e4
feat:libvpx output config.log when configure failed 2 years ago
冰雪殇璃陌梦 f8e7d7d523
fix: fix bsd build error 2 years ago
冰雪殇璃陌梦 1ddabb8511
fix: fix bsd build error 2 years ago
冰雪殇璃陌梦 28f2c7cf7d
chore: tweaks 2 years ago
冰雪殇璃陌梦 d5453a9e31
fix(libvpx): fix a typo 2 years ago
冰雪殇璃陌梦 20a1799624
chore(libvpx): use nasm for mingw 2 years ago
冰雪殇璃陌梦 fdc592be0c
chore(libvpx): add debug msg 2 years ago
冰雪殇璃陌梦 29a5afe1eb
chore(libvpx): fix typos 2 years ago
冰雪殇璃陌梦 35d8c07494
chore(libvpx): add debug msg 2 years ago
冰雪殇璃陌梦 43fd7f8230
fix(libvpx): improve cc detect 2 years ago
冰雪殇璃陌梦 c80d104c40
fix(libvpx): support os name `ios` 2 years ago
冰雪殇璃陌梦 380e7884fa
chore(libvpx): tweaks 2 years ago
冰雪殇璃陌梦 c477d31581
fix(libvpx): fix some errors 2 years ago
冰雪殇璃陌梦 dcf980ed7c
fix(libvpx): fix build error 2 years ago
冰雪殇璃陌梦 1c26694bc0
fix(libvpx): fix cross build error 2 years ago
冰雪殇璃陌梦 b15ce31ddd
fix(svt-av1): fix wasm build error in some emscripten version 2 years ago
冰雪殇璃陌梦 2b54bdd654
feat: add package which 2 years ago
冰雪殇璃陌梦 81b7a4c81c
fix(libvpx): fix fedora build error 2 years ago
冰雪殇璃陌梦 06c5c20de5
fix(svt-av1): fix fedora build error 2 years ago
冰雪殇璃陌梦 d3dfa588a9
fix(libvpx): fix fedora build error 2 years ago
冰雪殇璃陌梦 1dbf5b4e1c
fix(svt-av1): fix a typo 2 years ago
冰雪殇璃陌梦 31452e62cb
fix(svt-av1): fix wasm build error 2 years ago
冰雪殇璃陌梦 4210da881f
fix(svt-av1): fix wasm build error 2 years ago
冰雪殇璃陌梦 2d4345e569
fix: use nasm in windows 2 years ago
冰雪殇璃陌梦 d50c542bf1
chore(svt-av1): remove unused deps 2 years ago
冰雪殇璃陌梦 bc15a8a57e
fix: fix typos 2 years ago
冰雪殇璃陌梦 481286292e
fix: fix typos 2 years ago
冰雪殇璃陌梦 ea2e660f54
fix: fix some build errors 2 years ago
冰雪殇璃陌梦 aae7d8a0f6
feat: add svt-av1 2 years ago
冰雪殇璃陌梦 c758101b9e
feat(libvpx): add configs 2 years ago
冰雪殇璃陌梦 59e3f31679
feat(libvpx): run configure manually 2 years ago
冰雪殇璃陌梦 a532ce9156
fix(libvpx): disable on windows and mobile platform 2 years ago
冰雪殇璃陌梦 d68ee49a82
fix(libvpx): fix an error 2 years ago
冰雪殇璃陌梦 4e1371b673
fix(libvpx): fix some error 2 years ago
冰雪殇璃陌梦 0bfaeed7fa
feat: add libvpx 2 years ago
  1. 61
      packages/s/svt-av1/patches/1.6.0/pthread.patch
  2. 60
      packages/s/svt-av1/xmake.lua
  3. 22
      packages/w/which/xmake.lua

@ -0,0 +1,61 @@
diff --git a/Source/Lib/Common/Codec/EbThreads.c b/Source/Lib/Common/Codec/EbThreads.c
index ea403ae..4f99818 100644
--- a/Source/Lib/Common/Codec/EbThreads.c
+++ b/Source/Lib/Common/Codec/EbThreads.c
@@ -121,11 +121,13 @@ EbHandle svt_create_thread(void *thread_function(void *), void *thread_context)
* the thread priority will __always__ fail the thread sanitizer.
* https://github.com/google/sanitizers/issues/1088
*/
+#if 0
if (!EB_THREAD_SANITIZER_ENABLED && !geteuid()) {
if (pthread_setschedparam(*th, SCHED_FIFO, &(struct sched_param){.sched_priority = 99}))
SVT_WARN("Failed to set thread priority\n");
// ignore if this failed
}
+#endif
thread_handle = th;
#endif // _WIN32
diff --git a/Source/Lib/Common/Codec/EbThreads.h b/Source/Lib/Common/Codec/EbThreads.h
index 8506c7f..6ed7125 100644
--- a/Source/Lib/Common/Codec/EbThreads.h
+++ b/Source/Lib/Common/Codec/EbThreads.h
@@ -83,7 +83,6 @@ extern EbErrorType svt_destroy_mutex(EbHandle mutex_handle);
do { \
pointer = svt_create_thread(thread_function, thread_context); \
EB_ADD_MEM(pointer, 1, EB_THREAD); \
- pthread_setaffinity_np(*((pthread_t *)pointer), sizeof(cpu_set_t), &svt_aom_group_affinity); \
} while (0)
#else
#define EB_CREATE_THREAD(pointer, thread_function, thread_context) \
diff --git a/Source/Lib/Decoder/Codec/EbDecHandle.c b/Source/Lib/Decoder/Codec/EbDecHandle.c
index 952d889..4c1b954 100644
--- a/Source/Lib/Decoder/Codec/EbDecHandle.c
+++ b/Source/Lib/Decoder/Codec/EbDecHandle.c
@@ -76,10 +76,6 @@ EbErrorType svt_aom_decode_multiple_obu(EbDecHandle *dec_handle_ptr, uint8_t **d
uint32_t is_annexb);
static void dec_switch_to_real_time() {
-#if !defined(_WIN32)
- if (!geteuid())
- (void)pthread_setschedparam(pthread_self(), SCHED_FIFO, &(struct sched_param){.sched_priority = 99});
-#endif
}
/***********************************
diff --git a/Source/Lib/Encoder/Globals/EbEncHandle.c b/Source/Lib/Encoder/Globals/EbEncHandle.c
index be068d9..1ddc2a6 100644
--- a/Source/Lib/Encoder/Globals/EbEncHandle.c
+++ b/Source/Lib/Encoder/Globals/EbEncHandle.c
@@ -312,11 +312,6 @@ void svt_aom_init_intra_predictors_internal(void);
void svt_av1_init_me_luts(void);
static void enc_switch_to_real_time(){
-#if !defined(_WIN32)
- if (!geteuid())
- (void)pthread_setschedparam(
- pthread_self(), SCHED_FIFO, &(struct sched_param){.sched_priority = 99});
-#endif
}
#define SINGLE_CORE_COUNT 1
#define CONS_CORE_COUNT 16

@ -0,0 +1,60 @@
package("svt-av1")
set_homepage("https://gitlab.com/AOMediaCodec/SVT-AV1")
set_description("Scalable Video Technology for AV1 (SVT-AV1 Encoder and Decoder)")
add_urls("https://gitlab.com/AOMediaCodec/SVT-AV1.git",
"https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v$(version)/SVT-AV1-v$(version).tar.gz")
add_versions("1.4.0", "0a4650b822c4eeb9656fbe96bd795e7a73cbfd1ab8c12546348ba88d8ed6b415")
add_versions("1.4.1", "e3f7fc194afc6c90b43e0b80fa24c09940cb03bea394e0e1f5d1ded18e9ab23f")
add_versions("1.5.0", "64e27b024eb43e4ba4e7b85584e0497df534043b2ce494659532c585819d0333")
add_versions("1.6.0", "3bc207247568ac713245063555082bfc905edc31df3bf6355e3b194cb73ad817")
if is_plat("wasm", "android") then
add_patches("1.6.0", path.join(os.scriptdir(), "patches", "1.6.0", "pthread.patch"), "1875f99a581e00d9233b14ca66443289a805dadd55b4c81a4d253e6770516216")
end
if is_plat("wasm") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end
if is_plat("linux", "wasm", "bsd") then
add_syslinks("pthread")
end
add_deps("cmake")
on_load(function (package)
if package:is_targetarch("x64", "x86", "x86_64") then
if is_host("windows") or package:is_plat("bsd") then
package:add("deps", "nasm")
else
package:add("deps", "yasm")
end
end
end)
on_install(function (package)
local configs = {"-DBUILD_TESTING=OFF", "-DCOVERAGE=OFF", "-DBUILD_APPS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DLIB_INSTALL_DIR=" .. package:installdir("lib"))
if package:is_plat("wasm") then
io.replace("CMakeLists.txt", "if(MINGW)", "if(TRUE)\n check_both_flags_add(-pthread)\n elseif(MINGW)", {plain = true})
io.replace("CMakeLists.txt", "set(CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS} -z noexecstack -z relro -z now\")", "", {plain = true})
io.replace("Source/Lib/Decoder/CMakeLists.txt", "list(APPEND PLATFORM_LIBS Threads::Threads)", "", {plain = true})
io.replace("Source/Lib/Encoder/CMakeLists.txt", "list(APPEND PLATFORM_LIBS Threads::Threads)", "", {plain = true})
elseif package:is_plat("mingw") and package:is_arch("x64", "x86_64") then
table.insert(configs, "-DCMAKE_SYSTEM_PROCESSOR=AMD64")
elseif package:is_plat("android") then
io.replace("CMakeLists.txt", "CMAKE_C_COMPILER_ID MATCHES \"Clang\" AND UNIX AND NOT APPLE", "FALSE", {plain = true})
io.replace("Source/Lib/Decoder/CMakeLists.txt", "list(APPEND PLATFORM_LIBS Threads::Threads)", "", {plain = true})
io.replace("Source/Lib/Decoder/CMakeLists.txt", "set(LIBS_PRIVATE \"-lpthread -lm\")", "set(LIBS_PRIVATE \"-lm\")", {plain = true})
io.replace("Source/Lib/Encoder/CMakeLists.txt", "list(APPEND PLATFORM_LIBS Threads::Threads)", "", {plain = true})
io.replace("Source/Lib/Encoder/CMakeLists.txt", "set(LIBS_PRIVATE \"-lpthread -lm\")", "set(LIBS_PRIVATE \"-lm\")", {plain = true})
end
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("svt_av1_enc_init_handle", {includes = "svt-av1/EbSvtAv1Enc.h"}))
end)

@ -0,0 +1,22 @@
package("which")
set_kind("binary")
set_homepage("https://www.gnu.org/software/which/")
set_description("shows the full path of (shell) commands")
add_urls("https://ftp.gnu.org/gnu/which/which-$(version).tar.gz",
"https://carlowood.github.io/which/which-$(version).tar.gz",
"https://mirrors.ustc.edu.cn/gnu/which/which-$(version).tar.gz")
add_versions("2.16", "0ac8502e9985a3ac6b0e2aa4f2a60f91cad0dc0cca6dc9c1c142ebba4b8dd664")
add_versions("2.17", "176fe9c451487eda787dd58d9469d48c95509f49dbb34a574004a936905dd6da")
add_versions("2.19", "7d79b874f65118ac846a0deb31a8fbd6816cd81e74930299c82103765d45cd52")
add_versions("2.20", "d417b65c650d88ad26a208293c1c6e3eb60d4b6d847f01ff8f66aca63e2857f8")
add_versions("2.21", "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad")
on_install("@bsd", "@linux", "@macosx", function (package)
import("package.tools.autoconf").install(package)
end)
on_test(function (package)
os.vrun("which -v")
end)
Loading…
Cancel
Save