comparison cook.c @ 9658:67a20f0eb42c libavcodec

Support for getting (i)MDCT output multiplied by a constant scaling factor. Scaling (i)MDCT output has no runtime overhead and can be used to improve performance of audio codecs. All the changes are only needed in 'ff_mdct_init' function and slow down initialization a bit.
author serge
date Sat, 16 May 2009 14:17:08 +0000
parents 62d00a9c3824
children 38ab367d4231
comparison
equal deleted inserted replaced
9657:8a65ae8929fb 9658:67a20f0eb42c
257 ff_sine_window_init(q->mlt_window, mlt_size); 257 ff_sine_window_init(q->mlt_window, mlt_size);
258 for(j=0 ; j<mlt_size ; j++) 258 for(j=0 ; j<mlt_size ; j++)
259 q->mlt_window[j] *= sqrt(2.0 / q->samples_per_channel); 259 q->mlt_window[j] *= sqrt(2.0 / q->samples_per_channel);
260 260
261 /* Initialize the MDCT. */ 261 /* Initialize the MDCT. */
262 if (ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size)+1, 1)) { 262 if (ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size)+1, 1, 1.0)) {
263 av_free(q->mlt_window); 263 av_free(q->mlt_window);
264 return -1; 264 return -1;
265 } 265 }
266 av_log(q->avctx,AV_LOG_DEBUG,"MDCT initialized, order = %d.\n", 266 av_log(q->avctx,AV_LOG_DEBUG,"MDCT initialized, order = %d.\n",
267 av_log2(mlt_size)+1); 267 av_log2(mlt_size)+1);