static int indeo3_decode_frame(AVCodecContext *avctx,

                               void *data, int *data_size,

                               unsigned char *buf, int buf_size)

{

    Indeo3DecodeContext *s=avctx->priv_data;

    unsigned char *src, *dest;

    int y;



    /* no supplementary picture */

    if (buf_size == 0) {

        return 0;

    }



    iv_decode_frame(s, buf, buf_size);



    if(s->frame.data[0])

        avctx->release_buffer(avctx, &s->frame);



    s->frame.reference = 0;

    if(avctx->get_buffer(avctx, &s->frame) < 0) {

        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }



    src = s->cur_frame->Ybuf;

    dest = s->frame.data[0];

    for (y = 0; y < s->height; y++) {

      memcpy(dest, src, s->cur_frame->y_w);

      src += s->cur_frame->y_w;

      dest += s->frame.linesize[0];

    }



    if (!(s->avctx->flags & CODEC_FLAG_GRAY))

    {

    src = s->cur_frame->Ubuf;

    dest = s->frame.data[1];

    for (y = 0; y < s->height / 4; y++) {

      memcpy(dest, src, s->cur_frame->uv_w);

      src += s->cur_frame->uv_w;

      dest += s->frame.linesize[1];

    }



    src = s->cur_frame->Vbuf;

    dest = s->frame.data[2];

    for (y = 0; y < s->height / 4; y++) {

      memcpy(dest, src, s->cur_frame->uv_w);

      src += s->cur_frame->uv_w;

      dest += s->frame.linesize[2];

    }

    }



    *data_size=sizeof(AVFrame);

    *(AVFrame*)data= s->frame;



    return buf_size;

}

static int indeo3_decode_frame(AVCodecContext *avctx,

                               void *data, int *data_size,

                               unsigned char *buf, int buf_size)

{

    Indeo3DecodeContext *s=avctx->priv_data;

    unsigned char *src, *dest;

    int y;



    

    if (buf_size == 0) {

        return 0;

    }



    iv_decode_frame(s, buf, buf_size);



    if(s->frame.data[0])

        avctx->release_buffer(avctx, &s->frame);



    s->frame.reference = 0;

    if(avctx->get_buffer(avctx, &s->frame) < 0) {

        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }



    src = s->cur_frame->Ybuf;

    dest = s->frame.data[0];

    for (y = 0; y < s->height; y++) {

      memcpy(dest, src, s->cur_frame->y_w);

      src += s->cur_frame->y_w;

      dest += s->frame.linesize[0];

    }



    if (!(s->avctx->flags & CODEC_FLAG_GRAY))

    {

    src = s->cur_frame->Ubuf;

    dest = s->frame.data[1];

    for (y = 0; y < s->height / 4; y++) {

      memcpy(dest, src, s->cur_frame->uv_w);

      src += s->cur_frame->uv_w;

      dest += s->frame.linesize[1];

    }



    src = s->cur_frame->Vbuf;

    dest = s->frame.data[2];

    for (y = 0; y < s->height / 4; y++) {

      memcpy(dest, src, s->cur_frame->uv_w);

      src += s->cur_frame->uv_w;

      dest += s->frame.linesize[2];

    }

    }



    *data_size=sizeof(AVFrame);

    *(AVFrame*)data= s->frame;



    return buf_size;

}

static int FUNC_0(AVCodecContext *VAR_0,

                               void *VAR_1, int *VAR_2,

                               unsigned char *VAR_3, int VAR_4)

{

    Indeo3DecodeContext *s=VAR_0->priv_data;

    unsigned char *VAR_5, *VAR_6;

    int VAR_7;



    

    if (VAR_4 == 0) {

        return 0;

    }



    iv_decode_frame(s, VAR_3, VAR_4);



    if(s->frame.VAR_1[0])

        VAR_0->release_buffer(VAR_0, &s->frame);



    s->frame.reference = 0;

    if(VAR_0->get_buffer(VAR_0, &s->frame) < 0) {

        av_log(s->VAR_0, AV_LOG_ERROR, "get_buffer() failed\n");

        return -1;

    }



    VAR_5 = s->cur_frame->Ybuf;

    VAR_6 = s->frame.VAR_1[0];

    for (VAR_7 = 0; VAR_7 < s->height; VAR_7++) {

      memcpy(VAR_6, VAR_5, s->cur_frame->y_w);

      VAR_5 += s->cur_frame->y_w;

      VAR_6 += s->frame.linesize[0];

    }



    if (!(s->VAR_0->flags & CODEC_FLAG_GRAY))

    {

    VAR_5 = s->cur_frame->Ubuf;

    VAR_6 = s->frame.VAR_1[1];

    for (VAR_7 = 0; VAR_7 < s->height / 4; VAR_7++) {

      memcpy(VAR_6, VAR_5, s->cur_frame->uv_w);

      VAR_5 += s->cur_frame->uv_w;

      VAR_6 += s->frame.linesize[1];

    }



    VAR_5 = s->cur_frame->Vbuf;

    VAR_6 = s->frame.VAR_1[2];

    for (VAR_7 = 0; VAR_7 < s->height / 4; VAR_7++) {

      memcpy(VAR_6, VAR_5, s->cur_frame->uv_w);

      VAR_5 += s->cur_frame->uv_w;

      VAR_6 += s->frame.linesize[2];

    }

    }



    *VAR_2=sizeof(AVFrame);

    *(AVFrame*)VAR_1= s->frame;



    return VAR_4;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
unsigned char *VAR_3, int VAR_4)
{ Indeo3DecodeContext *s=VAR_0->priv_data; unsigned char *VAR_5, *VAR_6; int VAR_7; if (VAR_4 == 0) { return 0; } iv_decode_frame(s, VAR_3, VAR_4); if(s->frame.VAR_1[0])
VAR_0->release_buffer(VAR_0, &s->frame); s->frame.reference = 0; if(VAR_0->get_buffer(VAR_0, &s->frame) < 0) { av_log(s->VAR_0, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } VAR_5 = s->cur_frame->Ybuf; VAR_6 = s->frame.VAR_1[0]; for (VAR_7 = 0; VAR_7 < s->height; VAR_7++) { memcpy(VAR_6, VAR_5, s->cur_frame->y_w); VAR_5 += s->cur_frame->y_w; VAR_6 += s->frame.linesize[0]; } if (!(s->VAR_0->flags & CODEC_FLAG_GRAY))
{ VAR_5 = s->cur_frame->Ubuf; VAR_6 = s->frame.VAR_1[1]; for (VAR_7 = 0; VAR_7 < s->height / 4; VAR_7++) { memcpy(VAR_6, VAR_5, s->cur_frame->uv_w); VAR_5 += s->cur_frame->uv_w; VAR_6 += s->frame.linesize[1]; } VAR_5 = s->cur_frame->Vbuf; VAR_6 = s->frame.VAR_1[2]; for (VAR_7 = 0; VAR_7 < s->height / 4; VAR_7++) { memcpy(VAR_6, VAR_5, s->cur_frame->uv_w); VAR_5 += s->cur_frame->uv_w; VAR_6 += s->frame.linesize[2]; } } *VAR_2=sizeof(AVFrame); *(AVFrame*)VAR_1= s->frame; return VAR_4; }