void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,

                               int linesize_align[AV_NUM_DATA_POINTERS])

{

    int i;

    int w_align= 1;

    int h_align= 1;



    switch(s->pix_fmt){

    case PIX_FMT_YUV420P:

    case PIX_FMT_YUYV422:

    case PIX_FMT_UYVY422:

    case PIX_FMT_YUV422P:

    case PIX_FMT_YUV440P:

    case PIX_FMT_YUV444P:

    case PIX_FMT_GBRP:

    case PIX_FMT_GRAY8:

    case PIX_FMT_GRAY16BE:

    case PIX_FMT_GRAY16LE:

    case PIX_FMT_YUVJ420P:

    case PIX_FMT_YUVJ422P:

    case PIX_FMT_YUVJ440P:

    case PIX_FMT_YUVJ444P:

    case PIX_FMT_YUVA420P:

    case PIX_FMT_YUVA444P:

    case PIX_FMT_YUV420P9LE:

    case PIX_FMT_YUV420P9BE:

    case PIX_FMT_YUV420P10LE:

    case PIX_FMT_YUV420P10BE:

    case PIX_FMT_YUV422P9LE:

    case PIX_FMT_YUV422P9BE:

    case PIX_FMT_YUV422P10LE:

    case PIX_FMT_YUV422P10BE:

    case PIX_FMT_YUV444P9LE:

    case PIX_FMT_YUV444P9BE:

    case PIX_FMT_YUV444P10LE:

    case PIX_FMT_YUV444P10BE:

    case PIX_FMT_GBRP9LE:

    case PIX_FMT_GBRP9BE:

    case PIX_FMT_GBRP10LE:

    case PIX_FMT_GBRP10BE:

        w_align = 16; //FIXME assume 16 pixel per macroblock

        h_align = 16 * 2; // interlaced needs 2 macroblocks height

        break;

    case PIX_FMT_YUV411P:

    case PIX_FMT_UYYVYY411:

        w_align=32;

        h_align=8;

        break;

    case PIX_FMT_YUV410P:

        if(s->codec_id == CODEC_ID_SVQ1){

            w_align=64;

            h_align=64;

        }

    case PIX_FMT_RGB555:

        if(s->codec_id == CODEC_ID_RPZA){

            w_align=4;

            h_align=4;

        }

    case PIX_FMT_PAL8:

    case PIX_FMT_BGR8:

    case PIX_FMT_RGB8:

        if(s->codec_id == CODEC_ID_SMC){

            w_align=4;

            h_align=4;

        }

        break;

    case PIX_FMT_BGR24:

        if((s->codec_id == CODEC_ID_MSZH) || (s->codec_id == CODEC_ID_ZLIB)){

            w_align=4;

            h_align=4;

        }

        break;

    default:

        w_align= 1;

        h_align= 1;

        break;

    }



    if(s->codec_id == CODEC_ID_IFF_ILBM || s->codec_id == CODEC_ID_IFF_BYTERUN1){

        w_align= FFMAX(w_align, 8);

    }



    *width = FFALIGN(*width , w_align);

    *height= FFALIGN(*height, h_align);

    if (s->codec_id == CODEC_ID_H264)

        *height+=2; // some of the optimized chroma MC reads one line too much



    for (i = 0; i < 4; i++)

        linesize_align[i] = STRIDE_ALIGN;

}

void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,

                               int linesize_align[AV_NUM_DATA_POINTERS])

