static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)

{

    const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f;

    int i;

    q->fft.complex[channel][0].re *= 2.0f;

    q->fft.complex[channel][0].im = 0.0f;

    q->rdft_ctx.rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]);

    /* add samples to output buffer */

    for (i = 0; i < ((q->fft_frame_size + 15) & ~15); i++)

        q->output_buffer[q->channels * i + channel] += ((float *) q->fft.complex[channel])[i] * gain;

}

static void qdm2_calculate_fft (QDM2Context *q, int channel, int sub_packet)

{

    const float gain = (q->channels == 1 && q->nb_channels == 2) ? 0.5f : 1.0f;

    int i;

    q->fft.complex[channel][0].re *= 2.0f;

    q->fft.complex[channel][0].im = 0.0f;

    q->rdft_ctx.rdft_calc(&q->rdft_ctx, (FFTSample *)q->fft.complex[channel]);

    

    for (i = 0; i < ((q->fft_frame_size + 15) & ~15); i++)

        q->output_buffer[q->channels * i + channel] += ((float *) q->fft.complex[channel])[i] * gain;

}

static void FUNC_0 (QDM2Context *VAR_0, int VAR_1, int VAR_2)

{

    const float VAR_3 = (VAR_0->channels == 1 && VAR_0->nb_channels == 2) ? 0.5f : 1.0f;

    int VAR_4;

    VAR_0->fft.complex[VAR_1][0].re *= 2.0f;

    VAR_0->fft.complex[VAR_1][0].im = 0.0f;

    VAR_0->rdft_ctx.rdft_calc(&VAR_0->rdft_ctx, (FFTSample *)VAR_0->fft.complex[VAR_1]);

    

    for (VAR_4 = 0; VAR_4 < ((VAR_0->fft_frame_size + 15) & ~15); VAR_4++)

        VAR_0->output_buffer[VAR_0->channels * VAR_4 + VAR_1] += ((float *) VAR_0->fft.complex[VAR_1])[VAR_4] * VAR_3;

}

static void FUNC_0 (QDM2Context *VAR_0, int VAR_1, int VAR_2)
{ const float VAR_3 = (VAR_0->channels == 1 && VAR_0->nb_channels == 2) ? 0.5f : 1.0f; int VAR_4; VAR_0->fft.complex[VAR_1][0].re *= 2.0f; VAR_0->fft.complex[VAR_1][0].im = 0.0f; VAR_0->rdft_ctx.rdft_calc(&VAR_0->rdft_ctx, (FFTSample *)VAR_0->fft.complex[VAR_1]); for (VAR_4 = 0; VAR_4 < ((VAR_0->fft_frame_size + 15) & ~15); VAR_4++) VAR_0->output_buffer[VAR_0->channels * VAR_4 + VAR_1] += ((float *) VAR_0->fft.complex[VAR_1])[VAR_4] * VAR_3; }