diff options
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h')
-rw-r--r-- | lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h | 56 |
1 files changed, 56 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 new file mode 100644 index 0000000000..c442a55663 --- /dev/null +++ b/lib/rbcodec/codecs/libopus/celt/cf/fixed_cf.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* Copyright (C) 2013 Nils Wallménius */ | ||
2 | /* | ||
3 | Redistribution and use in source and binary forms, with or without | ||
4 | modification, are permitted provided that the following conditions | ||
5 | are met: | ||
6 | |||
7 | - Redistributions of source code must retain the above copyright | ||
8 | notice, this list of conditions and the following disclaimer. | ||
9 | |||
10 | - Redistributions in binary form must reproduce the above copyright | ||
11 | notice, this list of conditions and the following disclaimer in the | ||
12 | documentation and/or other materials provided with the distribution. | ||
13 | |||
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
15 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER | ||
18 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
20 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
25 | */ | ||
26 | |||
27 | #ifndef FIXED_CF_H | ||
28 | #define FIXED_CF_H | ||
29 | |||
30 | #undef MULT16_32_Q15 | ||
31 | static inline int32_t MULT16_32_Q15_cf(int32_t a, int32_t b) | ||
32 | { | ||
33 | int32_t r; | ||
34 | asm volatile ("mac.l %[a], %[b], %%acc0;" | ||
35 | "movclr.l %%acc0, %[r];" | ||
36 | : [r] "=r" (r) | ||
37 | : [a] "r" (a<<16), [b] "r" (b) | ||
38 | : "cc"); | ||
39 | return r; | ||
40 | } | ||
41 | #define MULT16_32_Q15(a, b) (MULT16_32_Q15_cf(a, b)) | ||
42 | |||
43 | #undef MULT32_32_Q31 | ||
44 | static inline int32_t MULT32_32_Q31_cf(int32_t a, int32_t b) | ||
45 | { | ||
46 | int32_t r; | ||
47 | asm volatile ("mac.l %[a], %[b], %%acc0;" | ||
48 | "movclr.l %%acc0, %[r];" | ||
49 | : [r] "=r" (r) | ||
50 | : [a] "r" (a), [b] "r" (b) | ||
51 | : "cc"); | ||
52 | return r; | ||
53 | } | ||
54 | #define MULT32_32_Q31(a, b) (MULT32_32_Q31_cf(a, b)) | ||
55 | |||
56 | #endif | ||