Commit b83976bc authored by Thomas Guillem's avatar Thomas Guillem

contrib: update soxr to 0.1.3

(cherry picked from commit ba8d4446)
(cherry picked from commit bcf9c70d)
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent f995d520
From f968a37cf7667ae3b11aa3150f7747e29ad00acc Mon Sep 17 00:00:00 2001
From: Thomas Guillem <thomas@gllm.fr>
Date: Fri, 30 Oct 2015 14:26:17 +0100
Subject: [PATCH 1/2] FindSIMD: add arm neon detection
---
cmake/Modules/FindSIMD.cmake | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/cmake/Modules/FindSIMD.cmake b/cmake/Modules/FindSIMD.cmake
index 6ac51cb..a23cbcc 100644
--- a/cmake/Modules/FindSIMD.cmake
+++ b/cmake/Modules/FindSIMD.cmake
@@ -53,10 +53,13 @@ set (SIMD_C_FLAG_CANDIDATES
"-msse -mfpmath=sse ${GCC_WIN32_SIMD_OPTS}"
# Gcc x86 (old versions)
"-msse -mfpmath=sse"
+ # Gcc arm neon
+ "-mfloat-abi=softfp -mfpu=neon -DTEST_ARM"
)
set (SIMD_C_TEST_SOURCE
"
+#ifndef TEST_ARM
#include <xmmintrin.h>
int main()
{
@@ -68,6 +71,13 @@ int main()
_mm_storeu_ps (vals,b);
return 0;
}
+#else
+int main()
+{
+ __asm__ volatile(\"vadd.i16 q0, q0, q0\");
+ return 0;
+}
+#endif
")
if (DEFINED SIMD_C_FLAGS)
--
2.1.4
From c42df14b14f828e86066a58b0c812a5662366436 Mon Sep 17 00:00:00 2001
From: Thomas Guillem <thomas@gllm.fr>
Date: Fri, 30 Oct 2015 14:27:29 +0100
Subject: [PATCH 2/2] cpu_has_simd: detect neon via av_get_cpu_flags
---
src/soxr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/soxr.c b/src/soxr.c
index dc61ad9..c1a29ec 100644
--- a/src/soxr.c
+++ b/src/soxr.c
@@ -10,6 +10,9 @@
#include "data-io.h"
#include "internal.h"
+#if HAVE_SIMD && HAVE_AVFFT
+#include <libavutil/cpu.h>
+#endif
char const * soxr_version(void)
@@ -190,6 +193,8 @@ static bool cpu_has_simd(void)
mov d, edx
}
return !!(d & 0x06000000);
+#elif HAVE_AVFFT && defined __arm__
+ return av_get_cpu_flags() & AV_CPU_FLAG_NEON;
#endif
return false;
}
--
2.1.4
From 0a07b23a280b3a80dc933edc0db3aafd2bb5626f Mon Sep 17 00:00:00 2001
From: Thomas Guillem <thomas@gllm.fr>
Date: Thu, 5 Nov 2015 14:16:51 +0100
Subject: [PATCH 3/3] config: use stdint.h and stdbool.h
---
soxr-config.h.in | 31 ++-----------------------------
1 file changed, 2 insertions(+), 29 deletions(-)
diff --git a/soxr-config.h.in b/soxr-config.h.in
index 227bcfd..539efe0 100644
--- a/soxr-config.h.in
+++ b/soxr-config.h.in
@@ -13,34 +13,7 @@
#define WORDS_BIGENDIAN @WORDS_BIGENDIAN@
#include <limits.h>
-
-#undef bool
-#undef false
-#undef true
-#define bool int
-#define false 0
-#define true 1
-
-#undef int16_t
-#undef int32_t
-#undef int64_t
-#undef uint32_t
-#undef uint64_t
-#define int16_t short
-#if LONG_MAX > 2147483647L
- #define int32_t int
- #define int64_t long
-#elif LONG_MAX < 2147483647L
-#error this library requires that 'long int' has at least 32-bits
-#else
- #define int32_t long
- #if defined _MSC_VER
- #define int64_t __int64
- #else
- #define int64_t long long
- #endif
-#endif
-#define uint32_t unsigned int32_t
-#define uint64_t unsigned int64_t
+#include <stdint.h>
+#include <stdbool.h>
#endif
--
2.1.4
ee902c1bc713e05b748f917d78222b68b5fe01d43f405e0954c21ce4d1ee494d01000caa79f696cb8d202c662a4c4d958b332dae034d6f929e0480abf27cd07c soxr-0.1.2-Source.tar.xz
f4883ed298d5650399283238aac3dbe78d605b988246bea51fa343d4a8ce5ce97c6e143f6c3f50a3ff81795d9c19e7a07217c586d4020f6ced102aceac46aaa8 soxr-0.1.3-Source.tar.xz
# SoXR
SOXR_VERSION := 0.1.2
SOXR_VERSION := 0.1.3
SOXR_URL := http://vorboss.dl.sourceforge.net/project/soxr/soxr-$(SOXR_VERSION)-Source.tar.xz
ifeq ($(call need_pkg,"soxr >= 0.1"),)
......@@ -15,12 +15,10 @@ $(TARBALLS)/soxr-$(SOXR_VERSION)-Source.tar.xz:
soxr: soxr-$(SOXR_VERSION)-Source.tar.xz .sum-soxr
$(UNPACK)
$(APPLY) $(SRC)/soxr/0001-FindSIMD-add-arm-neon-detection.patch
$(APPLY) $(SRC)/soxr/0002-cpu_has_simd-detect-neon-via-av_get_cpu_flags.patch
$(APPLY) $(SRC)/soxr/0003-config-use-stdint.h-and-stdbool.h.patch
$(MOVE)
.soxr: soxr toolchain.cmake
rm -f $</CMakeCache.txt
cd $< && $(HOSTVARS_PIC) $(CMAKE) \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_EXAMPLES=OFF \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment