int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,

                             int has_alpha)

{

    const PixFmtInfo *pf, *ps;

    int loss;



    ps = &pix_fmt_info[src_pix_fmt];

    pf = &pix_fmt_info[dst_pix_fmt];



    /* compute loss */

    loss = 0;

    pf = &pix_fmt_info[dst_pix_fmt];

    if (pf->depth < ps->depth)

        loss |= FF_LOSS_DEPTH;

    if (pf->x_chroma_shift >= ps->x_chroma_shift ||

        pf->y_chroma_shift >= ps->y_chroma_shift)

        loss |= FF_LOSS_RESOLUTION;

    switch(pf->color_type) {

    case FF_COLOR_RGB:

        if (ps->color_type != FF_COLOR_RGB &&

            ps->color_type != FF_COLOR_GRAY)

            loss |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_GRAY:

        if (ps->color_type != FF_COLOR_GRAY)

            loss |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_YUV:

        if (ps->color_type != FF_COLOR_YUV)

            loss |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_YUV_JPEG:

        if (ps->color_type != FF_COLOR_YUV_JPEG &&

            ps->color_type != FF_COLOR_YUV)

            loss |= FF_LOSS_COLORSPACE;

        break;

    default:

        /* fail safe test */

        if (ps->color_type != pf->color_type)

            loss |= FF_LOSS_COLORSPACE;

        break;

    }

    if (pf->color_type == FF_COLOR_GRAY &&

        ps->color_type != FF_COLOR_GRAY)

        loss |= FF_LOSS_CHROMA;

    if (!pf->is_alpha && (ps->is_alpha && has_alpha))

        loss |= FF_LOSS_ALPHA;

    if (pf->is_paletted && (!ps->is_paletted && ps->color_type != FF_COLOR_GRAY))

        loss |= FF_LOSS_COLORQUANT;

    return loss;

}

int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,

                             int has_alpha)

{

    const PixFmtInfo *pf, *ps;

    int loss;



    ps = &pix_fmt_info[src_pix_fmt];

    pf = &pix_fmt_info[dst_pix_fmt];



    

    loss = 0;

    pf = &pix_fmt_info[dst_pix_fmt];

    if (pf->depth < ps->depth)

        loss |= FF_LOSS_DEPTH;

    if (pf->x_chroma_shift >= ps->x_chroma_shift ||

        pf->y_chroma_shift >= ps->y_chroma_shift)

        loss |= FF_LOSS_RESOLUTION;

    switch(pf->color_type) {

    case FF_COLOR_RGB:

        if (ps->color_type != FF_COLOR_RGB &&

            ps->color_type != FF_COLOR_GRAY)

            loss |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_GRAY:

        if (ps->color_type != FF_COLOR_GRAY)

            loss |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_YUV:

        if (ps->color_type != FF_COLOR_YUV)

            loss |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_YUV_JPEG:

        if (ps->color_type != FF_COLOR_YUV_JPEG &&

            ps->color_type != FF_COLOR_YUV)

            loss |= FF_LOSS_COLORSPACE;

        break;

    default:

        

        if (ps->color_type != pf->color_type)

            loss |= FF_LOSS_COLORSPACE;

        break;

    }

    if (pf->color_type == FF_COLOR_GRAY &&

        ps->color_type != FF_COLOR_GRAY)

        loss |= FF_LOSS_CHROMA;

    if (!pf->is_alpha && (ps->is_alpha && has_alpha))

        loss |= FF_LOSS_ALPHA;

    if (pf->is_paletted && (!ps->is_paletted && ps->color_type != FF_COLOR_GRAY))

        loss |= FF_LOSS_COLORQUANT;

    return loss;

}

int FUNC_0(int VAR_0, int VAR_1,

                             int VAR_2)

