[vlc-commits] contribs: add soxr

Thomas Guillem git at videolan.org
Fri Oct 30 17:18:03 CET 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct 27 18:48:20 2015 +0100| [c6e78fd6212106a9a3568d4fc8d934aff28fa56f] | committer: Thomas Guillem

contribs: add soxr

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c6e78fd6212106a9a3568d4fc8d934aff28fa56f
---

 .../0001-FindSIMD-add-arm-neon-detection.patch     |   44 ++++++++++++++++++++
 ...has_simd-detect-neon-via-av_get_cpu_flags.patch |   35 ++++++++++++++++
 contrib/src/soxr/SHA512SUMS                        |    1 +
 contrib/src/soxr/rules.mak                         |   34 +++++++++++++++
 4 files changed, 114 insertions(+)

diff --git a/contrib/src/soxr/0001-FindSIMD-add-arm-neon-detection.patch b/contrib/src/soxr/0001-FindSIMD-add-arm-neon-detection.patch
new file mode 100644
index 0000000..13015fc
--- /dev/null
+++ b/contrib/src/soxr/0001-FindSIMD-add-arm-neon-detection.patch
@@ -0,0 +1,44 @@
+From f968a37cf7667ae3b11aa3150f7747e29ad00acc Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <thomas at 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
+
diff --git a/contrib/src/soxr/0002-cpu_has_simd-detect-neon-via-av_get_cpu_flags.patch b/contrib/src/soxr/0002-cpu_has_simd-detect-neon-via-av_get_cpu_flags.patch
new file mode 100644
index 0000000..c9d176f
--- /dev/null
+++ b/contrib/src/soxr/0002-cpu_has_simd-detect-neon-via-av_get_cpu_flags.patch
@@ -0,0 +1,35 @@
+From c42df14b14f828e86066a58b0c812a5662366436 Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <thomas at 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
+
diff --git a/contrib/src/soxr/SHA512SUMS b/contrib/src/soxr/SHA512SUMS
new file mode 100644
index 0000000..4fbedf2
--- /dev/null
+++ b/contrib/src/soxr/SHA512SUMS
@@ -0,0 +1 @@
+ee902c1bc713e05b748f917d78222b68b5fe01d43f405e0954c21ce4d1ee494d01000caa79f696cb8d202c662a4c4d958b332dae034d6f929e0480abf27cd07c  soxr-0.1.2-Source.tar.xz
diff --git a/contrib/src/soxr/rules.mak b/contrib/src/soxr/rules.mak
new file mode 100644
index 0000000..d137a32
--- /dev/null
+++ b/contrib/src/soxr/rules.mak
@@ -0,0 +1,34 @@
+# SoXR
+
+SOXR_VERSION := 0.1.2
+SOXR_URL := http://vorboss.dl.sourceforge.net/project/soxr/soxr-$(SOXR_VERSION)-Source.tar.xz
+
+PKGS += soxr
+ifeq ($(call need_pkg,"soxr >= 0.1"),)
+PKGS_FOUND += soxr
+endif
+DEPS_soxr = ffmpeg $(DEPS_ffmpeg)
+
+$(TARBALLS)/soxr-$(SOXR_VERSION)-Source.tar.xz:
+	$(call download,$(SOXR_URL))
+
+.sum-soxr: 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
+	$(MOVE)
+
+.soxr: soxr toolchain.cmake
+	cd $< && $(HOSTVARS_PIC) $(CMAKE) \
+		-DBUILD_SHARED_LIBS=OFF \
+		-DCMAKE_BUILD_TYPE=Release \
+		-DBUILD_EXAMPLES=OFF \
+		-DBUILD_TESTS=OFF \
+		-DWITH_LSR_BINDINGS=OFF \
+		-DWITH_OPENMP=OFF \
+		-DWITH_AVFFT=ON \
+		-Wno-dev
+	cd $< && $(MAKE) install
+	touch $@



More information about the vlc-commits mailing list