Refactor common_audio/signal_processing: Removed usage of trivial macro WEBRTC_SPL_MUL_16_16
The macro is in C defined as
#define WEBRTC_SPL_MUL_16_16(a, b) \
((int32_t) (((int16_t)(a)) * ((int16_t)(b))))
(For definitions on ARMv7 and MIPS, see common_audio/signal_processing/include/spl_inl_{armv7,mips}.h)
Also includes
- style changes
- replaced pointer operations with direct element access
BUG=3348,3353
TESTED=locally on Linux and trybots
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/48949004
Cr-Commit-Position: refs/heads/master@{#9075}
This commit is contained in:
@ -68,16 +68,11 @@ void WebRtcSpl_AddAffineVectorToVector(int16_t *out, int16_t *in,
|
||||
int16_t gain, int32_t add_constant,
|
||||
int16_t right_shifts, int vector_length)
|
||||
{
|
||||
int16_t *inPtr;
|
||||
int16_t *outPtr;
|
||||
int i;
|
||||
|
||||
inPtr = in;
|
||||
outPtr = out;
|
||||
for (i = 0; i < vector_length; i++)
|
||||
{
|
||||
(*outPtr++) += (int16_t)((WEBRTC_SPL_MUL_16_16((*inPtr++), gain)
|
||||
+ (int32_t)add_constant) >> right_shifts);
|
||||
out[i] += (int16_t)((in[i] * gain + add_constant) >> right_shifts);
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,15 +80,10 @@ void WebRtcSpl_AffineTransformVector(int16_t *out, int16_t *in,
|
||||
int16_t gain, int32_t add_constant,
|
||||
int16_t right_shifts, int vector_length)
|
||||
{
|
||||
int16_t *inPtr;
|
||||
int16_t *outPtr;
|
||||
int i;
|
||||
|
||||
inPtr = in;
|
||||
outPtr = out;
|
||||
for (i = 0; i < vector_length; i++)
|
||||
{
|
||||
(*outPtr++) = (int16_t)((WEBRTC_SPL_MUL_16_16((*inPtr++), gain)
|
||||
+ (int32_t)add_constant) >> right_shifts);
|
||||
out[i] = (int16_t)((in[i] * gain + add_constant) >> right_shifts);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user