mirror of
https://github.com/xiph/opus.git
synced 2025-05-29 14:49:14 +00:00
Making exp_rotation1() use MAC16_16(), which saves a few cycles on ARM
This commit is contained in:
parent
ccec752a38
commit
ed01a596dc
1 changed files with 6 additions and 4 deletions
10
celt/vq.c
10
celt/vq.c
|
@ -42,15 +42,17 @@
|
|||
static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_val16 s)
|
||||
{
|
||||
int i;
|
||||
opus_val16 ms;
|
||||
celt_norm *Xptr;
|
||||
Xptr = X;
|
||||
ms = NEG16(s);
|
||||
for (i=0;i<len-stride;i++)
|
||||
{
|
||||
celt_norm x1, x2;
|
||||
x1 = Xptr[0];
|
||||
x2 = Xptr[stride];
|
||||
Xptr[stride] = EXTRACT16(PSHR32(MULT16_16(c,x2) + MULT16_16(s,x1), 15));
|
||||
*Xptr++ = EXTRACT16(PSHR32(MULT16_16(c,x1) - MULT16_16(s,x2), 15));
|
||||
Xptr[stride] = EXTRACT16(PSHR32(MAC16_16(MULT16_16(c, x2), s, x1), 15));
|
||||
*Xptr++ = EXTRACT16(PSHR32(MAC16_16(MULT16_16(c, x1), ms, x2), 15));
|
||||
}
|
||||
Xptr = &X[len-2*stride-1];
|
||||
for (i=len-2*stride-1;i>=0;i--)
|
||||
|
@ -58,8 +60,8 @@ static void exp_rotation1(celt_norm *X, int len, int stride, opus_val16 c, opus_
|
|||
celt_norm x1, x2;
|
||||
x1 = Xptr[0];
|
||||
x2 = Xptr[stride];
|
||||
Xptr[stride] = EXTRACT16(PSHR32(MULT16_16(c,x2) + MULT16_16(s,x1), 15));
|
||||
*Xptr-- = EXTRACT16(PSHR32(MULT16_16(c,x1) - MULT16_16(s,x2), 15));
|
||||
Xptr[stride] = EXTRACT16(PSHR32(MAC16_16(MULT16_16(c, x2), s, x1), 15));
|
||||
*Xptr-- = EXTRACT16(PSHR32(MAC16_16(MULT16_16(c, x1), ms, x2), 15));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue