static int dvvideo_decode_frame(AVCodecContext *avctx,

                                 void *data, int *data_size,

                                 AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    DVVideoContext *s = avctx->priv_data;



    s->sys = dv_frame_profile(buf);

    if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys))

        return -1; /* NOTE: we only accept several full frames */



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

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



    s->picture.reference = 0;

    s->picture.key_frame = 1;

    s->picture.pict_type = FF_I_TYPE;

    avctx->pix_fmt   = s->sys->pix_fmt;

    avctx->time_base = s->sys->time_base;

    avcodec_set_dimensions(avctx, s->sys->width, s->sys->height);

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

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

        return -1;

    }

    s->picture.interlaced_frame = 1;

    s->picture.top_field_first  = 0;



    s->buf = buf;

    avctx->execute(avctx, dv_decode_video_segment, s->sys->work_chunks, NULL,

                   dv_work_pool_size(s->sys), sizeof(DVwork_chunk));



    emms_c();



    /* return image */

    *data_size = sizeof(AVFrame);

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



    return s->sys->frame_size;

}

static int dvvideo_decode_frame(AVCodecContext *avctx,

                                 void *data, int *data_size,

                                 AVPacket *avpkt)

{

    const uint8_t *buf = avpkt->data;

    int buf_size = avpkt->size;

    DVVideoContext *s = avctx->priv_data;



    s->sys = dv_frame_profile(buf);

    if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys))

        return -1; 



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

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



    s->picture.reference = 0;

    s->picture.key_frame = 1;

    s->picture.pict_type = FF_I_TYPE;

    avctx->pix_fmt   = s->sys->pix_fmt;

    avctx->time_base = s->sys->time_base;

    avcodec_set_dimensions(avctx, s->sys->width, s->sys->height);

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

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

        return -1;

    }

    s->picture.interlaced_frame = 1;

    s->picture.top_field_first  = 0;



    s->buf = buf;

    avctx->execute(avctx, dv_decode_video_segment, s->sys->work_chunks, NULL,

                   dv_work_pool_size(s->sys), sizeof(DVwork_chunk));



    emms_c();



    

    *data_size = sizeof(AVFrame);

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



    return s->sys->frame_size;

}

    s->sys = dv_frame_profile(buf);
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;

    DVVideoContext *s = VAR_0->priv_data;



    s->sys = dv_frame_profile(VAR_4);

    if (!s->sys || VAR_5 < s->sys->frame_size || dv_init_dynamic_tables(s->sys))

        return -1; 



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

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



    s->picture.reference = 0;

    s->picture.key_frame = 1;

    s->picture.pict_type = FF_I_TYPE;

    VAR_0->pix_fmt   = s->sys->pix_fmt;

    VAR_0->time_base = s->sys->time_base;

    avcodec_set_dimensions(VAR_0, s->sys->width, s->sys->height);

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

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

        return -1;

    }

    s->picture.interlaced_frame = 1;

    s->picture.top_field_first  = 0;



    s->VAR_4 = VAR_4;

    VAR_0->execute(VAR_0, dv_decode_video_segment, s->sys->work_chunks, NULL,

                   dv_work_pool_size(s->sys), sizeof(DVwork_chunk));



    emms_c();



    

    *VAR_2 = sizeof(AVFrame);

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



    return s->sys->frame_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; DVVideoContext *s = VAR_0->priv_data; s->sys = dv_frame_profile(VAR_4); if (!s->sys || VAR_5 < s->sys->frame_size || dv_init_dynamic_tables(s->sys))
return -1; if (s->picture.VAR_1[0])
VAR_0->release_buffer(VAR_0, &s->picture); s->picture.reference = 0; s->picture.key_frame = 1; s->picture.pict_type = FF_I_TYPE; VAR_0->pix_fmt   = s->sys->pix_fmt; VAR_0->time_base = s->sys->time_base; avcodec_set_dimensions(VAR_0, s->sys->width, s->sys->height); if (VAR_0->get_buffer(VAR_0, &s->picture) < 0) { av_log(VAR_0, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } s->picture.interlaced_frame = 1; s->picture.top_field_first  = 0; s->VAR_4 = VAR_4; VAR_0->execute(VAR_0, dv_decode_video_segment, s->sys->work_chunks, NULL,
dv_work_pool_size(s->sys), sizeof(DVwork_chunk)); emms_c(); *VAR_2 = sizeof(AVFrame); *(AVFrame*)VAR_1 = s->picture; return s->sys->frame_size; }