Revision 7d485f16

View differences:

libavcodec/aac.c
500 500
        ff_aac_scalefactor_code, sizeof(ff_aac_scalefactor_code[0]), sizeof(ff_aac_scalefactor_code[0]),
501 501
        352);
502 502

  
503
    ff_mdct_init(&ac->mdct, 11, 1);
504
    ff_mdct_init(&ac->mdct_small, 8, 1);
503
    ff_mdct_init(&ac->mdct, 11, 1, 1.0);
504
    ff_mdct_init(&ac->mdct_small, 8, 1, 1.0);
505 505
    // window initialization
506 506
    ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
507 507
    ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
libavcodec/aacenc.c
214 214
    s->samplerate_index = i;
215 215

  
216 216
    dsputil_init(&s->dsp, avctx);
217
    ff_mdct_init(&s->mdct1024, 11, 0);
218
    ff_mdct_init(&s->mdct128,   8, 0);
217
    ff_mdct_init(&s->mdct1024, 11, 0, 1.0);
218
    ff_mdct_init(&s->mdct128,   8, 0, 1.0);
219 219
    // window init
220 220
    ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
221 221
    ff_kbd_window_init(ff_aac_kbd_short_128, 6.0, 128);
libavcodec/ac3dec.c
194 194

  
195 195
    ac3_common_init();
196 196
    ac3_tables_init();
197
    ff_mdct_init(&s->imdct_256, 8, 1);
198
    ff_mdct_init(&s->imdct_512, 9, 1);
197
    ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
198
    ff_mdct_init(&s->imdct_512, 9, 1, 1.0);
199 199
    ff_kbd_window_init(s->window, 5.0, 256);
200 200
    dsputil_init(&s->dsp, avctx);
201 201
    av_lfg_init(&s->dith_state, 0);
libavcodec/atrac3.c
268 268
    }
269 269

  
270 270
    /* Initialize the MDCT transform. */
271
    ff_mdct_init(&mdct_ctx, 9, 1);
271
    ff_mdct_init(&mdct_ctx, 9, 1, 1.0);
272 272
}
273 273

  
274 274
/**
libavcodec/cook.c
259 259
        q->mlt_window[j] *= sqrt(2.0 / q->samples_per_channel);
260 260

  
261 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 263
      av_free(q->mlt_window);
264 264
      return -1;
265 265
    }
libavcodec/dca.c
1318 1318
    dca_init_vlcs();
1319 1319

  
1320 1320
    dsputil_init(&s->dsp, avctx);
1321
    ff_mdct_init(&s->imdct, 6, 1);
1321
    ff_mdct_init(&s->imdct, 6, 1, 1.0);
1322 1322

  
1323 1323
    for(i = 0; i < 6; i++)
1324 1324
        s->samples_chanptr[i] = s->samples + i * 256;
libavcodec/dsputil.h
771 771
extern float ff_sine_4096[4096];
772 772
extern float *ff_sine_windows[6];
773 773

  
774
int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
774
int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale);
775 775
void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
776 776
void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
777 777
void ff_imdct_calc_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
libavcodec/fft-test.c
223 223
            av_log(NULL, AV_LOG_INFO,"IMDCT");
224 224
        else
225 225
            av_log(NULL, AV_LOG_INFO,"MDCT");
226
        ff_mdct_init(m, fft_nbits, do_inverse);
226
        ff_mdct_init(m, fft_nbits, do_inverse, 1.0);
227 227
    } else {
228 228
        if (do_inverse)
229 229
            av_log(NULL, AV_LOG_INFO,"IFFT");
libavcodec/mdct.c
68 68
/**
69 69
 * init MDCT or IMDCT computation.
70 70
 */
