diff options
Diffstat (limited to 'libcelt/fixed_generic.h')
-rw-r--r-- | libcelt/fixed_generic.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/libcelt/fixed_generic.h b/libcelt/fixed_generic.h index 5e9c94b..08ee0c5 100644 --- a/libcelt/fixed_generic.h +++ b/libcelt/fixed_generic.h @@ -38,7 +38,7 @@ #define FIXED_GENERIC_H /** Multiply a 16-bit signed value by a 16-bit unsigned value. The result is a 32-bit signed value */ -#define MULT16_16SU(a,b) ((celt_word32_t)(celt_word16_t)(a)*(celt_word32_t)(celt_uint16)(b)) +#define MULT16_16SU(a,b) ((celt_word32)(celt_word16)(a)*(celt_word32)(celt_uint16)(b)) /** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */ #define MULT16_32_Q16(a,b) ADD32(MULT16_16((a),SHR((b),16)), SHR(MULT16_16SU((a),((b)&0x0000ffff)),16)) @@ -53,9 +53,9 @@ #define MULT32_32_Q32(a,b) ADD32(ADD32(MULT16_16(SHR((a),16),SHR((b),16)), SHR(MULT16_16SU(SHR((a),16),((b)&0x0000ffff)),16)), SHR(MULT16_16SU(SHR((b),16),((a)&0x0000ffff)),16)) /** Compile-time conversion of float constant to 16-bit value */ -#define QCONST16(x,bits) ((celt_word16_t)(.5+(x)*(((celt_word32_t)1)<<(bits)))) +#define QCONST16(x,bits) ((celt_word16)(.5+(x)*(((celt_word32)1)<<(bits)))) /** Compile-time conversion of float constant to 32-bit value */ -#define QCONST32(x,bits) ((celt_word32_t)(.5+(x)*(((celt_word32_t)1)<<(bits)))) +#define QCONST32(x,bits) ((celt_word32)(.5+(x)*(((celt_word32)1)<<(bits)))) /** Negate a 16-bit value */ #define NEG16(x) (-(x)) @@ -63,9 +63,9 @@ #define NEG32(x) (-(x)) /** Change a 32-bit value into a 16-bit value. The value is assumed to fit in 16-bit, otherwise the result is undefined */ -#define EXTRACT16(x) ((celt_word16_t)(x)) +#define EXTRACT16(x) ((celt_word16)(x)) /** Change a 16-bit value into a 32-bit value */ -#define EXTEND32(x) ((celt_word32_t)(x)) +#define EXTEND32(x) ((celt_word32)(x)) /** Arithmetic shift-right of a 16-bit value */ #define SHR16(a,shift) ((a) >> (shift)) @@ -74,7 +74,7 @@ /** Arithmetic shift-right of a 32-bit value */ #define SHR32(a,shift) ((a) >> (shift)) /** Arithmetic shift-left of a 32-bit value */ -#define SHL32(a,shift) ((celt_word32_t)(a) << (shift)) +#define SHL32(a,shift) ((celt_word32)(a) << (shift)) /** 16-bit arithmetic shift right with rounding-to-nearest instead of rounding down */ #define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift)) @@ -90,7 +90,7 @@ /** "RAW" macros, should not be used outside of this header file */ #define SHR(a,shift) ((a) >> (shift)) -#define SHL(a,shift) ((celt_word32_t)(a) << (shift)) +#define SHL(a,shift) ((celt_word32)(a) << (shift)) #define PSHR(a,shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift)) #define SATURATE(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) @@ -100,21 +100,21 @@ #define HALF32(x) (SHR32(x,1)) /** Add two 16-bit values */ -#define ADD16(a,b) ((celt_word16_t)((celt_word16_t)(a)+(celt_word16_t)(b))) +#define ADD16(a,b) ((celt_word16)((celt_word16)(a)+(celt_word16)(b))) /** Subtract two 16-bit values */ -#define SUB16(a,b) ((celt_word16_t)(a)-(celt_word16_t)(b)) +#define SUB16(a,b) ((celt_word16)(a)-(celt_word16)(b)) /** Add two 32-bit values */ -#define ADD32(a,b) ((celt_word32_t)(a)+(celt_word32_t)(b)) +#define ADD32(a,b) ((celt_word32)(a)+(celt_word32)(b)) /** Subtract two 32-bit values */ -#define SUB32(a,b) ((celt_word32_t)(a)-(celt_word32_t)(b)) +#define SUB32(a,b) ((celt_word32)(a)-(celt_word32)(b)) /** 16x16 multiplication where the result fits in 16 bits */ -#define MULT16_16_16(a,b) ((((celt_word16_t)(a))*((celt_word16_t)(b)))) +#define MULT16_16_16(a,b) ((((celt_word16)(a))*((celt_word16)(b)))) -/* (celt_word32_t)(celt_word16_t) gives TI compiler a hint that it's 16x16->32 multiply */ +/* (celt_word32)(celt_word16) gives TI compiler a hint that it's 16x16->32 multiply */ /** 16x16 multiplication where the result fits in 32 bits */ -#define MULT16_16(a,b) (((celt_word32_t)(celt_word16_t)(a))*((celt_word32_t)(celt_word16_t)(b))) +#define MULT16_16(a,b) (((celt_word32)(celt_word16)(a))*((celt_word32)(celt_word16)(b))) /** 16x16 multiply-add where the result fits in 32 bits */ #define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b)))) @@ -150,12 +150,12 @@ #define MULT16_16_P15(a,b) (SHR(ADD32(16384,MULT16_16((a),(b))),15)) /** Divide a 32-bit value by a 16-bit value. Result fits in 16 bits */ -#define DIV32_16(a,b) ((celt_word16_t)(((celt_word32_t)(a))/((celt_word16_t)(b)))) +#define DIV32_16(a,b) ((celt_word16)(((celt_word32)(a))/((celt_word16)(b)))) /** Divide a 32-bit value by a 16-bit value and round to nearest. Result fits in 16 bits */ -#define PDIV32_16(a,b) ((celt_word16_t)(((celt_word32_t)(a)+((celt_word16_t)(b)>>1))/((celt_word16_t)(b)))) +#define PDIV32_16(a,b) ((celt_word16)(((celt_word32)(a)+((celt_word16)(b)>>1))/((celt_word16)(b)))) /** Divide a 32-bit value by a 32-bit value. Result fits in 32 bits */ -#define DIV32(a,b) (((celt_word32_t)(a))/((celt_word32_t)(b))) +#define DIV32(a,b) (((celt_word32)(a))/((celt_word32)(b))) /** Divide a 32-bit value by a 32-bit value and round to nearest. Result fits in 32 bits */ -#define PDIV32(a,b) (((celt_word32_t)(a)+((celt_word16_t)(b)>>1))/((celt_word32_t)(b))) +#define PDIV32(a,b) (((celt_word32)(a)+((celt_word16)(b)>>1))/((celt_word32)(b))) #endif |