static void ff_rdft_calc_c(RDFTContext* s, FFTSample* data)
{
    int i, i1, i2;
    FFTComplex ev, od;
    const int n = 1 << s->nbits;
    const float k1 = 0.5;
    const float k2 = 0.5 - s->inverse;
    const FFTSample *tcos = s->tcos;
    const FFTSample *tsin = s->tsin;
    if (!s->inverse) {
        ff_fft_permute(&s->fft, (FFTComplex*)data);
        ff_fft_calc(&s->fft, (FFTComplex*)data);
    }
    ev.re = data[0];
    data[0] = ev.re+data[1];
    data[1] = ev.re-data[1];
    for (i = 1; i < (n>>2); i++) {
        i1 = 2*i;
        i2 = n-i1;
        ev.re =  k1*(data[i1  ]+data[i2  ]);
        od.im = -k2*(data[i1  ]-data[i2  ]);
        ev.im =  k1*(data[i1+1]-data[i2+1]);
        od.re =  k2*(data[i1+1]+data[i2+1]);
        data[i1  ] =  ev.re + od.re*tcos[i] - od.im*tsin[i];
        data[i1+1] =  ev.im + od.im*tcos[i] + od.re*tsin[i];
        data[i2  ] =  ev.re - od.re*tcos[i] + od.im*tsin[i];
        data[i2+1] = -ev.im + od.im*tcos[i] + od.re*tsin[i];
    }
    data[2*i+1]=s->sign_convention*data[2*i+1];
    if (s->inverse) {
        data[0] *= k1;
        data[1] *= k1;
        ff_fft_permute(&s->fft, (FFTComplex*)data);
        ff_fft_calc(&s->fft, (FFTComplex*)data);
    }
}
['static void qdm2_decode (QDM2Context *q, const uint8_t *in, int16_t *out)\n{\n    int ch, i;\n    const int frame_size = (q->frame_size * q->channels);\n    q->compressed_data = in;\n    q->compressed_size = q->checksum_size;\n    memmove(q->output_buffer, &q->output_buffer[frame_size], frame_size * sizeof(float));\n    memset(&q->output_buffer[frame_size], 0, frame_size * sizeof(float));\n    if (q->sub_packet == 0) {\n        q->has_errors = 0;\n        av_log(NULL,AV_LOG_DEBUG,"Superblock follows\\n");\n        qdm2_decode_super_block(q);\n    }\n    if (!q->has_errors) {\n        if (q->sub_packet == 2)\n            qdm2_decode_fft_packets(q);\n        qdm2_fft_tone_synthesizer(q, q->sub_packet);\n    }\n    for (ch = 0; ch < q->channels; ch++) {\n        qdm2_calculate_fft(q, ch, q->sub_packet);\n        if (!q->has_errors && q->sub_packet_list_C[0].packet != NULL) {\n            SAMPLES_NEEDED_2("has errors, and C list is not empty")\n            return;\n        }\n    }\n    if (!q->has_errors && q->do_synth_filter)\n        qdm2_synthesis_filter(q, q->sub_packet);\n    q->sub_packet = (q->sub_packet + 1) % 16;\n    for (i = 0; i < frame_size; i++) {\n        int value = (int)q->output_buffer[i];\n        if (value > SOFTCLIP_THRESHOLD)\n            value = (value >  HARDCLIP_THRESHOLD) ?  32767 :  softclip_table[ value - SOFTCLIP_THRESHOLD];\n        else if (value < -SOFTCLIP_THRESHOLD)\n            value = (value < -HARDCLIP_THRESHOLD) ? -32767 : -softclip_table[-value - SOFTCLIP_THRESHOLD];\n        out[i] = value;\n    }\n}', 'static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)\n{\n    const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f;\n    int i;\n    q->fft.complex[channel][0].re *= 2.0f;\n    q->fft.complex[channel][0].im = 0.0f;\n    ff_rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]);\n    for (i = 0; i < ((q->fft_frame_size + 15) & ~15); i++)\n        q->output_buffer[q->channels * i + channel] += ((float *) q->fft.complex[channel])[i] * gain;\n}', 'void ff_rdft_calc(RDFTContext *s, FFTSample *data)\n{\n    ff_rdft_calc_c(s, data);\n}', 'static void ff_rdft_calc_c(RDFTContext* s, FFTSample* data)\n{\n    int i, i1, i2;\n    FFTComplex ev, od;\n    const int n = 1 << s->nbits;\n    const float k1 = 0.5;\n    const float k2 = 0.5 - s->inverse;\n    const FFTSample *tcos = s->tcos;\n    const FFTSample *tsin = s->tsin;\n    if (!s->inverse) {\n        ff_fft_permute(&s->fft, (FFTComplex*)data);\n        ff_fft_calc(&s->fft, (FFTComplex*)data);\n    }\n    ev.re = data[0];\n    data[0] = ev.re+data[1];\n    data[1] = ev.re-data[1];\n    for (i = 1; i < (n>>2); i++) {\n        i1 = 2*i;\n        i2 = n-i1;\n        ev.re =  k1*(data[i1  ]+data[i2  ]);\n        od.im = -k2*(data[i1  ]-data[i2  ]);\n        ev.im =  k1*(data[i1+1]-data[i2+1]);\n        od.re =  k2*(data[i1+1]+data[i2+1]);\n        data[i1  ] =  ev.re + od.re*tcos[i] - od.im*tsin[i];\n        data[i1+1] =  ev.im + od.im*tcos[i] + od.re*tsin[i];\n        data[i2  ] =  ev.re - od.re*tcos[i] + od.im*tsin[i];\n        data[i2+1] = -ev.im + od.im*tcos[i] + od.re*tsin[i];\n    }\n    data[2*i+1]=s->sign_convention*data[2*i+1];\n    if (s->inverse) {\n        data[0] *= k1;\n        data[1] *= k1;\n        ff_fft_permute(&s->fft, (FFTComplex*)data);\n        ff_fft_calc(&s->fft, (FFTComplex*)data);\n    }\n}']