static int qdm2_decode_frame(AVCodecContext *avctx,

            void *data, int *data_size,

            AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    QDM2Context *s = avctx->priv_data;

    int16_t *out = data;

    int i;



    if(!buf)

        return 0;

    if(buf_size < s->checksum_size)

        return -1;



    av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",

       buf_size, buf, s->checksum_size, data, *data_size);



    for (i = 0; i < 16; i++) {

        if (qdm2_decode(s, buf, out) < 0)

            return -1;

        out += s->channels * s->frame_size;

    }



    *data_size = (uint8_t*)out - (uint8_t*)data;



    return s->checksum_size;

}

static int qdm2_decode_frame(AVCodecContext *avctx,

            void *data, int *data_size,

            AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    QDM2Context *s = avctx->priv_data;

    int16_t *out = data;

    int i;



    if(!buf)

        return 0;

    if(buf_size < s->checksum_size)

        return -1;



    av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",

       buf_size, buf, s->checksum_size, data, *data_size);



    for (i = 0; i < 16; i++) {

        if (qdm2_decode(s, buf, out) < 0)

            return -1;

        out += s->channels * s->frame_size;

    }



    *data_size = (uint8_t*)out - (uint8_t*)data;



    return s->checksum_size;

}

static int FUNC_0(AVCodecContext *VAR_0,

            void *VAR_1, int *VAR_2,

            AVPacket *VAR_3)

{

    const uint8_t *VAR_4 = VAR_3->VAR_1;

    int VAR_5 = VAR_3->size;

    QDM2Context *s = VAR_0->priv_data;

    int16_t *out = VAR_1;

    int VAR_6;



    if(!VAR_4)

        return 0;

    if(VAR_5 < s->checksum_size)

        return -1;



    av_log(VAR_0, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",

       VAR_5, VAR_4, s->checksum_size, VAR_1, *VAR_2);



    for (VAR_6 = 0; VAR_6 < 16; VAR_6++) {

        if (qdm2_decode(s, VAR_4, out) < 0)

            return -1;

        out += s->channels * s->frame_size;

    }



    *VAR_2 = (uint8_t*)out - (uint8_t*)VAR_1;



    return s->checksum_size;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
AVPacket *VAR_3)
{ const uint8_t *VAR_4 = VAR_3->VAR_1; int VAR_5 = VAR_3->size; QDM2Context *s = VAR_0->priv_data; int16_t *out = VAR_1; int VAR_6; if(!VAR_4)
return 0; if(VAR_5 < s->checksum_size)
return -1; av_log(VAR_0, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n",
VAR_5, VAR_4, s->checksum_size, VAR_1, *VAR_2); for (VAR_6 = 0; VAR_6 < 16; VAR_6++) { if (qdm2_decode(s, VAR_4, out) < 0)
return -1; out += s->channels * s->frame_size; } *VAR_2 = (uint8_t*)out - (uint8_t*)VAR_1; return s->checksum_size; }