| Index: silk/mips/macros_mipsr1.h
|
| diff --git a/silk/tables_gain.c b/silk/mips/macros_mipsr1.h
|
| similarity index 58%
|
| copy from silk/tables_gain.c
|
| copy to silk/mips/macros_mipsr1.h
|
| index 37e41d890c331a9b312da5db88c9f18f7c95a6e1..12ed981a6ee45b080d9d1160206269a3590db041 100644
|
| --- a/silk/tables_gain.c
|
| +++ b/silk/mips/macros_mipsr1.h
|
| @@ -25,39 +25,68 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
| POSSIBILITY OF SUCH DAMAGE.
|
| ***********************************************************************/
|
|
|
| -#ifdef HAVE_CONFIG_H
|
| -#include "config.h"
|
| -#endif
|
|
|
| -#include "tables.h"
|
| +#ifndef __SILK_MACROS_MIPSR1_H__
|
| +#define __SILK_MACROS_MIPSR1_H__
|
|
|
| -#ifdef __cplusplus
|
| -extern "C"
|
| -{
|
| -#endif
|
| +#define mips_clz(x) __builtin_clz(x)
|
|
|
| -const opus_uint8 silk_gain_iCDF[ 3 ][ N_LEVELS_QGAIN / 8 ] =
|
| +#undef silk_SMULWB
|
| +static inline int silk_SMULWB(int a, int b)
|
| {
|
| + long long ac;
|
| + int c;
|
| +
|
| + ac = __builtin_mips_mult(a, (opus_int32)(opus_int16)b);
|
| + c = __builtin_mips_extr_w(ac, 16);
|
| +
|
| + return c;
|
| +}
|
| +
|
| +#undef silk_SMLAWB
|
| +#define silk_SMLAWB(a32, b32, c32) ((a32) + silk_SMULWB(b32, c32))
|
| +
|
| +#undef silk_SMULWW
|
| +static inline int silk_SMULWW(int a, int b)
|
| {
|
| - 224, 112, 44, 15, 3, 2, 1, 0
|
| -},
|
| + long long ac;
|
| + int c;
|
| +
|
| + ac = __builtin_mips_mult(a, b);
|
| + c = __builtin_mips_extr_w(ac, 16);
|
| +
|
| + return c;
|
| +}
|
| +
|
| +#undef silk_SMLAWW
|
| +static inline int silk_SMLAWW(int a, int b, int c)
|
| {
|
| - 254, 237, 192, 132, 70, 23, 4, 0
|
| -},
|
| + long long ac;
|
| + int res;
|
| +
|
| + ac = __builtin_mips_mult(b, c);
|
| + res = __builtin_mips_extr_w(ac, 16);
|
| + res += a;
|
| +
|
| + return res;
|
| +}
|
| +
|
| +#define OVERRIDE_silk_CLZ16
|
| +static inline opus_int32 silk_CLZ16(opus_int16 in16)
|
| {
|
| - 255, 252, 226, 155, 61, 11, 2, 0
|
| + int re32;
|
| + opus_int32 in32 = (opus_int32 )in16;
|
| + re32 = mips_clz(in32);
|
| + re32-=16;
|
| + return re32;
|
| }
|
| -};
|
| -
|
| -const opus_uint8 silk_delta_gain_iCDF[ MAX_DELTA_GAIN_QUANT - MIN_DELTA_GAIN_QUANT + 1 ] = {
|
| - 250, 245, 234, 203, 71, 50, 42, 38,
|
| - 35, 33, 31, 29, 28, 27, 26, 25,
|
| - 24, 23, 22, 21, 20, 19, 18, 17,
|
| - 16, 15, 14, 13, 12, 11, 10, 9,
|
| - 8, 7, 6, 5, 4, 3, 2, 1,
|
| - 0
|
| -};
|
| -
|
| -#ifdef __cplusplus
|
| +
|
| +#define OVERRIDE_silk_CLZ32
|
| +static inline opus_int32 silk_CLZ32(opus_int32 in32)
|
| +{
|
| + int re32;
|
| + re32 = mips_clz(in32);
|
| + return re32;
|
| }
|
| -#endif
|
| +
|
| +#endif /* __SILK_MACROS_MIPSR1_H__ */
|
|
|