aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2008-08-12 00:38:30 +0000
committerLoren Merritt <lorenm@u.washington.edu>2008-08-12 00:38:30 +0000
commitd46ac5bfde98b57265de4aaf994e1690afa5d5b5 (patch)
tree483b38b640129a8c5e45f6d28a21e48de78155b4
parent0a570e826d7cb6602219236e20a15d85ab68b073 (diff)
downloadffmpeg-d46ac5bfde98b57265de4aaf994e1690afa5d5b5.tar.gz
mdct wrapper function to match fft
Originally committed as revision 14703 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/ac3dec.c5
-rw-r--r--libavcodec/atrac3.c2
-rw-r--r--libavcodec/cook.c2
-rw-r--r--libavcodec/dsputil.h13
-rw-r--r--libavcodec/fft.c4
-rw-r--r--libavcodec/mdct.c6
-rw-r--r--libavcodec/nellymoserdec.c2
-rw-r--r--libavcodec/vorbis_dec.c2
-rw-r--r--libavcodec/wmadec.c2
9 files changed, 23 insertions, 15 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index c77130d781..5b8810d586 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -605,7 +605,7 @@ static void do_imdct_256(AC3DecodeContext *s, int chindex)
}
/* run standard IMDCT */
- s->imdct_256.fft.imdct_calc(&s->imdct_256, o_ptr, x);
+ ff_imdct_calc(&s->imdct_256, o_ptr, x);
/* reverse the post-rotation & reordering from standard IMDCT */
for(k=0; k<32; k++) {
@@ -642,8 +642,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
if (s->block_switch[ch]) {
do_imdct_256(s, ch);
} else {
- s->imdct_512.fft.imdct_calc(&s->imdct_512, s->tmp_output,
- s->transform_coeffs[ch]);
+ ff_imdct_calc(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
}
/* For the first half of the block, apply the window, add the delay
from the previous block, and send to output */
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index a41329f991..708627edbc 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -208,7 +208,7 @@ static void IMLT(float *pInput, float *pOutput, int odd_band)
FFSWAP(float, pInput[i], pInput[255-i]);
}
- mdct_ctx.fft.imdct_calc(&mdct_ctx,pOutput,pInput);
+ ff_imdct_calc(&mdct_ctx,pOutput,pInput);
/* Perform windowing on the output. */
dsp.vector_fmul(pOutput,mdct_window,512);
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index b1390e4f2f..ba9f30facd 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -733,7 +733,7 @@ static void imlt_gain(COOKContext *q, float *inbuffer,
int i;
/* Inverse modified discrete cosine transform */
- q->mdct_ctx.fft.imdct_calc(&q->mdct_ctx, q->mono_mdct_output, inbuffer);
+ ff_imdct_calc(&q->mdct_ctx, q->mono_mdct_output, inbuffer);
q->imlt_window (q, buffer1, gains_ptr, previous_buffer);
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index a0e25a6b8e..600f4fbcce 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -676,6 +676,15 @@ typedef struct MDCTContext {
FFTContext fft;
} MDCTContext;
+static inline void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input)
+{
+ s->fft.imdct_calc(s, output, input);
+}
+static inline void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
+{
+ s->fft.imdct_half(s, output, input);
+}
+
/**
* Generate a Kaiser-Bessel Derived Window.
* @param window pointer to half window
@@ -692,8 +701,8 @@ void ff_kbd_window_init(float *window, float alpha, int n);
void ff_sine_window_init(float *window, int n);
int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
-void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input);
+void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
+void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
void ff_imdct_calc_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
void ff_imdct_half_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input);
diff --git a/libavcodec/fft.c b/libavcodec/fft.c
index b659de16a1..4e32b039e8 100644
--- a/libavcodec/fft.c
+++ b/libavcodec/fft.c
@@ -87,8 +87,8 @@ int ff_fft_init(FFTContext *s, int nbits, int inverse)
s->fft_permute = ff_fft_permute_c;
s->fft_calc = ff_fft_calc_c;
- s->imdct_calc = ff_imdct_calc;
- s->imdct_half = ff_imdct_half;
+ s->imdct_calc = ff_imdct_calc_c;
+ s->imdct_half = ff_imdct_half_c;
s->exptab1 = NULL;
#if defined HAVE_MMX && defined HAVE_YASM
diff --git a/libavcodec/mdct.c b/libavcodec/mdct.c
index e8fd68228d..f4e2a93a6a 100644
--- a/libavcodec/mdct.c
+++ b/libavcodec/mdct.c
@@ -106,7 +106,7 @@ int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
* @param output N/2 samples
* @param input N/2 samples
*/
-void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
{
int k, n8, n4, n2, n, j;
const uint16_t *revtab = s->fft.revtab;
@@ -150,14 +150,14 @@ void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
* @param input N/2 samples
* @param tmp N/2 samples
*/
-void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
{
int k;
int n = 1 << s->nbits;
int n2 = n >> 1;
int n4 = n >> 2;
- ff_imdct_half(s, output+n4, input);
+ ff_imdct_half_c(s, output+n4, input);
for(k = 0; k < n4; k++) {
output[k] = -output[n2-k-1];
diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c
index 8374a6885f..f2a413e49a 100644
--- a/libavcodec/nellymoserdec.c
+++ b/libavcodec/nellymoserdec.c
@@ -119,7 +119,7 @@ static void nelly_decode_block(NellyMoserDecodeContext *s,
memset(&aptr[NELLY_FILL_LEN], 0,
(NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float));
- s->imdct_ctx.fft.imdct_calc(&s->imdct_ctx, s->imdct_out, aptr);
+ ff_imdct_calc(&s->imdct_ctx, s->imdct_out, aptr);
/* XXX: overlapping and windowing should be part of a more
generic imdct function */
overlap_and_window(s, s->state, aptr, s->imdct_out);
diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c
index 87e8afe96c..a178360666 100644
--- a/libavcodec/vorbis_dec.c
+++ b/libavcodec/vorbis_dec.c
@@ -1528,7 +1528,7 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) {
float *buf=residue;
const float *win=vc->win[blockflag&previous_window];
- vc->mdct[0].fft.imdct_half(&vc->mdct[blockflag], buf, floor);
+ ff_imdct_half(&vc->mdct[blockflag], buf, floor);
if(blockflag == previous_window) {
vc->dsp.vector_fmul_window(ret, saved, buf, win, fadd_bias, blocksize/4);
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 6f29c686bf..74b95cd528 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -688,7 +688,7 @@ next:
n = s->block_len;
n4 = s->block_len / 2;
if(s->channel_coded[ch]){
- s->mdct_ctx[bsize].fft.imdct_calc(&s->mdct_ctx[bsize], s->output, s->coefs[ch]);
+ ff_imdct_calc(&s->mdct_ctx[bsize], s->output, s->coefs[ch]);
}else
memset(s->output, 0, sizeof(s->output));