{

    int i;

    int w_align= 1;

    int h_align= 1;



    switch(s->pix_fmt){

    case PIX_FMT_YUV420P:

    case PIX_FMT_YUYV422:

    case PIX_FMT_UYVY422:

    case PIX_FMT_YUV422P:

    case PIX_FMT_YUV440P:

    case PIX_FMT_YUV444P:

    case PIX_FMT_GBRP:

    case PIX_FMT_GRAY8:

    case PIX_FMT_GRAY16BE:

    case PIX_FMT_GRAY16LE:

    case PIX_FMT_YUVJ420P:

    case PIX_FMT_YUVJ422P:

    case PIX_FMT_YUVJ440P:

    case PIX_FMT_YUVJ444P:

    case PIX_FMT_YUVA420P:

    case PIX_FMT_YUVA444P:

    case PIX_FMT_YUV420P9LE:

    case PIX_FMT_YUV420P9BE:

    case PIX_FMT_YUV420P10LE:

    case PIX_FMT_YUV420P10BE:

    case PIX_FMT_YUV422P9LE:

    case PIX_FMT_YUV422P9BE:

    case PIX_FMT_YUV422P10LE:

    case PIX_FMT_YUV422P10BE:

    case PIX_FMT_YUV444P9LE:

    case PIX_FMT_YUV444P9BE:

    case PIX_FMT_YUV444P10LE:

    case PIX_FMT_YUV444P10BE:

    case PIX_FMT_GBRP9LE:

    case PIX_FMT_GBRP9BE:

    case PIX_FMT_GBRP10LE:

    case PIX_FMT_GBRP10BE:

        w_align = 16; 

        h_align = 16 * 2; 

        break;

    case PIX_FMT_YUV411P:

    case PIX_FMT_UYYVYY411:

        w_align=32;

        h_align=8;

        break;

    case PIX_FMT_YUV410P:

        if(s->codec_id == CODEC_ID_SVQ1){

            w_align=64;

            h_align=64;

        }

    case PIX_FMT_RGB555:

        if(s->codec_id == CODEC_ID_RPZA){

            w_align=4;

            h_align=4;

        }

    case PIX_FMT_PAL8:

    case PIX_FMT_BGR8:

    case PIX_FMT_RGB8:

        if(s->codec_id == CODEC_ID_SMC){

            w_align=4;

            h_align=4;

        }

        break;

    case PIX_FMT_BGR24:

        if((s->codec_id == CODEC_ID_MSZH) || (s->codec_id == CODEC_ID_ZLIB)){

            w_align=4;

            h_align=4;

        }

        break;

    default:

        w_align= 1;

        h_align= 1;

        break;

    }



    if(s->codec_id == CODEC_ID_IFF_ILBM || s->codec_id == CODEC_ID_IFF_BYTERUN1){

        w_align= FFMAX(w_align, 8);

    }



    *width = FFALIGN(*width , w_align);

    *height= FFALIGN(*height, h_align);

    if (s->codec_id == CODEC_ID_H264)

        *height+=2; 



    for (i = 0; i < 4; i++)

        linesize_align[i] = STRIDE_ALIGN;

}

void FUNC_0(AVCodecContext *VAR_0, int *VAR_1, int *VAR_2,

                               int VAR_3[AV_NUM_DATA_POINTERS])

{

    int VAR_4;

    int VAR_5= 1;

    int VAR_6= 1;



    switch(VAR_0->pix_fmt){

    case PIX_FMT_YUV420P:

    case PIX_FMT_YUYV422:

    case PIX_FMT_UYVY422:

    case PIX_FMT_YUV422P:

    case PIX_FMT_YUV440P:

    case PIX_FMT_YUV444P:

    case PIX_FMT_GBRP:

    case PIX_FMT_GRAY8:

    case PIX_FMT_GRAY16BE:

    case PIX_FMT_GRAY16LE:

    case PIX_FMT_YUVJ420P:

    case PIX_FMT_YUVJ422P:

    case PIX_FMT_YUVJ440P:

    case PIX_FMT_YUVJ444P:

    case PIX_FMT_YUVA420P:

    case PIX_FMT_YUVA444P:

    case PIX_FMT_YUV420P9LE:

    case PIX_FMT_YUV420P9BE:

    case PIX_FMT_YUV420P10LE:

    case PIX_FMT_YUV420P10BE:

    case PIX_FMT_YUV422P9LE:

    case PIX_FMT_YUV422P9BE:

    case PIX_FMT_YUV422P10LE:

    case PIX_FMT_YUV422P10BE:

    case PIX_FMT_YUV444P9LE:

    case PIX_FMT_YUV444P9BE:

    case PIX_FMT_YUV444P10LE:

    case PIX_FMT_YUV444P10BE:

    case PIX_FMT_GBRP9LE:

    case PIX_FMT_GBRP9BE:

    case PIX_FMT_GBRP10LE:

    case PIX_FMT_GBRP10BE:

        VAR_5 = 16; 

        VAR_6 = 16 * 2; 

        break;

    case PIX_FMT_YUV411P:

    case PIX_FMT_UYYVYY411:

        VAR_5=32;

        VAR_6=8;

        break;

    case PIX_FMT_YUV410P:

        if(VAR_0->codec_id == CODEC_ID_SVQ1){

            VAR_5=64;

            VAR_6=64;

        }

    case PIX_FMT_RGB555:

        if(VAR_0->codec_id == CODEC_ID_RPZA){

            VAR_5=4;

            VAR_6=4;

        }

    case PIX_FMT_PAL8:

    case PIX_FMT_BGR8:

    case PIX_FMT_RGB8:

        if(VAR_0->codec_id == CODEC_ID_SMC){

            VAR_5=4;

            VAR_6=4;

        }

        break;

    case PIX_FMT_BGR24:

        if((VAR_0->codec_id == CODEC_ID_MSZH) || (VAR_0->codec_id == CODEC_ID_ZLIB)){

            VAR_5=4;

            VAR_6=4;

        }

        break;

    default:

        VAR_5= 1;

        VAR_6= 1;

        break;

    }



    if(VAR_0->codec_id == CODEC_ID_IFF_ILBM || VAR_0->codec_id == CODEC_ID_IFF_BYTERUN1){

        VAR_5= FFMAX(VAR_5, 8);

    }



    *VAR_1 = FFALIGN(*VAR_1 , VAR_5);

    *VAR_2= FFALIGN(*VAR_2, VAR_6);

    if (VAR_0->codec_id == CODEC_ID_H264)

        *VAR_2+=2; 



    for (VAR_4 = 0; VAR_4 < 4; VAR_4++)

        VAR_3[VAR_4] = STRIDE_ALIGN;

}

