static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,

                                      int src_pix_fmt,

                                      int has_alpha,

                                      int loss_mask)

{

    int dist, i, loss, min_dist, dst_pix_fmt;



    /* find exact color match with smallest size */

    dst_pix_fmt = -1;

    min_dist = 0x7fffffff;

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

        if (pix_fmt_mask & (1 << i)) {

            loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask;

            if (loss == 0) {

                dist = avg_bits_per_pixel(i);

                if (dist < min_dist) {

                    min_dist = dist;

                    dst_pix_fmt = i;

                }

            }

        }

    }

    return dst_pix_fmt;

}

static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,

                                      int src_pix_fmt,

                                      int has_alpha,

                                      int loss_mask)

{

    int dist, i, loss, min_dist, dst_pix_fmt;



    

    dst_pix_fmt = -1;

    min_dist = 0x7fffffff;

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

        if (pix_fmt_mask & (1 << i)) {

            loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask;

            if (loss == 0) {

                dist = avg_bits_per_pixel(i);

                if (dist < min_dist) {

                    min_dist = dist;

                    dst_pix_fmt = i;

                }

            }

        }

    }

    return dst_pix_fmt;

}

        if (pix_fmt_mask & (1 << i)) {
static int FUNC_0(int64_t VAR_0,

                                      int VAR_1,

                                      int VAR_2,

                                      int VAR_3)

{

    int VAR_4, VAR_5, VAR_6, VAR_7, VAR_8;



    

    VAR_8 = -1;

    VAR_7 = 0x7fffffff;

    for(VAR_5 = 0;VAR_5 < PIX_FMT_NB; VAR_5++) {

        if (VAR_0 & (1 << VAR_5)) {

            VAR_6 = avcodec_get_pix_fmt_loss(VAR_5, VAR_1, VAR_2) & VAR_3;

            if (VAR_6 == 0) {

                VAR_4 = avg_bits_per_pixel(VAR_5);

                if (VAR_4 < VAR_7) {

                    VAR_7 = VAR_4;

                    VAR_8 = VAR_5;

                }

            }

        }

    }

    return VAR_8;

}

static int FUNC_0(int64_t VAR_0,
int VAR_1,
int VAR_2,
int VAR_3)
{ int VAR_4, VAR_5, VAR_6, VAR_7, VAR_8; VAR_8 = -1; VAR_7 = 0x7fffffff; for(VAR_5 = 0;VAR_5 < PIX_FMT_NB; VAR_5++) { if (VAR_0 & (1 << VAR_5)) { VAR_6 = avcodec_get_pix_fmt_loss(VAR_5, VAR_1, VAR_2) & VAR_3; if (VAR_6 == 0) { VAR_4 = avg_bits_per_pixel(VAR_5); if (VAR_4 < VAR_7) { VAR_7 = VAR_4; VAR_8 = VAR_5; } } } } return VAR_8; }