comparison wmaenc.c @ 4737:99d9dd34903b libavcodec

Optimize by building the mdct window and multipying/adding at the same time. Patch by Ian Braithwaite ian .. braithwaite . dk [Ffmpeg-devel] WMA decoder speedup 2007-03-22 22:56
author banan
date Mon, 26 Mar 2007 10:03:57 +0000
parents 2ba8d13a66bc
children bff60ecc02f9
comparison
equal deleted inserted replaced
4736:59649ebd5ed8 4737:99d9dd34903b
90 90
91 for (channel = 0; channel < avctx->channels; channel++) { 91 for (channel = 0; channel < avctx->channels; channel++) {
92 memcpy(s->output, s->frame_out[channel], sizeof(float)*window_len); 92 memcpy(s->output, s->frame_out[channel], sizeof(float)*window_len);
93 j = channel; 93 j = channel;
94 for (i = 0; i < len; i++, j += avctx->channels){ 94 for (i = 0; i < len; i++, j += avctx->channels){
95 s->output[i+window_len] = audio[j] / n * win[i]; 95 s->output[i+window_len] = audio[j] / n * win[window_len - i - 1];
96 s->frame_out[channel][i] = audio[j] / n * win[window_len - i - 1]; 96 s->frame_out[channel][i] = audio[j] / n * win[i];
97 } 97 }
98 ff_mdct_calc(&s->mdct_ctx[window_index], s->coefs[channel], s->output, s->mdct_tmp); 98 ff_mdct_calc(&s->mdct_ctx[window_index], s->coefs[channel], s->output, s->mdct_tmp);
99 } 99 }
100 } 100 }
101 101