SchroFrame *ff_create_schro_frame(AVCodecContext *avccontext,

                                  SchroFrameFormat schro_frame_fmt)

{

    AVPicture *p_pic;

    SchroFrame *p_frame;

    int y_width, uv_width;

    int y_height, uv_height;

    int i;



    y_width   = avccontext->width;

    y_height  = avccontext->height;

    uv_width  = y_width  >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));

    uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));



    p_pic = av_mallocz(sizeof(AVPicture));

    avpicture_alloc(p_pic, avccontext->pix_fmt, y_width, y_height);



    p_frame         = schro_frame_new();

    p_frame->format = schro_frame_fmt;

    p_frame->width  = y_width;

    p_frame->height = y_height;

    schro_frame_set_free_callback(p_frame, free_schro_frame, (void *)p_pic);



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

        p_frame->components[i].width  = i ? uv_width : y_width;

        p_frame->components[i].stride = p_pic->linesize[i];

        p_frame->components[i].height = i ? uv_height : y_height;

        p_frame->components[i].length =

                 p_frame->components[i].stride * p_frame->components[i].height;

        p_frame->components[i].data   = p_pic->data[i];



        if (i) {

            p_frame->components[i].v_shift =

                SCHRO_FRAME_FORMAT_V_SHIFT(p_frame->format);

            p_frame->components[i].h_shift =

                SCHRO_FRAME_FORMAT_H_SHIFT(p_frame->format);

        }

    }



    return p_frame;

}

SchroFrame *ff_create_schro_frame(AVCodecContext *avccontext,

                                  SchroFrameFormat schro_frame_fmt)

{

    AVPicture *p_pic;

    SchroFrame *p_frame;

    int y_width, uv_width;

    int y_height, uv_height;

    int i;



    y_width   = avccontext->width;

    y_height  = avccontext->height;

    uv_width  = y_width  >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));

    uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));



    p_pic = av_mallocz(sizeof(AVPicture));

    avpicture_alloc(p_pic, avccontext->pix_fmt, y_width, y_height);



    p_frame         = schro_frame_new();

    p_frame->format = schro_frame_fmt;

    p_frame->width  = y_width;

    p_frame->height = y_height;

    schro_frame_set_free_callback(p_frame, free_schro_frame, (void *)p_pic);



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

        p_frame->components[i].width  = i ? uv_width : y_width;

        p_frame->components[i].stride = p_pic->linesize[i];

        p_frame->components[i].height = i ? uv_height : y_height;

        p_frame->components[i].length =

                 p_frame->components[i].stride * p_frame->components[i].height;

        p_frame->components[i].data   = p_pic->data[i];



        if (i) {

            p_frame->components[i].v_shift =

                SCHRO_FRAME_FORMAT_V_SHIFT(p_frame->format);

            p_frame->components[i].h_shift =

                SCHRO_FRAME_FORMAT_H_SHIFT(p_frame->format);

        }

    }



    return p_frame;

}

    avpicture_alloc(p_pic, avccontext->pix_fmt, y_width, y_height);
SchroFrame *FUNC_0(AVCodecContext *avccontext,

                                  SchroFrameFormat schro_frame_fmt)

{

    AVPicture *p_pic;

    SchroFrame *p_frame;

    int VAR_0, VAR_1;

    int VAR_2, VAR_3;

    int VAR_4;



    VAR_0   = avccontext->width;

    VAR_2  = avccontext->height;

    VAR_1  = VAR_0  >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));

    VAR_3 = VAR_2 >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));



    p_pic = av_mallocz(sizeof(AVPicture));

    avpicture_alloc(p_pic, avccontext->pix_fmt, VAR_0, VAR_2);



    p_frame         = schro_frame_new();

    p_frame->format = schro_frame_fmt;

    p_frame->width  = VAR_0;

    p_frame->height = VAR_2;

    schro_frame_set_free_callback(p_frame, free_schro_frame, (void *)p_pic);



    for (VAR_4 = 0; VAR_4 < 3; ++VAR_4) {

        p_frame->components[VAR_4].width  = VAR_4 ? VAR_1 : VAR_0;

        p_frame->components[VAR_4].stride = p_pic->linesize[VAR_4];

        p_frame->components[VAR_4].height = VAR_4 ? VAR_3 : VAR_2;

        p_frame->components[VAR_4].length =

                 p_frame->components[VAR_4].stride * p_frame->components[VAR_4].height;

        p_frame->components[VAR_4].data   = p_pic->data[VAR_4];



        if (VAR_4) {

            p_frame->components[VAR_4].v_shift =

                SCHRO_FRAME_FORMAT_V_SHIFT(p_frame->format);

            p_frame->components[VAR_4].h_shift =

                SCHRO_FRAME_FORMAT_H_SHIFT(p_frame->format);

        }

    }



    return p_frame;

}

SchroFrame *FUNC_0(AVCodecContext *avccontext,
SchroFrameFormat schro_frame_fmt)
{ AVPicture *p_pic; SchroFrame *p_frame; int VAR_0, VAR_1; int VAR_2, VAR_3; int VAR_4; VAR_0   = avccontext->width; VAR_2  = avccontext->height; VAR_1  = VAR_0  >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt)); VAR_3 = VAR_2 >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt)); p_pic = av_mallocz(sizeof(AVPicture)); avpicture_alloc(p_pic, avccontext->pix_fmt, VAR_0, VAR_2); p_frame         = schro_frame_new(); p_frame->format = schro_frame_fmt; p_frame->width  = VAR_0; p_frame->height = VAR_2; schro_frame_set_free_callback(p_frame, free_schro_frame, (void *)p_pic); for (VAR_4 = 0; VAR_4 < 3; ++VAR_4) { p_frame->components[VAR_4].width  = VAR_4 ? VAR_1 : VAR_0; p_frame->components[VAR_4].stride = p_pic->linesize[VAR_4]; p_frame->components[VAR_4].height = VAR_4 ? VAR_3 : VAR_2; p_frame->components[VAR_4].length =
p_frame->components[VAR_4].stride * p_frame->components[VAR_4].height; p_frame->components[VAR_4].data   = p_pic->data[VAR_4]; if (VAR_4) { p_frame->components[VAR_4].v_shift =
SCHRO_FRAME_FORMAT_V_SHIFT(p_frame->format); p_frame->components[VAR_4].h_shift =
SCHRO_FRAME_FORMAT_H_SHIFT(p_frame->format); } } return p_frame; }