void FUNC_0(AVCodecContext *VAR_0, int *VAR_1, int *VAR_2,
int VAR_3[AV_NUM_DATA_POINTERS])
{ int VAR_4; int VAR_5= 1; int VAR_6= 1; switch(VAR_0->pix_fmt){ case PIX_FMT_YUV420P:
case PIX_FMT_YUYV422:
case PIX_FMT_UYVY422:
case PIX_FMT_YUV422P:
case PIX_FMT_YUV440P:
case PIX_FMT_YUV444P:
case PIX_FMT_GBRP:
case PIX_FMT_GRAY8:
case PIX_FMT_GRAY16BE:
case PIX_FMT_GRAY16LE:
case PIX_FMT_YUVJ420P:
case PIX_FMT_YUVJ422P:
case PIX_FMT_YUVJ440P:
case PIX_FMT_YUVJ444P:
case PIX_FMT_YUVA420P:
case PIX_FMT_YUVA444P:
case PIX_FMT_YUV420P9LE:
case PIX_FMT_YUV420P9BE:
case PIX_FMT_YUV420P10LE:
case PIX_FMT_YUV420P10BE:
case PIX_FMT_YUV422P9LE:
case PIX_FMT_YUV422P9BE:
case PIX_FMT_YUV422P10LE:
case PIX_FMT_YUV422P10BE:
case PIX_FMT_YUV444P9LE:
case PIX_FMT_YUV444P9BE:
case PIX_FMT_YUV444P10LE:
case PIX_FMT_YUV444P10BE:
case PIX_FMT_GBRP9LE:
case PIX_FMT_GBRP9BE:
case PIX_FMT_GBRP10LE:
case PIX_FMT_GBRP10BE:
VAR_5 = 16; VAR_6 = 16 * 2; break; case PIX_FMT_YUV411P:
case PIX_FMT_UYYVYY411:
VAR_5=32; VAR_6=8; break; case PIX_FMT_YUV410P:
if(VAR_0->codec_id == CODEC_ID_SVQ1){ VAR_5=64; VAR_6=64; } case PIX_FMT_RGB555:
if(VAR_0->codec_id == CODEC_ID_RPZA){ VAR_5=4; VAR_6=4; } case PIX_FMT_PAL8:
case PIX_FMT_BGR8:
case PIX_FMT_RGB8:
if(VAR_0->codec_id == CODEC_ID_SMC){ VAR_5=4; VAR_6=4; } break; case PIX_FMT_BGR24:
if((VAR_0->codec_id == CODEC_ID_MSZH) || (VAR_0->codec_id == CODEC_ID_ZLIB)){ VAR_5=4; VAR_6=4; } break; default:
VAR_5= 1; VAR_6= 1; break; } if(VAR_0->codec_id == CODEC_ID_IFF_ILBM || VAR_0->codec_id == CODEC_ID_IFF_BYTERUN1){ VAR_5= FFMAX(VAR_5, 8); } *VAR_1 = FFALIGN(*VAR_1 , VAR_5); *VAR_2= FFALIGN(*VAR_2, VAR_6); if (VAR_0->codec_id == CODEC_ID_H264)
*VAR_2+=2; for (VAR_4 = 0; VAR_4 < 4; VAR_4++) VAR_3[VAR_4] = STRIDE_ALIGN; }