diff options
author | Nils Wallménius <nils@rockbox.org> | 2013-09-01 17:37:58 +0200 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2013-09-01 17:39:15 +0200 |
commit | a35c1b35951ce11e4c6ff658794c3142ba5dd218 (patch) | |
tree | 305f0e87019018b29e4bed9e2dfd6ee4a3bdbdf9 /lib/rbcodec/codecs/libopus/celt | |
parent | 516f7fbd6c60eb153a0ba9d82e9b911e2f9732ab (diff) | |
download | rockbox-a35c1b35951ce11e4c6ff658794c3142ba5dd218.tar.gz rockbox-a35c1b35951ce11e4c6ff658794c3142ba5dd218.zip |
Opus: Coldfire inline asm for comb_filter_const
Speeds up decoding a 64kbps test file by 2.6MHz
Change-Id: Ibeb30f37cc00a4a6f65b64851009753f40e06fc1
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h b/lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h index c442a55663..a2b5d5acef 100644 --- a/lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h +++ b/lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h | |||
@@ -53,4 +53,37 @@ static inline int32_t MULT32_32_Q31_cf(int32_t a, int32_t b) | |||
53 | } | 53 | } |
54 | #define MULT32_32_Q31(a, b) (MULT32_32_Q31_cf(a, b)) | 54 | #define MULT32_32_Q31(a, b) (MULT32_32_Q31_cf(a, b)) |
55 | 55 | ||
56 | #define OVERRIDE_COMB_FILTER_CONST | ||
57 | static void comb_filter_const(opus_val32 *y, opus_val32 *x, int T, int N, | ||
58 | opus_val16 g10, opus_val16 g11, opus_val16 g12) | ||
59 | { | ||
60 | opus_val32 x0, x1, x2, x3, x4; | ||
61 | int i; | ||
62 | x4 = x[-T-2]; | ||
63 | x3 = x[-T-1]; | ||
64 | x2 = x[-T]; | ||
65 | x1 = x[-T+1]; | ||
66 | for (i=0;i<N;i++) | ||
67 | { | ||
68 | x0=x[i-T+2]; | ||
69 | asm volatile("mac.l %[g10], %[x2], %%acc0;" | ||
70 | /* just doing straight MACs here is faster than pre-adding */ | ||
71 | "mac.l %[g11], %[x1], %%acc0;" | ||
72 | "mac.l %[g11], %[x3], %%acc0;" | ||
73 | "mac.l %[g12], %[x0], %%acc0;" | ||
74 | "mac.l %[g12], %[x4], %%acc0;" | ||
75 | "move.l %[x3], %[x4];" | ||
76 | "move.l %[x2], %[x3];" | ||
77 | "move.l %[x1], %[x2];" | ||
78 | "move.l %[x0], %[x1];" | ||
79 | "movclr.l %%acc0, %[x0];" | ||
80 | : [x0] "+r" (x0), [x1] "+r" (x1), [x2] "+r" (x2), | ||
81 | [x3] "+r" (x3), [x4] "+r" (x4) | ||
82 | : [g10] "r" (g10 << 16), [g11] "r" (g11 << 16), | ||
83 | [g12] "r" (g12 << 16) | ||
84 | : "cc"); | ||
85 | y[i] = x[i] + x0; | ||
86 | } | ||
87 | } | ||
88 | |||
56 | #endif | 89 | #endif |