| OLD | NEW |
| 1 /* Copyright (C) 2003 Jean-Marc Valin */ | 1 /* Copyright (C) 2003 Jean-Marc Valin */ |
| 2 /** | 2 /** |
| 3 @file fixed_c5x.h | 3 @file fixed_c5x.h |
| 4 @brief Fixed-point operations for the TI C5x DSP family | 4 @brief Fixed-point operations for the TI C5x DSP family |
| 5 */ | 5 */ |
| 6 /* | 6 /* |
| 7 Redistribution and use in source and binary forms, with or without | 7 Redistribution and use in source and binary forms, with or without |
| 8 modification, are permitted provided that the following conditions | 8 modification, are permitted provided that the following conditions |
| 9 are met: | 9 are met: |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef FIXED_C5X_H | 31 #ifndef FIXED_C5X_H |
| 32 #define FIXED_C5X_H | 32 #define FIXED_C5X_H |
| 33 | 33 |
| 34 #include "dsplib.h" | 34 #include "dsplib.h" |
| 35 | 35 |
| 36 #undef IMUL32 | 36 #undef IMUL32 |
| 37 static inline long IMUL32(long i, long j) | 37 static OPUS_INLINE long IMUL32(long i, long j) |
| 38 { | 38 { |
| 39 long ac0, ac1; | 39 long ac0, ac1; |
| 40 ac0 = _lmpy(i>>16,j); | 40 ac0 = _lmpy(i>>16,j); |
| 41 ac1 = ac0 + _lmpy(i,j>>16); | 41 ac1 = ac0 + _lmpy(i,j>>16); |
| 42 return _lmpyu(i,j) + (ac1<<16); | 42 return _lmpyu(i,j) + (ac1<<16); |
| 43 } | 43 } |
| 44 | 44 |
| 45 #undef MAX16 | 45 #undef MAX16 |
| 46 #define MAX16(a,b) _max(a,b) | 46 #define MAX16(a,b) _max(a,b) |
| 47 | 47 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 70 #undef MULT16_32_Q15 | 70 #undef MULT16_32_Q15 |
| 71 #define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_1
6SU((a),(b)),15)) | 71 #define MULT16_32_Q15(a,b) ADD32(SHL(MULT16_16((a),SHR((b),16)),1), SHR(MULT16_1
6SU((a),(b)),15)) |
| 72 | 72 |
| 73 #define celt_ilog2(x) (30 - _lnorm(x)) | 73 #define celt_ilog2(x) (30 - _lnorm(x)) |
| 74 #define OVERRIDE_CELT_ILOG2 | 74 #define OVERRIDE_CELT_ILOG2 |
| 75 | 75 |
| 76 #define celt_maxabs16(x, len) MAX32(EXTEND32(maxval((DATA *)x, len)),-EXTEND32(m
inval((DATA *)x, len))) | 76 #define celt_maxabs16(x, len) MAX32(EXTEND32(maxval((DATA *)x, len)),-EXTEND32(m
inval((DATA *)x, len))) |
| 77 #define OVERRIDE_CELT_MAXABS16 | 77 #define OVERRIDE_CELT_MAXABS16 |
| 78 | 78 |
| 79 #endif /* FIXED_C5X_H */ | 79 #endif /* FIXED_C5X_H */ |
| OLD | NEW |