Added run time detection of Neon architecture in iSAC-fix.
Review URL: https://webrtc-codereview.appspot.com/715004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2563 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -64,6 +64,8 @@ LOCAL_C_INCLUDES := \
|
|||||||
$(LOCAL_PATH)/../../../../../.. \
|
$(LOCAL_PATH)/../../../../../.. \
|
||||||
$(LOCAL_PATH)/../../../../../../common_audio/signal_processing/include
|
$(LOCAL_PATH)/../../../../../../common_audio/signal_processing/include
|
||||||
|
|
||||||
|
LOCAL_STATIC_LIBRARIES += libwebrtc_system_wrappers
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libcutils \
|
libcutils \
|
||||||
libdl \
|
libdl \
|
||||||
@@ -127,7 +129,8 @@ LOCAL_C_INCLUDES := \
|
|||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES := \
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
libwebrtc_isacfix \
|
libwebrtc_isacfix \
|
||||||
libwebrtc_spl
|
libwebrtc_spl \
|
||||||
|
libwebrtc_system_wrappers
|
||||||
|
|
||||||
ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
|
ifeq ($(WEBRTC_BUILD_NEON_LIBS),true)
|
||||||
LOCAL_STATIC_LIBRARIES += \
|
LOCAL_STATIC_LIBRARIES += \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
* that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@@ -144,7 +144,7 @@ void WebRtcIsacfix_FilterMaLoopC(int16_t input0,
|
|||||||
int32_t* ptr2);
|
int32_t* ptr2);
|
||||||
|
|
||||||
// Functions for ARM-Neon platforms, in place of the above two generic C ones.
|
// Functions for ARM-Neon platforms, in place of the above two generic C ones.
|
||||||
#if (defined(WEBRTC_ANDROID) && defined(WEBRTC_ARCH_ARM_NEON))
|
#if (defined WEBRTC_DETECT_ARM_NEON) || (defined WEBRTC_ARCH_ARM_NEON)
|
||||||
int WebRtcIsacfix_AutocorrNeon(WebRtc_Word32* __restrict r,
|
int WebRtcIsacfix_AutocorrNeon(WebRtc_Word32* __restrict r,
|
||||||
const WebRtc_Word16* __restrict x,
|
const WebRtc_Word16* __restrict x,
|
||||||
WebRtc_Word16 N,
|
WebRtc_Word16 N,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
* that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@@ -15,12 +15,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "isacfix.h"
|
#include "isacfix.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "bandwidth_estimator.h"
|
#include "bandwidth_estimator.h"
|
||||||
#include "codec.h"
|
#include "codec.h"
|
||||||
|
#include "system_wrappers/interface/cpu_features_wrapper.h"
|
||||||
#include "entropy_coding.h"
|
#include "entropy_coding.h"
|
||||||
#include "structs.h"
|
#include "structs.h"
|
||||||
|
|
||||||
@@ -168,6 +169,19 @@ WebRtc_Word16 WebRtcIsacfix_FreeInternal(ISACFIX_MainStruct *ISAC_main_inst)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* WebRtcAecm_InitNeon(...)
|
||||||
|
*
|
||||||
|
* This function initializes function pointers for ARM Neon platform.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if (defined WEBRTC_DETECT_ARM_NEON || defined WEBRTC_ARCH_ARM_NEON)
|
||||||
|
static void WebRtcIsacfix_InitNeon(void) {
|
||||||
|
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrNeon;
|
||||||
|
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopNeon;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* WebRtcIsacfix_EncoderInit(...)
|
* WebRtcIsacfix_EncoderInit(...)
|
||||||
*
|
*
|
||||||
@@ -250,9 +264,12 @@ WebRtc_Word16 WebRtcIsacfix_EncoderInit(ISACFIX_MainStruct *ISAC_main_inst,
|
|||||||
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrC;
|
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrC;
|
||||||
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopC;
|
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopC;
|
||||||
|
|
||||||
#ifdef WEBRTC_ARCH_ARM_NEON
|
#ifdef WEBRTC_DETECT_ARM_NEON
|
||||||
WebRtcIsacfix_AutocorrFix = WebRtcIsacfix_AutocorrNeon;
|
if ((WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) != 0) {
|
||||||
WebRtcIsacfix_FilterMaLoopFix = WebRtcIsacfix_FilterMaLoopNeon;
|
WebRtcIsacfix_InitNeon();
|
||||||
|
}
|
||||||
|
#elif defined(WEBRTC_ARCH_ARM_NEON)
|
||||||
|
WebRtcIsacfix_InitNeon();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return statusInit;
|
return statusInit;
|
||||||
|
|||||||
Reference in New Issue
Block a user