Introduced a SPL inline function (multiple-accumulate), for preformance in ARMv7.
It's used in quite some occations over many modules. Review URL: http://webrtc-codereview.appspot.com/178004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@691 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -1670,6 +1670,19 @@ void WebRtcSpl_SynthesisQMF(const WebRtc_Word16* low_band,
|
||||
// - out16 : the saturated 16-bit word.
|
||||
//
|
||||
|
||||
// int32_t WebRtc_MulAccumW16(...)
|
||||
//
|
||||
// This function multiply a 16-bit word by a 16-bit word, and accumulate this
|
||||
// value to a 32-bit integer.
|
||||
//
|
||||
// Input:
|
||||
// - a : The value of the first 16-bit word.
|
||||
// - b : The value of the second 16-bit word.
|
||||
// - c : The value of an 32-bit integer.
|
||||
//
|
||||
// Return Value: The value of a * b + c.
|
||||
//
|
||||
|
||||
// WebRtc_Word16 WebRtcSpl_get_version(...)
|
||||
//
|
||||
// This function gives the version string of the Signal Processing Library.
|
||||
|
||||
@@ -148,6 +148,12 @@ static __inline int WebRtcSpl_NormW16(WebRtc_Word16 a) {
|
||||
return zeros;
|
||||
}
|
||||
|
||||
static __inline int32_t WebRtc_MulAccumW16(int16_t a,
|
||||
int16_t b,
|
||||
int32_t c) {
|
||||
return (a * b + c);
|
||||
}
|
||||
|
||||
#endif // WEBRTC_ARCH_ARM_V7A
|
||||
|
||||
#endif // WEBRTC_SPL_SPL_INL_H_
|
||||
|
||||
@@ -45,6 +45,14 @@ static __inline WebRtc_Word32 WEBRTC_SPL_MUL_16_16(WebRtc_Word16 a,
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static __inline int32_t WebRtc_MulAccumW16(int16_t a,
|
||||
int16_t b,
|
||||
int32_t c) {
|
||||
int32_t tmp = 0;
|
||||
__asm__("smlabb %0, %1, %2, %3":"=r"(tmp):"r"(a), "r"(b), "r"(c));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static __inline WebRtc_Word16 WebRtcSpl_AddSatW16(WebRtc_Word16 a,
|
||||
WebRtc_Word16 b) {
|
||||
WebRtc_Word32 s_sum;
|
||||
|
||||
Reference in New Issue
Block a user