summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2012-10-07 00:29:21 +0200
committerNils Wallménius <nils@rockbox.org>2012-10-07 00:31:08 +0200
commitc7840e745e9359f8210e5112bef388c4e3157765 (patch)
tree3e8df57a58db74c2ae0e9a39053ed8bfe6ed494f /lib/rbcodec/codecs
parent3ac0fc7c907695d72f58c41907cef913cf81561f (diff)
opus: speed up mdct overlap add and copying
Unroll overlap add loop by four and use memcpy for copying instead of loops. Change-Id: I17114626a395d5972130251d892f851bc86e3a6a Signed-off-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs')
-rw-r--r--lib/rbcodec/codecs/libopus/celt/celt.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/celt.c b/lib/rbcodec/codecs/libopus/celt/celt.c
index 4a09cc9905..52a66d1b68 100644
--- a/lib/rbcodec/codecs/libopus/celt/celt.c
+++ b/lib/rbcodec/codecs/libopus/celt/celt.c
@@ -448,12 +448,16 @@ static void compute_inv_mdcts(const CELTMode *mode, int shortBlocks, celt_sig *X
clt_mdct_backward(&mode->mdct, &X[b+c*N2*B], x+N2*b, mode->window, overlap, shortBlocks ? mode->maxLM : mode->maxLM-LM, B);
}
- for (j=0;j<overlap;j++)
- out_mem[c][j] = x[j] + overlap_mem[c][j];
- for (;j<N;j++)
- out_mem[c][j] = x[j];
- for (j=0;j<overlap;j++)
- overlap_mem[c][j] = x[N+j];
+ /* overlap can be divided by 4 */
+ for (j=0;j<overlap;j+=4)
+ {
+ out_mem[c][j ] = x[j ] + overlap_mem[c][j ];
+ out_mem[c][j+1] = x[j+1] + overlap_mem[c][j+1];
+ out_mem[c][j+2] = x[j+2] + overlap_mem[c][j+2];
+ out_mem[c][j+3] = x[j+3] + overlap_mem[c][j+3];
+ }
+ OPUS_COPY(out_mem[c]+overlap, x+overlap, N-overlap);
+ OPUS_COPY(overlap_mem[c] , x+N , overlap);
} while (++c<C);
RESTORE_STACK;
}