mdct wrapper function to match fft

Originally committed as revision 14703 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Loren Merritt 2008-08-12 00:38:30 +00:00
parent 0a570e826d
commit d46ac5bfde
9 changed files with 23 additions and 15 deletions

View File

@ -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 */

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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];

View File

@ -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);

View File

@ -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);

View File

@ -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));