Mercurial > mplayer.hg
comparison libfaad2/common.h @ 18141:59b6fa5b4201
Update to faad2 cvs 20040915+MPlayer fixes
Patch by me and Emanuele Giaquinta
author | rtognimp |
---|---|
date | Tue, 18 Apr 2006 19:39:34 +0000 |
parents | ba7a79482bec |
children | 0783dd397f74 |
comparison
equal
deleted
inserted
replaced
18140:e371c7e18402 | 18141:59b6fa5b4201 |
---|---|
132 # ifndef SCALABLE_DEC | 132 # ifndef SCALABLE_DEC |
133 # define SCALABLE_DEC | 133 # define SCALABLE_DEC |
134 # endif | 134 # endif |
135 #endif | 135 #endif |
136 | 136 |
137 #if ((defined(_WIN32) && !defined(_WIN32_WCE)) /* || ((__GNUC__ >= 3) && defined(__i386__)) */ ) | |
138 #ifndef FIXED_POINT | |
139 /* includes <xmmintrin.h> to enable SSE intrinsics */ | |
140 //#define USE_SSE | |
141 #endif | |
142 #endif | |
143 | 137 |
144 #ifdef FIXED_POINT | 138 #ifdef FIXED_POINT |
145 #define DIV_R(A, B) (((int64_t)A << REAL_BITS)/B) | 139 #define DIV_R(A, B) (((int64_t)A << REAL_BITS)/B) |
146 #define DIV_C(A, B) (((int64_t)A << COEF_BITS)/B) | 140 #define DIV_C(A, B) (((int64_t)A << COEF_BITS)/B) |
147 #else | 141 #else |
305 | 299 |
306 #else /* Normal floating point operation */ | 300 #else /* Normal floating point operation */ |
307 | 301 |
308 typedef float real_t; | 302 typedef float real_t; |
309 | 303 |
310 #ifdef USE_SSE | |
311 # include <xmmintrin.h> | |
312 #endif | |
313 | |
314 #define MUL_R(A,B) ((A)*(B)) | 304 #define MUL_R(A,B) ((A)*(B)) |
315 #define MUL_C(A,B) ((A)*(B)) | 305 #define MUL_C(A,B) ((A)*(B)) |
316 #define MUL_F(A,B) ((A)*(B)) | 306 #define MUL_F(A,B) ((A)*(B)) |
317 | 307 |
318 #define REAL_CONST(A) ((real_t)(A)) | 308 #define REAL_CONST(A) ((real_t)(A)) |
339 fld f | 329 fld f |
340 fistp i | 330 fistp i |
341 } | 331 } |
342 return i; | 332 return i; |
343 } | 333 } |
344 #elif (defined(__i386__) && defined(__GNUC__)) && !defined(__MINGW32__) && !defined(HAVE_LRINTF) | 334 #elif (defined(__i386__) && defined(__GNUC__)) && !defined(HAVE_LRINTF) |
345 #define HAS_LRINTF | 335 #define HAS_LRINTF |
346 // from http://www.stereopsis.com/FPU.html | 336 // from http://www.stereopsis.com/FPU.html |
347 static INLINE int lrintf(float f) | 337 static INLINE int lrintf(float f) |
348 { | 338 { |
349 int i; | 339 int i; |
424 uint32_t floor_log2(uint32_t x); | 414 uint32_t floor_log2(uint32_t x); |
425 uint32_t wl_min_lzc(uint32_t x); | 415 uint32_t wl_min_lzc(uint32_t x); |
426 #ifdef FIXED_POINT | 416 #ifdef FIXED_POINT |
427 #define LOG2_MIN_INF REAL_CONST(-10000) | 417 #define LOG2_MIN_INF REAL_CONST(-10000) |
428 int32_t log2_int(uint32_t val); | 418 int32_t log2_int(uint32_t val); |
419 int32_t log2_fix(uint32_t val); | |
429 int32_t pow2_int(real_t val); | 420 int32_t pow2_int(real_t val); |
430 real_t pow2_fix(real_t val); | 421 real_t pow2_fix(real_t val); |
431 #endif | 422 #endif |
432 uint8_t get_sr_index(const uint32_t samplerate); | 423 uint8_t get_sr_index(const uint32_t samplerate); |
433 uint8_t max_pred_sfb(const uint8_t sr_index); | 424 uint8_t max_pred_sfb(const uint8_t sr_index); |