static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel)

{

    int  i[2] = { 0 };

    int index = 0;



    while (i[0] < len || i[1] < len) {

        while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel)))

            i[0]++;

        while (i[1] < len && !(in[i[1]] && (in[i[1]]->reference & (sel ^ 3))))

            i[1]++;

        if (i[0] < len) {

            in[i[0]]->pic_id = is_long ? i[0] : in[i[0]]->frame_num;

            split_field_copy(&def[index++], in[i[0]++], sel, 1);

        }

        if (i[1] < len) {

            in[i[1]]->pic_id = is_long ? i[1] : in[i[1]]->frame_num;

            split_field_copy(&def[index++], in[i[1]++], sel ^ 3, 0);

        }

    }



    return index;

}

static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel)

{

    int  i[2] = { 0 };

    int index = 0;



    while (i[0] < len || i[1] < len) {

        while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel)))

            i[0]++;

        while (i[1] < len && !(in[i[1]] && (in[i[1]]->reference & (sel ^ 3))))

            i[1]++;

        if (i[0] < len) {

            in[i[0]]->pic_id = is_long ? i[0] : in[i[0]]->frame_num;

            split_field_copy(&def[index++], in[i[0]++], sel, 1);

        }

        if (i[1] < len) {

            in[i[1]]->pic_id = is_long ? i[1] : in[i[1]]->frame_num;

            split_field_copy(&def[index++], in[i[1]++], sel ^ 3, 0);

        }

    }



    return index;

}

static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel)     while (i[0] < len || i[1] < len) {         if (i[0] < len) {         if (i[1] < len) {
static int FUNC_0(Picture *VAR_0, Picture **VAR_1, int VAR_2, int VAR_3, int VAR_4)

{

    int  VAR_5[2] = { 0 };

    int VAR_6 = 0;



    while (VAR_5[0] < VAR_2 || VAR_5[1] < VAR_2) {

        while (VAR_5[0] < VAR_2 && !(VAR_1[VAR_5[0]] && (VAR_1[VAR_5[0]]->reference & VAR_4)))

            VAR_5[0]++;

        while (VAR_5[1] < VAR_2 && !(VAR_1[VAR_5[1]] && (VAR_1[VAR_5[1]]->reference & (VAR_4 ^ 3))))

            VAR_5[1]++;

        if (VAR_5[0] < VAR_2) {

            VAR_1[VAR_5[0]]->pic_id = VAR_3 ? VAR_5[0] : VAR_1[VAR_5[0]]->frame_num;

            split_field_copy(&VAR_0[VAR_6++], VAR_1[VAR_5[0]++], VAR_4, 1);

        }

        if (VAR_5[1] < VAR_2) {

            VAR_1[VAR_5[1]]->pic_id = VAR_3 ? VAR_5[1] : VAR_1[VAR_5[1]]->frame_num;

            split_field_copy(&VAR_0[VAR_6++], VAR_1[VAR_5[1]++], VAR_4 ^ 3, 0);

        }

    }



    return VAR_6;

}

static int FUNC_0(Picture *VAR_0, Picture **VAR_1, int VAR_2, int VAR_3, int VAR_4)
{ int  VAR_5[2] = { 0 }; int VAR_6 = 0; while (VAR_5[0] < VAR_2 || VAR_5[1] < VAR_2) { while (VAR_5[0] < VAR_2 && !(VAR_1[VAR_5[0]] && (VAR_1[VAR_5[0]]->reference & VAR_4)))
VAR_5[0]++; while (VAR_5[1] < VAR_2 && !(VAR_1[VAR_5[1]] && (VAR_1[VAR_5[1]]->reference & (VAR_4 ^ 3))))
VAR_5[1]++; if (VAR_5[0] < VAR_2) { VAR_1[VAR_5[0]]->pic_id = VAR_3 ? VAR_5[0] : VAR_1[VAR_5[0]]->frame_num; split_field_copy(&VAR_0[VAR_6++], VAR_1[VAR_5[0]++], VAR_4, 1); } if (VAR_5[1] < VAR_2) { VAR_1[VAR_5[1]]->pic_id = VAR_3 ? VAR_5[1] : VAR_1[VAR_5[1]]->frame_num; split_field_copy(&VAR_0[VAR_6++], VAR_1[VAR_5[1]++], VAR_4 ^ 3, 0); } } return VAR_6; }