71
av_cold int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
71
av_cold int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale)
72 72
{
73 73
    int n, n4, i;
74
    double alpha;
74
    double alpha, theta;
75 75

  
76 76
    memset(s, 0, sizeof(*s));
77 77
    n = 1 << nbits;
......
85 85
    if (!s->tsin)
86 86
        goto fail;
87 87

  
88
    theta = 1.0 / 8.0 + (scale < 0 ? n4 : 0);
89
    scale = sqrt(fabs(scale));
88 90
    for(i=0;i<n4;i++) {
89
        alpha = 2 * M_PI * (i + 1.0 / 8.0) / n;
90
        s->tcos[i] = -cos(alpha);
91
        s->tsin[i] = -sin(alpha);
91
        alpha = 2 * M_PI * (i + theta) / n;
92
        s->tcos[i] = -cos(alpha) * scale;
93
        s->tsin[i] = -sin(alpha) * scale;
92 94
    }
93 95
    if (ff_fft_init(&s->fft, s->nbits - 2, inverse) < 0)
94 96
        goto fail;
libavcodec/nellymoserdec.c
130 130

  
131 131
    s->avctx = avctx;
132 132
    av_lfg_init(&s->random_state, ff_random_get_seed());
133
    ff_mdct_init(&s->imdct_ctx, 8, 1);
133
    ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0);
134 134

  
135 135
    dsputil_init(&s->dsp, avctx);
136 136

  
libavcodec/nellymoserenc.c
145 145

  
146 146
    avctx->frame_size = NELLY_SAMPLES;
147 147
    s->avctx = avctx;
148
    ff_mdct_init(&s->mdct_ctx, 8, 0);
148
    ff_mdct_init(&s->mdct_ctx, 8, 0, 1.0);
149 149
    dsputil_init(&s->dsp, avctx);
150 150

  
151 151
    /* Generate overlap window */
libavcodec/vorbis_dec.c
896 896
    vc->saved           = av_mallocz((vc->blocksize[1]/4)*vc->audio_channels * sizeof(float));
897 897
    vc->previous_window=0;
898 898

  
899
    ff_mdct_init(&vc->mdct[0], bl0, 1);
900
    ff_mdct_init(&vc->mdct[1], bl1, 1);
899
    ff_mdct_init(&vc->mdct[0], bl0, 1, 1.0);
900
    ff_mdct_init(&vc->mdct[1], bl1, 1, 1.0);
901 901

  
902 902
    AV_DEBUG(" vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
903 903
            vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]);
libavcodec/vorbis_enc.c
359 359
    venc->win[0] = ff_vorbis_vwin[venc->log2_blocksize[0] - 6];
360 360
    venc->win[1] = ff_vorbis_vwin[venc->log2_blocksize[1] - 6];
361 361

  
362
    ff_mdct_init(&venc->mdct[0], venc->log2_blocksize[0], 0);
363
    ff_mdct_init(&venc->mdct[1], venc->log2_blocksize[1], 0);
362
    ff_mdct_init(&venc->mdct[0], venc->log2_blocksize[0], 0, 1.0);
363
    ff_mdct_init(&venc->mdct[1], venc->log2_blocksize[1], 0, 1.0);
364 364
}
365 365

  
366 366
static void put_float(PutBitContext * pb, float f) {
libavcodec/wmadec.c
110 110

  
111 111
    /* init MDCT */
112 112
    for(i = 0; i < s->nb_block_sizes; i++)
113
        ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 1);
113
        ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 1, 1.0);
114 114

  
115 115
    if (s->use_noise_coding) {
116 116
        init_vlc(&s->hgain_vlc, HGAINVLCBITS, sizeof(ff_wma_hgain_huffbits),
libavcodec/wmaenc.c
63 63

  
64 64
    /* init MDCT */
65 65
    for(i = 0; i < s->nb_block_sizes; i++)
66
        ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0);
66
        ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0);
67 67

  
68 68
    avctx->block_align=
69 69
    s->block_align= avctx->bit_rate*(int64_t)s->frame_len / (avctx->sample_rate*8);

Also available in: Unified diff