shithub: aacenc

Download patch

ref: b935b95e0d1d24ebf57b101293e282d9dd44a19c
parent: 7d6fd496b4d142fd415b12c46976005c72414a1c
author: Krzysztof Nikiel <knik@users.sourceforge.net>
date: Thu Oct 5 14:41:57 EDT 2017

use SSE only on i686 hosts

--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,7 @@
 fi
 
 AM_CONDITIONAL(MINGW, test "$host_os" = "mingw32")
+AM_CONDITIONAL(CPU686, test "$host_cpu" = "i686")
 
 AC_C_BIGENDIAN
 
--- a/libfaac/Makefile.am
+++ b/libfaac/Makefile.am
@@ -1,7 +1,10 @@
 common_SOURCES = aacquant.c bitstream.c fft.c frame.c midside.c blockswitch.c util.c channels.c filtbank.c huffman.c tns.c quantize.c
 common_INCLUDES = aacquant.h channels.h filtbank.h hufftab.h blockswitch.h coder.h frame.h midside.h tns.h bitstream.h fft.h huffman.h util.h quantize.h version.h
 common_LIBADD = -lm
-common_CFLAGS = -fvisibility=hidden -msse2
+common_CFLAGS = -fvisibility=hidden
+if CPU686
+common_CFLAGS += -msse2
+endif
 
 if USE_DRM
 lib_LTLIBRARIES = libfaac_drm.la
--- a/libfaac/quantize.c
+++ b/libfaac/quantize.c
@@ -123,7 +123,7 @@
       sfacfix = exp(sfac / sfstep);
       coderInfo->scale_factor[coderInfo->sfcnt++] = sfac;
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && defined(__i686__)
 typedef float v4sf __attribute__ ((vector_size (16)));
 typedef int v4si __attribute__ ((vector_size (16)));
       if (__builtin_cpu_supports("sse2"))