Porting ARM optimization from Android to ios.
Tested APM and iSAC in Android. Bit-exact with original versions. Changes include removing or changing some GCC derivatives (e.g. .fnstart, .hword), instruction syntax, etc. Review URL: https://webrtc-codereview.appspot.com/934009 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3124 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -13,9 +13,9 @@
|
||||
@ WebRtcIsacfix_AllpassFilter2FixDec16Neon() in filterbanks.c. Prototype
|
||||
@ C code is at end of this file.
|
||||
|
||||
.arch armv7-a
|
||||
.fpu neon
|
||||
.global WebRtcIsacfix_AllpassFilter2FixDec16Neon
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
|
||||
GLOBAL_FUNCTION WebRtcIsacfix_AllpassFilter2FixDec16Neon
|
||||
.align 2
|
||||
|
||||
@void WebRtcIsacfix_AllpassFilter2FixDec16Neon(
|
||||
@@ -27,7 +27,7 @@
|
||||
@ int32_t *filter_state_ch1, // Filter state for channel 1, in Q16
|
||||
@ int32_t *filter_state_ch2); // Filter state for channel 2, in Q16
|
||||
|
||||
WebRtcIsacfix_AllpassFilter2FixDec16Neon:
|
||||
DEFINE_FUNCTION WebRtcIsacfix_AllpassFilter2FixDec16Neon
|
||||
push {r4 - r7}
|
||||
|
||||
ldr r5, [sp, #24] @ filter_state_ch2
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
@
|
||||
@ Reference code in filters.c. Output is bit-exact.
|
||||
|
||||
#include "settings.h"
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
|
||||
.global WebRtcIsacfix_AutocorrNeon
|
||||
GLOBAL_FUNCTION WebRtcIsacfix_AutocorrNeon
|
||||
.align 2
|
||||
|
||||
@ int WebRtcIsacfix_AutocorrNeon(
|
||||
@@ -21,7 +21,7 @@
|
||||
@ WebRtc_Word16 order,
|
||||
@ WebRtc_Word16* __restrict scale);
|
||||
|
||||
WebRtcIsacfix_AutocorrNeon:
|
||||
DEFINE_FUNCTION WebRtcIsacfix_AutocorrNeon
|
||||
push {r3 - r12}
|
||||
|
||||
@ Constant initializations
|
||||
|
||||
@@ -97,8 +97,8 @@
|
||||
'<(webrtc_root)/common_audio/common_audio.gyp:signal_processing',
|
||||
],
|
||||
'sources': [
|
||||
'filters_neon.S',
|
||||
'filterbanks_neon.S',
|
||||
'filters_neon.S',
|
||||
'lattice_neon.S',
|
||||
'lpc_masking_model_neon.S',
|
||||
],
|
||||
|
||||
@@ -25,16 +25,12 @@
|
||||
@ r12: constant #16384
|
||||
@ r6, r7, r8, r10, r11: scratch
|
||||
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
#include "settings.h"
|
||||
|
||||
.arch armv7-a
|
||||
.global WebRtcIsacfix_FilterArLoop
|
||||
GLOBAL_FUNCTION WebRtcIsacfix_FilterArLoop
|
||||
.align 2
|
||||
|
||||
WebRtcIsacfix_FilterArLoop:
|
||||
.fnstart
|
||||
|
||||
.save {r4-r11}
|
||||
DEFINE_FUNCTION WebRtcIsacfix_FilterArLoop
|
||||
push {r4-r11}
|
||||
|
||||
add r1, #2 @ &ar_f_Q0[1]
|
||||
@@ -77,6 +73,3 @@ ORDER_COEF_LOOP: @ for(k = order_coef - 1 ; k >= 0; k--)
|
||||
|
||||
pop {r4-r11}
|
||||
bx lr
|
||||
|
||||
.fnend
|
||||
|
||||
|
||||
@@ -29,19 +29,12 @@
|
||||
@ instructions, smulwb, and smull. Speech quality was not degraded by
|
||||
@ testing speech and tone vectors.
|
||||
|
||||
.arch armv7-a
|
||||
.fpu neon
|
||||
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
#include "settings.h"
|
||||
|
||||
.global WebRtcIsacfix_FilterMaLoopNeon
|
||||
|
||||
GLOBAL_FUNCTION WebRtcIsacfix_FilterMaLoopNeon
|
||||
.align 2
|
||||
|
||||
WebRtcIsacfix_FilterMaLoopNeon:
|
||||
.fnstart
|
||||
|
||||
.save {r4-r8}
|
||||
DEFINE_FUNCTION WebRtcIsacfix_FilterMaLoopNeon
|
||||
push {r4-r8}
|
||||
|
||||
vdup.32 d28, r0 @ Initialize Neon register with input0
|
||||
@@ -151,5 +144,3 @@ LAST_SAMPLE:
|
||||
END:
|
||||
pop {r4-r8}
|
||||
bx lr
|
||||
|
||||
.fnend
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
@ iSAC codec, optimized for ARM Neon platform. Reference code in
|
||||
@ lpc_masking_model.c.
|
||||
|
||||
.arch armv7-a
|
||||
.fpu neon
|
||||
.global WebRtcIsacfix_CalculateResidualEnergyNeon
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
|
||||
GLOBAL_FUNCTION WebRtcIsacfix_CalculateResidualEnergyNeon
|
||||
.align 2
|
||||
|
||||
@ int32_t WebRtcIsacfix_CalculateResidualEnergyNeon(int lpc_order,
|
||||
@@ -23,10 +23,7 @@
|
||||
@ int16_t* a_polynomial,
|
||||
@ int32_t* corr_coeffs,
|
||||
@ int* q_val_residual_energy);
|
||||
|
||||
WebRtcIsacfix_CalculateResidualEnergyNeon:
|
||||
.fnstart
|
||||
.save {r4-r11}
|
||||
DEFINE_FUNCTION WebRtcIsacfix_CalculateResidualEnergyNeon
|
||||
push {r4-r11}
|
||||
|
||||
sub r13, r13, #16
|
||||
@@ -173,5 +170,4 @@ GET_SHIFT_NORM:
|
||||
pop {r4-r11}
|
||||
bx r14
|
||||
|
||||
.fnend
|
||||
|
||||
|
||||
@@ -13,12 +13,11 @@
|
||||
@
|
||||
@ Output is bit-exact with the reference C code in pitch_filter.c.
|
||||
|
||||
#include "webrtc/system_wrappers/interface/asm_defines.h"
|
||||
#include "settings.h"
|
||||
|
||||
.arch armv6
|
||||
GLOBAL_FUNCTION WebRtcIsacfix_PitchFilterCore
|
||||
.align 2
|
||||
.global WebRtcIsacfix_PitchFilterCore
|
||||
|
||||
|
||||
@ void WebRtcIsacfix_PitchFilterCore(int loopNumber,
|
||||
@ WebRtc_Word16 gain,
|
||||
@@ -30,9 +29,7 @@
|
||||
@ WebRtc_Word16* inputBuf,
|
||||
@ WebRtc_Word16* outputBuf,
|
||||
@ int* index2) {
|
||||
|
||||
WebRtcIsacfix_PitchFilterCore:
|
||||
.fnstart
|
||||
DEFINE_FUNCTION WebRtcIsacfix_PitchFilterCore
|
||||
push {r4-r11}
|
||||
sub sp, #8
|
||||
|
||||
@@ -140,7 +137,6 @@ LOOP:
|
||||
add sp, #8
|
||||
pop {r4-r11}
|
||||
bx lr
|
||||
.fnend
|
||||
|
||||
.align 2
|
||||
kDampFilter:
|
||||
|
||||
Reference in New Issue
Block a user