static int split_field_half_ref_list(Picture *dest, int dest_len,

                                     Picture *src,  int src_len,  int parity){

    int same_parity   = 1;

    int same_i        = 0;

    int opp_i         = 0;

    int out_i;

    int field_output;



    for (out_i = 0; out_i < dest_len; out_i += field_output) {

        if (same_parity && same_i < src_len) {

            field_output = split_field_copy(dest + out_i, src + same_i,

                                            parity, 1);

            same_parity = !field_output;

            same_i++;



        } else if (opp_i < src_len) {

            field_output = split_field_copy(dest + out_i, src + opp_i,

                                            PICT_FRAME - parity, 0);

            same_parity = field_output;

            opp_i++;



        } else {

            break;

        }

    }



    return out_i;

}

static int split_field_half_ref_list(Picture *dest, int dest_len,

                                     Picture *src,  int src_len,  int parity){

    int same_parity   = 1;

    int same_i        = 0;

    int opp_i         = 0;

    int out_i;

    int field_output;



    for (out_i = 0; out_i < dest_len; out_i += field_output) {

        if (same_parity && same_i < src_len) {

            field_output = split_field_copy(dest + out_i, src + same_i,

                                            parity, 1);

            same_parity = !field_output;

            same_i++;



        } else if (opp_i < src_len) {

            field_output = split_field_copy(dest + out_i, src + opp_i,

                                            PICT_FRAME - parity, 0);

            same_parity = field_output;

            opp_i++;



        } else {

            break;

        }

    }



    return out_i;

}

static int FUNC_0(Picture *VAR_0, int VAR_1,

                                     Picture *VAR_2,  int VAR_3,  int VAR_4){

    int VAR_5   = 1;

    int VAR_6        = 0;

    int VAR_7         = 0;

    int VAR_8;

    int VAR_9;



    for (VAR_8 = 0; VAR_8 < VAR_1; VAR_8 += VAR_9) {

        if (VAR_5 && VAR_6 < VAR_3) {

            VAR_9 = split_field_copy(VAR_0 + VAR_8, VAR_2 + VAR_6,

                                            VAR_4, 1);

            VAR_5 = !VAR_9;

            VAR_6++;



        } else if (VAR_7 < VAR_3) {

            VAR_9 = split_field_copy(VAR_0 + VAR_8, VAR_2 + VAR_7,

                                            PICT_FRAME - VAR_4, 0);

            VAR_5 = VAR_9;

            VAR_7++;



        } else {

            break;

        }

    }



    return VAR_8;

}

static int FUNC_0(Picture *VAR_0, int VAR_1,
Picture *VAR_2,  int VAR_3,  int VAR_4){ int VAR_5   = 1; int VAR_6        = 0; int VAR_7         = 0; int VAR_8; int VAR_9; for (VAR_8 = 0; VAR_8 < VAR_1; VAR_8 += VAR_9) { if (VAR_5 && VAR_6 < VAR_3) { VAR_9 = split_field_copy(VAR_0 + VAR_8, VAR_2 + VAR_6,
VAR_4, 1); VAR_5 = !VAR_9; VAR_6++; } else if (VAR_7 < VAR_3) { VAR_9 = split_field_copy(VAR_0 + VAR_8, VAR_2 + VAR_7,
PICT_FRAME - VAR_4, 0); VAR_5 = VAR_9; VAR_7++; } else { break; } } return VAR_8; }