shithub: aacenc

Download patch

ref: 66758c3778c468aca198e78c59f928e50e8cea16
parent: 2b7d9a96e128b76776f5365b3a93d6de9d1e8ea5
author: Krzysztof Nikiel <knik@users.sourceforge.net>
date: Sat Oct 21 16:19:52 EDT 2017

fix build for non-intel/no-SSE systems

--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@
 AC_PROG_CXX
 AM_PROG_LIBTOOL
 
-AC_CHECK_HEADERS(getopt.h)
+AC_CHECK_HEADERS(getopt.h immintrin.h)
 
 AC_CHECK_DECL(strcasecmp, MY_DEFINE(HAVE_STRCASECMP))
 
--- a/libfaac/quantize.c
+++ b/libfaac/quantize.c
@@ -18,12 +18,15 @@
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ****************************************************************************/
 
-#include <immintrin.h>
 #include <math.h>
 #include <stdio.h>
 #include "quantize.h"
 #include "huff2.h"
 
+#ifdef HAVE_IMMINTRIN_H
+# include <immintrin.h>
+#endif
+
 #ifdef __SSE2__
 # ifdef __GNUC__
 #  include <cpuid.h>
@@ -31,6 +34,7 @@
 #endif
 
 #ifdef _MSC_VER
+# include <immintrin.h>
 # include <intrin.h>
 # define __SSE2__
 # define bit_SSE2 (1 << 26)
@@ -131,10 +135,10 @@
     int sb, cnt;
     // 1.5dB step
     static const double sfstep = 20.0 / 1.5 / M_LN10;
+    int gsize = coderInfo->groups.len[gnum];
 #ifdef __SSE2__
     int cpuid[4];
     int sse2 = 0;
-    int gsize = coderInfo->groups.len[gnum];
 
     cpuid[3] = 0;
 # ifdef __GNUC__