summaryrefslogtreecommitdiff
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
parent3ac0fc7c907695d72f58c41907cef913cf81561f (diff)
downloadrockbox-c7840e745e9359f8210e5112bef388c4e3157765.tar.gz
rockbox-c7840e745e9359f8210e5112bef388c4e3157765.zip
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>
-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
448 clt_mdct_backward(&mode->mdct, &X[b+c*N2*B], x+N2*b, mode->window, overlap, shortBlocks ? mode->maxLM : mode->maxLM-LM, B); 448 clt_mdct_backward(&mode->mdct, &X[b+c*N2*B], x+N2*b, mode->window, overlap, shortBlocks ? mode->maxLM : mode->maxLM-LM, B);
449 } 449 }
450 450
451 for (j=0;j<overlap;j++) 451 /* overlap can be divided by 4 */
452 out_mem[c][j] = x[j] + overlap_mem[c][j]; 452 for (j=0;j<overlap;j+=4)
453 for (;j<N;j++) 453 {
454 out_mem[c][j] = x[j]; 454 out_mem[c][j ] = x[j ] + overlap_mem[c][j ];
455 for (j=0;j<overlap;j++) 455 out_mem[c][j+1] = x[j+1] + overlap_mem[c][j+1];
456 overlap_mem[c][j] = x[N+j]; 456 out_mem[c][j+2] = x[j+2] + overlap_mem[c][j+2];
457 out_mem[c][j+3] = x[j+3] + overlap_mem[c][j+3];
458 }
459 OPUS_COPY(out_mem[c]+overlap, x+overlap, N-overlap);
460 OPUS_COPY(overlap_mem[c] , x+N , overlap);
457 } while (++c<C); 461 } while (++c<C);
458 RESTORE_STACK; 462 RESTORE_STACK;
459} 463}