diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-03 02:28:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-03 02:28:01 +0200 |
commit | f35439699f5546774b840ae9fba7df82729ef0ff (patch) | |
tree | 92c22313b8eda656421372955598d647aa64242e /libavcodec/mdct_fixed.c | |
parent | 85c9365d65c4d03c468cead13f722ddce89d8495 (diff) | |
parent | bc154882e11f4a218cc8cfb10ae0b4cbc83b5f9f (diff) | |
download | ffmpeg-f35439699f5546774b840ae9fba7df82729ef0ff.tar.gz |
Merge remote branch 'qatar/master'
* qatar/master:
Fixed-point MDCT with 32-bit unscaled output
lavc: deprecate rate_emu
lavc: mark hurry_up for removal on next major bump
parser: mark av_parser_parse() for removal on next major bump
lavc: add missing audioconvert includes
jvdec: don't use deprecated CODEC_TYPE_*/PKT_FLAG_KEY
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mdct_fixed.c')
-rw-r--r-- | libavcodec/mdct_fixed.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libavcodec/mdct_fixed.c b/libavcodec/mdct_fixed.c index 5e5819ee34..794a3e0bc2 100644 --- a/libavcodec/mdct_fixed.c +++ b/libavcodec/mdct_fixed.c @@ -18,3 +18,47 @@ #define CONFIG_FFT_FLOAT 0 #include "mdct.c" + +/* same as ff_mdct_calcw_c with double-width unscaled output */ +void ff_mdct_calcw_c(FFTContext *s, FFTDouble *out, const FFTSample *input) +{ + int i, j, n, n8, n4, n2, n3; + FFTDouble re, im; + const uint16_t *revtab = s->revtab; + const FFTSample *tcos = s->tcos; + const FFTSample *tsin = s->tsin; + FFTComplex *x = s->tmp_buf; + FFTDComplex *o = (FFTDComplex *)out; + + n = 1 << s->mdct_bits; + n2 = n >> 1; + n4 = n >> 2; + n8 = n >> 3; + n3 = 3 * n4; + + /* pre rotation */ + for(i=0;i<n8;i++) { + re = RSCALE(-input[2*i+n3] - input[n3-1-2*i]); + im = RSCALE(-input[n4+2*i] + input[n4-1-2*i]); + j = revtab[i]; + CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]); + + re = RSCALE( input[2*i] - input[n2-1-2*i]); + im = RSCALE(-input[n2+2*i] - input[ n-1-2*i]); + j = revtab[n8 + i]; + CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]); + } + + s->fft_calc(s, x); + + /* post rotation */ + for(i=0;i<n8;i++) { + FFTDouble r0, i0, r1, i1; + CMULL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]); + CMULL(i0, r1, x[n8+i ].re, x[n8+i ].im, -tsin[n8+i ], -tcos[n8+i ]); + o[n8-i-1].re = r0; + o[n8-i-1].im = i0; + o[n8+i ].re = r1; + o[n8+i ].im = i1; + } +} |