neon: rename ARMV7NEON_ASM to ARM_NEON_INTRINSICS because arm64 can use it too

parent fc1dd43c
......@@ -41,7 +41,7 @@ option(ENABLE_FLOAT_API "Enable the floating-point API" ON)
option(ENABLE_VBR "Enable VBR and VAD from the codec" ON)
option(ENABLE_ARM4_ASM "Make use of ARM4 assembly optimizations" OFF)
option(ENABLE_ARM5E_ASM "Make use of ARM5E assembly optimizations" OFF)
option(ENABLE_ARMV7_NEON_ASM "Make use of ARMV7a NEON assembly optimizations" OFF)
option(ENABLE_ARM_NEON_INTRINSICS "Make use of NEON intrinsics optimizations" OFF)
option(ENABLE_BLACKFIN_ASM "Make use of Blackfin assembly optimizations" OFF)
option(ENABLE_FIXED_POINT_DEBUG "Debug fixed-point implementation" OFF)
option(ENABLE_TI_C55X "Enable support for TI C55X DSP" OFF)
......@@ -122,8 +122,8 @@ else()
endif()
set(ARM4_ASM ${ENABLE_ARM4_ASM})
set(ARM5E_ASM ${ENABLE_ARM5E_ASM})
set(ARMV7NEON_ASM ${ENABLE_ARMV7_NEON_ASM})
if(ARMV7NEON_ASM)
set(ARM_NEON_INTRINSICS ${ENABLE_ARM_NEON_INTRINSICS})
if(ARM_NEON_INTRINSICS)
add_definitions(-marm -DSHORTCUTS)
endif()
set(BFIN_ASM ${ENABLE_BLACKFIN_ASM})
......
......@@ -120,10 +120,10 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM'">
<ClCompile>
<PreprocessorDefinitions>FIXED_POINT;__ARM_NEON__;ARMV7NEON_ASM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>FIXED_POINT;__ARM_NEON__;ARM_NEON_INTRINSICS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -90,7 +90,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM'">
<ClCompile>
<PreprocessorDefinitions>FIXED_POINT;__ARM_NEON__;ARMV7NEON_ASM;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>FIXED_POINT;__ARM_NEON__;ARM_NEON_INTRINSICS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
......@@ -145,4 +145,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
</Project>
\ No newline at end of file
</Project>
......@@ -7,7 +7,7 @@
#cmakedefine ENABLE_VALGRIND
#cmakedefine ARM4_ASM
#cmakedefine ARM5E_ASM
#cmakedefine ARMV7NEON_ASM
#cmakedefine ARM_NEON_INTRINSICS
#cmakedefine BFIN_ASM
#cmakedefine TI_C55X
#cmakedefine DISABLE_FLOAT_API
......
......@@ -87,7 +87,7 @@ has_sse=yes
has_sse=no
]
)
AC_MSG_RESULT($has_sse)
AC_MSG_RESULT($has_sse)
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
......@@ -185,9 +185,15 @@ AC_ARG_ENABLE(arm5e-asm, [ --enable-arm5e-asm Make use of ARM5E assembly o
AC_DEFINE([ARM5E_ASM], , [Make use of ARM5E assembly optimizations])
fi])
AC_ARG_ENABLE(armv7neon-asm, [ --enable-armv7neon-asm Make use of ARMV7a NEON assembly optimizations],
# this was the old name for armneon-intrinsics option but we are keeping the old name for backward compatibility
AC_ARG_ENABLE(armv7neon-asm, [ --enable-armv7neon-asm Make use of NEON intrinsics optimizations],
[if test "$enableval" = yes; then
AC_DEFINE([ARMV7NEON_ASM], , [Make use of ARM5E assembly optimizations])
AC_DEFINE([ARM_NEON_INTRINSICS], , [Make use of NEON intrinsics optimizations])
CFLAGS="$CFLAGS -marm -DSHORTCUTS"
fi])
AC_ARG_ENABLE(arm-neon-intrinsics, [ --enable-arm-neon-intrinsics Make use of NEON intrinsics optimizations],
[if test "$enableval" = yes; then
AC_DEFINE([ARM_NEON_INTRINSICS], , [Make use of NEON intrinsics optimizations])
CFLAGS="$CFLAGS -marm -DSHORTCUTS"
fi])
......@@ -293,7 +299,7 @@ AC_DEFINE([_BUILD_SPEEX], [], [Defined only when Speex itself is build built])
AC_OUTPUT([Makefile libspeex/Makefile src/Makefile doc/Makefile Speex.spec
include/Makefile include/speex/Makefile speex.pc speexdsp.pc
win32/Makefile win32/libspeex/Makefile win32/speexenc/Makefile
win32/speexdec/Makefile symbian/Makefile
win32/speexdec/Makefile symbian/Makefile
win32/VS2003/Makefile
win32/VS2003/tests/Makefile
win32/VS2003/libspeex/Makefile
......@@ -312,11 +318,11 @@ AC_OUTPUT([Makefile libspeex/Makefile src/Makefile doc/Makefile Speex.spec
win32/VS2008/tests/Makefile
win32/VS2008/libspeex/Makefile
win32/VS2008/speexenc/Makefile
include/speex/speex_config_types.h ti/Makefile
include/speex/speex_config_types.h ti/Makefile
ti/speex_C54_test/Makefile ti/speex_C55_test/Makefile
ti/speex_C64_test/Makefile ])
if test "x$src" = "x"; then
if test "x$src" = "x"; then
echo "**IMPORTANT**"
echo "You don't seem to have the development package for libogg (libogg-devel) installed. Only the Speex library (libspeex) will be built (no encoder/decoder executable)"
echo "You can download libogg from http://downloads.xiph.org/releases/ogg/"
......
......@@ -7,18 +7,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -53,7 +53,7 @@
#error SSE is only for floating-point
#endif
#if defined(ARMV7NEON_ASM) && !defined(ARM5E_ASM) && !defined(__arm64__) && !defined(_M_ARM)
#if defined(ARM_NEON_INTRINSICS) && !defined(ARM5E_ASM) && !defined(__arm64__) && !defined(_M_ARM)
#define ARM5E_ASM 1
#endif
......@@ -69,11 +69,11 @@
#ifndef FLOATING_POINT
#error You now need to define either FIXED_POINT or FLOATING_POINT
#endif
#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
#if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
#error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
#endif
#ifdef ARMV7NEON_ASM
#error Neon cannot be used in floating point mode.
#ifdef ARM_NEON_INTRINSICS
#error Neon cannot be used in floating point mode.
#endif
#ifdef FIXED_POINT_DEBUG
#error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?"
......@@ -129,7 +129,7 @@ typedef spx_word32_t spx_sig_t;
#include "fixed_generic.h"
#ifdef ARMV7NEON_ASM
#ifdef ARM_NEON_INTRINSICS
#include "fixed_neon.h"
#endif
......@@ -229,11 +229,11 @@ typedef float spx_word32_t;
#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
/* 2 on TI C5x DSP */
#define BYTES_PER_CHAR 2
#define BYTES_PER_CHAR 2
#define BITS_PER_CHAR 16
#define LOG2_BITS_PER_CHAR 4
#else
#else
#define BYTES_PER_CHAR 1
#define BITS_PER_CHAR 8
......
/* Copyright (C) 2002-2006 Jean-Marc Valin
/* Copyright (C) 2002-2006 Jean-Marc Valin
File: ltp.c
Long-Term Prediction functions
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -50,7 +50,7 @@
#ifdef _USE_SSE
#include "ltp_sse.h"
#elif defined(ARMV7NEON_ASM)
#elif defined(ARM_NEON_INTRINSICS)
#include "resample_neon.h"
#elif defined (ARM4_ASM) || defined(ARM5E_ASM)
// buggy ! #include "ltp_arm4.h"
......@@ -132,7 +132,7 @@ static void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word
part4 = MAC16_16(part4,*x,y2);
x++;
y3=*y++;
sum1 = ADD32(sum1,SHR32(part1,6));
sum2 = ADD32(sum2,SHR32(part2,6));
sum3 = ADD32(sum3,SHR32(part3,6));
......@@ -185,7 +185,7 @@ void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *p
spx_word32_t e0;
VARDECL(spx_word32_t *corr);
#ifdef FIXED_POINT
/* In fixed-point, we need only one (temporary) array of 32-bit values and two (corr16, ener16)
/* In fixed-point, we need only one (temporary) array of 32-bit values and two (corr16, ener16)
arrays for (normalized) 16-bit values */
VARDECL(spx_word16_t *corr16);
VARDECL(spx_word16_t *ener16);
......@@ -206,7 +206,7 @@ void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *p
corr16 = corr;
ener16 = energy;
#endif
ALLOC(best_score, N, spx_word32_t);
ALLOC(best_ener, N, spx_word32_t);
for (i=0;i<N;i++)
......@@ -215,7 +215,7 @@ void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *p
best_ener[i]=0;
pitch[i]=start;
}
#ifdef FIXED_POINT
for (i=-end;i<len;i++)
{
......@@ -232,7 +232,7 @@ void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *p
{
sw[i]=SHR16(sw[i],1);
}
}
}
#endif
energy[0]=inner_prod(sw-start, sw-start, len);
e0=inner_prod(sw, sw, len);
......@@ -249,14 +249,14 @@ if (ref != energy[0]) {
if (energy[i-start+1] < 0)
energy[i-start+1] = 0;
}
#ifdef FIXED_POINT
eshift = normalize16(energy, ener16, 32766, end-start+1);
#endif
/* In fixed-point, this actually overrites the energy array (aliased to corr) */
pitch_xcorr(sw, sw-end, corr, len, end-start+1, stack);
#ifdef FIXED_POINT
/* Normalize to 180 so we can square it and it still fits in 16 bits */
cshift = normalize16(corr, corr16, 180, end-start+1);
......@@ -267,7 +267,7 @@ if (ref != energy[0]) {
{
sw[i]=SHL16(sw[i],1);
}
}
}
#endif
/* Search for the best pitch prediction gain */
......@@ -300,7 +300,7 @@ if (ref != energy[0]) {
}
}
}
/* Compute open-loop gain if necessary */
if (gain)
{
......@@ -338,15 +338,15 @@ static int pitch_gain_search_3tap_vq(
int i;
for (i=0;i<gain_cdbk_size;i++) {
ptr = gain_cdbk+4*i;
g[0]=ADD16((spx_word16_t)ptr[0],32);
g[1]=ADD16((spx_word16_t)ptr[1],32);
g[2]=ADD16((spx_word16_t)ptr[2],32);
gain_sum = (spx_word16_t)ptr[3];
sum = compute_pitch_error(C16, g, pitch_control);
if (sum>best_sum && gain_sum<=max_gain) {
best_sum=sum;
best_cdbk=i;
......@@ -396,11 +396,11 @@ int scaledown
if (cumul_gain > 262144)
max_gain = 31;
x[0]=tmp1;
x[1]=tmp1+nsf;
x[2]=tmp1+2*nsf;
for (j=0;j<nsf;j++)
new_target[j] = target[j];
......@@ -465,17 +465,17 @@ int scaledown
spx_word16_t C16[9];
#else
spx_word16_t *C16=C;
#endif
#endif
C[0]=corr[2];
C[1]=corr[1];
C[2]=corr[0];
C[3]=A[1][2];
C[4]=A[0][1];
C[5]=A[0][2];
C[5]=A[0][2];
C[6]=A[2][2];
C[7]=A[1][1];
C[8]=A[0][0];
/*plc_tuning *= 2;*/
if (plc_tuning<2)
plc_tuning=2;
......@@ -577,13 +577,13 @@ spx_word32_t *cumul_gain
const signed char *gain_cdbk;
int gain_cdbk_size;
int scaledown=0;
VARDECL(int *nbest);
params = (const ltp_params*) par;
gain_cdbk_size = 1<<params->gain_bits;
gain_cdbk = params->gain_cdbk + 4*gain_cdbk_size*cdbk_offset;
N=complexity;
if (N>10)
N=10;
......@@ -600,7 +600,7 @@ spx_word32_t *cumul_gain
SPEEX_MEMSET(exc, 0, nsf);
return start;
}
#ifdef FIXED_POINT
/* Check if we need to scale everything down in the pitch search to avoid overflows */
for (i=0;i<nsf;i++)
......@@ -626,11 +626,11 @@ spx_word32_t *cumul_gain
open_loop_nbest_pitch(sw, start, end, nsf, nbest, NULL, N, stack);
else
nbest[0] = start;
ALLOC(best_exc, nsf, spx_sig_t);
ALLOC(new_target, nsf, spx_word16_t);
ALLOC(best_target, nsf, spx_word16_t);
for (i=0;i<N;i++)
{
pitch=nbest[i];
......
This diff is collapsed.
......@@ -6,18 +6,18 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
......@@ -41,7 +41,7 @@
#include "os_support.h"
#ifdef ARMV7NEON_ASM
#ifdef ARM_NEON_INTRINSICS
EXPORT int libspeex_cpu_features=SPEEX_LIB_CPU_FEATURE_NEON;
#else
EXPORT int libspeex_cpu_features=0;
......
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