{

    const PixFmtInfo *VAR_3, *ps;

    int VAR_4;



    ps = &pix_fmt_info[VAR_1];

    VAR_3 = &pix_fmt_info[VAR_0];



    

    VAR_4 = 0;

    VAR_3 = &pix_fmt_info[VAR_0];

    if (VAR_3->depth < ps->depth)

        VAR_4 |= FF_LOSS_DEPTH;

    if (VAR_3->x_chroma_shift >= ps->x_chroma_shift ||

        VAR_3->y_chroma_shift >= ps->y_chroma_shift)

        VAR_4 |= FF_LOSS_RESOLUTION;

    switch(VAR_3->color_type) {

    case FF_COLOR_RGB:

        if (ps->color_type != FF_COLOR_RGB &&

            ps->color_type != FF_COLOR_GRAY)

            VAR_4 |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_GRAY:

        if (ps->color_type != FF_COLOR_GRAY)

            VAR_4 |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_YUV:

        if (ps->color_type != FF_COLOR_YUV)

            VAR_4 |= FF_LOSS_COLORSPACE;

        break;

    case FF_COLOR_YUV_JPEG:

        if (ps->color_type != FF_COLOR_YUV_JPEG &&

            ps->color_type != FF_COLOR_YUV)

            VAR_4 |= FF_LOSS_COLORSPACE;

        break;

    default:

        

        if (ps->color_type != VAR_3->color_type)

            VAR_4 |= FF_LOSS_COLORSPACE;

        break;

    }

    if (VAR_3->color_type == FF_COLOR_GRAY &&

        ps->color_type != FF_COLOR_GRAY)

        VAR_4 |= FF_LOSS_CHROMA;

    if (!VAR_3->is_alpha && (ps->is_alpha && VAR_2))

        VAR_4 |= FF_LOSS_ALPHA;

    if (VAR_3->is_paletted && (!ps->is_paletted && ps->color_type != FF_COLOR_GRAY))

        VAR_4 |= FF_LOSS_COLORQUANT;

    return VAR_4;

}

int FUNC_0(int VAR_0, int VAR_1,
int VAR_2)
{ const PixFmtInfo *VAR_3, *ps; int VAR_4; ps = &pix_fmt_info[VAR_1]; VAR_3 = &pix_fmt_info[VAR_0]; VAR_4 = 0; VAR_3 = &pix_fmt_info[VAR_0]; if (VAR_3->depth < ps->depth)
VAR_4 |= FF_LOSS_DEPTH; if (VAR_3->x_chroma_shift >= ps->x_chroma_shift ||
VAR_3->y_chroma_shift >= ps->y_chroma_shift)
VAR_4 |= FF_LOSS_RESOLUTION; switch(VAR_3->color_type) { case FF_COLOR_RGB:
if (ps->color_type != FF_COLOR_RGB &&
ps->color_type != FF_COLOR_GRAY)
VAR_4 |= FF_LOSS_COLORSPACE; break; case FF_COLOR_GRAY:
if (ps->color_type != FF_COLOR_GRAY)
VAR_4 |= FF_LOSS_COLORSPACE; break; case FF_COLOR_YUV:
if (ps->color_type != FF_COLOR_YUV)
VAR_4 |= FF_LOSS_COLORSPACE; break; case FF_COLOR_YUV_JPEG:
if (ps->color_type != FF_COLOR_YUV_JPEG &&
ps->color_type != FF_COLOR_YUV)
VAR_4 |= FF_LOSS_COLORSPACE; break; default:
if (ps->color_type != VAR_3->color_type)
VAR_4 |= FF_LOSS_COLORSPACE; break; } if (VAR_3->color_type == FF_COLOR_GRAY &&
ps->color_type != FF_COLOR_GRAY)
VAR_4 |= FF_LOSS_CHROMA; if (!VAR_3->is_alpha && (ps->is_alpha && VAR_2))
VAR_4 |= FF_LOSS_ALPHA; if (VAR_3->is_paletted && (!ps->is_paletted && ps->color_type != FF_COLOR_GRAY))
VAR_4 |= FF_LOSS_COLORQUANT; return VAR_4; }