static int avg_bits_per_pixel(int pix_fmt)

{

    int bits;

    const PixFmtInfo *pf;



    pf = &pix_fmt_info[pix_fmt];

    if (pf->is_packed) {

        switch(pix_fmt) {

        case PIX_FMT_RGB24:

        case PIX_FMT_BGR24:

            bits = 24;

            break;

        case PIX_FMT_RGBA32:

            bits = 32;

                        break;

        case PIX_FMT_RGB565:

        case PIX_FMT_RGB555:

            bits = 16;

                        break;

        case PIX_FMT_PAL8:

            bits = 8;

            break;

        default:

            bits = 32;

            break;

        }

    } else {

        bits = pf->depth;

        bits += (2 * pf->depth >> 

                 (pf->x_chroma_shift + pf->x_chroma_shift));

    }

    return bits;

}

static int avg_bits_per_pixel(int pix_fmt)

{

    int bits;

    const PixFmtInfo *pf;



    pf = &pix_fmt_info[pix_fmt];

    if (pf->is_packed) {

        switch(pix_fmt) {

        case PIX_FMT_RGB24:

        case PIX_FMT_BGR24:

            bits = 24;

            break;

        case PIX_FMT_RGBA32:

            bits = 32;

                        break;

        case PIX_FMT_RGB565:

        case PIX_FMT_RGB555:

            bits = 16;

                        break;

        case PIX_FMT_PAL8:

            bits = 8;

            break;

        default:

            bits = 32;

            break;

        }

    } else {

        bits = pf->depth;

        bits += (2 * pf->depth >> 

                 (pf->x_chroma_shift + pf->x_chroma_shift));

    }

    return bits;

}

static int FUNC_0(int VAR_0)

{

    int VAR_1;

    const PixFmtInfo *VAR_2;



    VAR_2 = &pix_fmt_info[VAR_0];

    if (VAR_2->is_packed) {

        switch(VAR_0) {

        case PIX_FMT_RGB24:

        case PIX_FMT_BGR24:

            VAR_1 = 24;

            break;

        case PIX_FMT_RGBA32:

            VAR_1 = 32;

                        break;

        case PIX_FMT_RGB565:

        case PIX_FMT_RGB555:

            VAR_1 = 16;

                        break;

        case PIX_FMT_PAL8:

            VAR_1 = 8;

            break;

        default:

            VAR_1 = 32;

            break;

        }

    } else {

        VAR_1 = VAR_2->depth;

        VAR_1 += (2 * VAR_2->depth >> 

                 (VAR_2->x_chroma_shift + VAR_2->x_chroma_shift));

    }

    return VAR_1;

}

static int FUNC_0(int VAR_0)
{ int VAR_1; const PixFmtInfo *VAR_2; VAR_2 = &pix_fmt_info[VAR_0]; if (VAR_2->is_packed) { switch(VAR_0) { case PIX_FMT_RGB24:
case PIX_FMT_BGR24:
VAR_1 = 24; break; case PIX_FMT_RGBA32:
VAR_1 = 32; break; case PIX_FMT_RGB565:
case PIX_FMT_RGB555:
VAR_1 = 16; break; case PIX_FMT_PAL8:
VAR_1 = 8; break; default:
VAR_1 = 32; break; } } else { VAR_1 = VAR_2->depth; VAR_1 += (2 * VAR_2->depth >>
(VAR_2->x_chroma_shift + VAR_2->x_chroma_shift)); } return VAR_1; }