diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavcodec/fft-internal.h | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavcodec/fft-internal.h')
| -rw-r--r-- | ffmpeg/libavcodec/fft-internal.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ffmpeg/libavcodec/fft-internal.h b/ffmpeg/libavcodec/fft-internal.h index d66731f..065eecc 100644 --- a/ffmpeg/libavcodec/fft-internal.h +++ b/ffmpeg/libavcodec/fft-internal.h @@ -36,12 +36,29 @@ #else +#define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits))) + +#if CONFIG_FFT_FIXED_32 + +#define CMUL(dre, dim, are, aim, bre, bim) do { \ + int64_t accu; \ + (accu) = (int64_t)(bre) * (are); \ + (accu) -= (int64_t)(bim) * (aim); \ + (dre) = (int)(((accu) + 0x40000000) >> 31); \ + (accu) = (int64_t)(bre) * (aim); \ + (accu) += (int64_t)(bim) * (are); \ + (dim) = (int)(((accu) + 0x40000000) >> 31); \ + } while (0) + +#define FIX15(a) av_clip(SCALE_FLOAT(a, 31), -2147483647, 2147483647) + +#else /* CONFIG_FFT_FIXED_32 */ + #include "fft.h" #include "mathops.h" void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input); -#define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits))) #define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767) #define sqrthalf ((int16_t)((1<<15)*M_SQRT1_2)) @@ -62,6 +79,8 @@ void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input); #define CMULL(dre, dim, are, aim, bre, bim) \ CMULS(dre, dim, are, aim, bre, bim, 0) +#endif /* CONFIG_FFT_FIXED_32 */ + #endif /* CONFIG_FFT_FLOAT */ #define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c) |
