summaryrefslogtreecommitdiff
path: root/apps/codecs/libfaad/fixed.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libfaad/fixed.h')
-rw-r--r--apps/codecs/libfaad/fixed.h17
1 files changed, 0 insertions, 17 deletions
diff --git a/apps/codecs/libfaad/fixed.h b/apps/codecs/libfaad/fixed.h
index 6cda967399..ee06dc4421 100644
--- a/apps/codecs/libfaad/fixed.h
+++ b/apps/codecs/libfaad/fixed.h
@@ -49,7 +49,6 @@ extern "C" {
49 49
50typedef int32_t real_t; 50typedef int32_t real_t;
51 51
52#define UFIX_CONST(A,PRECISION) ((uint32_t)((A)*(PRECISION)+0.5))
53#define FIX_CONST(A,PRECISION) (((A) >= 0) ? ((real_t)((A)*(PRECISION)+0.5)) : ((real_t)((A)*(PRECISION)-0.5))) 52#define FIX_CONST(A,PRECISION) (((A) >= 0) ? ((real_t)((A)*(PRECISION)+0.5)) : ((real_t)((A)*(PRECISION)-0.5)))
54#define REAL_CONST(A) FIX_CONST((A),(REAL_PRECISION)) 53#define REAL_CONST(A) FIX_CONST((A),(REAL_PRECISION))
55#define COEF_CONST(A) FIX_CONST((A),(COEF_PRECISION)) 54#define COEF_CONST(A) FIX_CONST((A),(COEF_PRECISION))
@@ -129,8 +128,6 @@ static INLINE void ComplexMult(real_t *y1, real_t *y2,
129 #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS) 128 #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS)
130 #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6) 129 #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6)
131 #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23) 130 #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23)
132 #define DESCALE(A,S) ((S)>0?(((A)>>((S)-1))+1)>>1:(A)<<-(S))
133 #define DESCALE_SHIFT(A,SH,SC) DESCALE((A),(SC)-(SH))
134 131
135#elif defined(__GNUC__) && defined (__arm__) 132#elif defined(__GNUC__) && defined (__arm__)
136 133
@@ -208,18 +205,6 @@ static INLINE void ComplexMult(real_t *y1, real_t *y2,
208 *y2 = yt2 << (FRAC_SIZE-FRAC_BITS); 205 *y2 = yt2 << (FRAC_SIZE-FRAC_BITS);
209} 206}
210 207
211static inline real_t DESCALE_SHIFT(unsigned val, int shift, int scale)
212{
213 unsigned out;
214 if ((out = val >> (scale - shift - 1)))
215 {
216 out++;
217 out >>= 1;
218 } else
219 out = val << (shift - scale);
220 return out;
221}
222
223#else 208#else
224 209
225 /* multiply with real shift */ 210 /* multiply with real shift */
@@ -240,8 +225,6 @@ static inline real_t DESCALE_SHIFT(unsigned val, int shift, int scale)
240 #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS) 225 #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS)
241 #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6) 226 #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6)
242 #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23) 227 #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23)
243 #define DESCALE(A,S) ((S)>0?(((A)>>((S)-1))+1)>>1:(A)<<-(S))
244 #define DESCALE_SHIFT(A,SH,SC) DESCALE((A),(SC)-(SH))
245 228
246/* Complex multiplication */ 229/* Complex multiplication */
247static INLINE void ComplexMult(real_t *y1, real_t *y2, 230static INLINE void ComplexMult(real_t *y1, real_t *y2,