static int imc_decode_frame(AVCodecContext *avctx, void *data,

                            int *got_frame_ptr, AVPacket *avpkt)

{

    AVFrame *frame     = data;

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    int ret, i;



    IMCContext *q = avctx->priv_data;



    LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]);



    if (buf_size < IMC_BLOCK_SIZE * avctx->channels) {

        av_log(avctx, AV_LOG_ERROR, "frame too small!\n");

        return AVERROR_INVALIDDATA;

    }



    /* get output buffer */

    frame->nb_samples = COEFFS;

    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)

        return ret;



    for (i = 0; i < avctx->channels; i++) {

        q->out_samples = (float *)frame->extended_data[i];



        q->bdsp.bswap16_buf(buf16, (const uint16_t *) buf, IMC_BLOCK_SIZE / 2);



        init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8);



        buf += IMC_BLOCK_SIZE;



        if ((ret = imc_decode_block(avctx, q, i)) < 0)

            return ret;

    }



    if (avctx->channels == 2) {

        q->fdsp.butterflies_float((float *)frame->extended_data[0],

                                  (float *)frame->extended_data[1], COEFFS);

    }



    *got_frame_ptr = 1;



    return IMC_BLOCK_SIZE * avctx->channels;

}

static int imc_decode_frame(AVCodecContext *avctx, void *data,

                            int *got_frame_ptr, AVPacket *avpkt)

{

    AVFrame *frame     = data;

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    int ret, i;



    IMCContext *q = avctx->priv_data;



    LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]);



    if (buf_size < IMC_BLOCK_SIZE * avctx->channels) {

        av_log(avctx, AV_LOG_ERROR, "frame too small!\n");

        return AVERROR_INVALIDDATA;

    }



    

    frame->nb_samples = COEFFS;

    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)

        return ret;



    for (i = 0; i < avctx->channels; i++) {

        q->out_samples = (float *)frame->extended_data[i];



        q->bdsp.bswap16_buf(buf16, (const uint16_t *) buf, IMC_BLOCK_SIZE / 2);



        init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8);



        buf += IMC_BLOCK_SIZE;



        if ((ret = imc_decode_block(avctx, q, i)) < 0)

            return ret;

    }



    if (avctx->channels == 2) {

        q->fdsp.butterflies_float((float *)frame->extended_data[0],

                                  (float *)frame->extended_data[1], COEFFS);

    }



    *got_frame_ptr = 1;



    return IMC_BLOCK_SIZE * avctx->channels;

}

    LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]);
static int FUNC_0(AVCodecContext *VAR_0, void *VAR_1,

                            int *VAR_2, AVPacket *VAR_3)

{

    AVFrame *frame     = VAR_1;

    const uint8_t *VAR_4 = VAR_3->VAR_1;

    int VAR_5 = VAR_3->size;

    int VAR_6, VAR_7;



    IMCContext *q = VAR_0->priv_data;



    LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]);



    if (VAR_5 < IMC_BLOCK_SIZE * VAR_0->channels) {

        av_log(VAR_0, AV_LOG_ERROR, "frame too small!\n");

        return AVERROR_INVALIDDATA;

    }



    

    frame->nb_samples = COEFFS;

    if ((VAR_6 = ff_get_buffer(VAR_0, frame, 0)) < 0)

        return VAR_6;



    for (VAR_7 = 0; VAR_7 < VAR_0->channels; VAR_7++) {

        q->out_samples = (float *)frame->extended_data[VAR_7];



        q->bdsp.bswap16_buf(buf16, (const uint16_t *) VAR_4, IMC_BLOCK_SIZE / 2);



        init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8);



        VAR_4 += IMC_BLOCK_SIZE;



        if ((VAR_6 = imc_decode_block(VAR_0, q, VAR_7)) < 0)

            return VAR_6;

    }



    if (VAR_0->channels == 2) {

        q->fdsp.butterflies_float((float *)frame->extended_data[0],

                                  (float *)frame->extended_data[1], COEFFS);

    }



    *VAR_2 = 1;



    return IMC_BLOCK_SIZE * VAR_0->channels;

}

static int FUNC_0(AVCodecContext *VAR_0, void *VAR_1,
int *VAR_2, AVPacket *VAR_3)
{ AVFrame *frame     = VAR_1; const uint8_t *VAR_4 = VAR_3->VAR_1; int VAR_5 = VAR_3->size; int VAR_6, VAR_7; IMCContext *q = VAR_0->priv_data; LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]); if (VAR_5 < IMC_BLOCK_SIZE * VAR_0->channels) { av_log(VAR_0, AV_LOG_ERROR, "frame too small!\n"); return AVERROR_INVALIDDATA; } frame->nb_samples = COEFFS; if ((VAR_6 = ff_get_buffer(VAR_0, frame, 0)) < 0)
return VAR_6; for (VAR_7 = 0; VAR_7 < VAR_0->channels; VAR_7++) { q->out_samples = (float *)frame->extended_data[VAR_7]; q->bdsp.bswap16_buf(buf16, (const uint16_t *) VAR_4, IMC_BLOCK_SIZE / 2); init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8); VAR_4 += IMC_BLOCK_SIZE; if ((VAR_6 = imc_decode_block(VAR_0, q, VAR_7)) < 0)
return VAR_6; } if (VAR_0->channels == 2) { q->fdsp.butterflies_float((float *)frame->extended_data[0],
(float *)frame->extended_data[1], COEFFS); } *VAR_2 = 1; return IMC_BLOCK_SIZE * VAR_0->channels; }