mirror of
https://github.com/google/liblc3.git
synced 2026-04-27 09:24:49 +00:00
Improvement: Unroll by 2 the mdct windowing
This commit is contained in:
22
src/mdct.c
22
src/mdct.c
@@ -213,14 +213,20 @@ static void mdct_window(
|
||||
|
||||
float *y0 = y + ns/2, *y1 = y0;
|
||||
|
||||
while (x0 < x1)
|
||||
while (x0 < x1) {
|
||||
*(--y0) = *(x0++) * *(w0++) - *(--x1) * *(--w1);
|
||||
*(--y0) = *(x0++) * *(w0++) - *(--x1) * *(--w1);
|
||||
}
|
||||
|
||||
for (const float *xe = x2 + ns-nd; x2 < xe; )
|
||||
for (const float *xe = x2 + ns-nd; x2 < xe; ) {
|
||||
*(y1++) = *(x2++) * *(w2++);
|
||||
*(y1++) = *(x2++) * *(w2++);
|
||||
}
|
||||
|
||||
while (x2 < x3)
|
||||
while (x2 < x3) {
|
||||
*(y1++) = *(x2++) * *(w2++) + *(--x3) * *(--w3);
|
||||
*(y1++) = *(x2++) * *(w2++) + *(--x3) * *(--w3);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -372,20 +378,30 @@ static void imdct_window(enum lc3_dt dt, enum lc3_srate sr,
|
||||
while (y0 > y) {
|
||||
*(--y0) = *(--x0) - *(x ) * *(w1++);
|
||||
*(y1++) = *(x1++) + *(x++) * *(--w0);
|
||||
|
||||
*(--y0) = *(--x0) - *(x ) * *(w1++);
|
||||
*(y1++) = *(x1++) + *(x++) * *(--w0);
|
||||
}
|
||||
|
||||
while (y1 < y + nd) {
|
||||
*(y1++) = *(x1++) + *(x++) * *(--w0);
|
||||
*(y1++) = *(x1++) + *(x++) * *(--w0);
|
||||
}
|
||||
|
||||
while (y1 < y + 2*n4) {
|
||||
*(y1++) = *(x ) * *(--w0);
|
||||
*(--y2) = *(x++) * *(w2++);
|
||||
|
||||
*(y1++) = *(x ) * *(--w0);
|
||||
*(--y2) = *(x++) * *(w2++);
|
||||
}
|
||||
|
||||
while (y2 > y3) {
|
||||
*(y3++) = *(x ) * *(--w0);
|
||||
*(--y2) = *(x++) * *(w2++);
|
||||
|
||||
*(y3++) = *(x ) * *(--w0);
|
||||
*(--y2) = *(x++) * *(w2++);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user