Revision 7c4f71c4 libavcodec/h263.c

View differences:

libavcodec/h263.c
577 577
    } else if(IS_INTERLACED(colocated_mb_type)){
578 578
        s->mv_type = MV_TYPE_FIELD;
579 579
        for(i=0; i<2; i++){
580
            int field_select= s->next_picture.ref_index[0][s->block_index[2*i]];
580 581
            if(s->top_field_first){
581
                time_pp= s->pp_field_time - s->p_field_select_table[i][mb_index] + i;
582
                time_pb= s->pb_field_time - s->p_field_select_table[i][mb_index] + i;
582
                time_pp= s->pp_field_time - field_select + i;
583
                time_pb= s->pb_field_time - field_select + i;
583 584
            }else{
584
                time_pp= s->pp_field_time + s->p_field_select_table[i][mb_index] - i;
585
                time_pb= s->pb_field_time + s->p_field_select_table[i][mb_index] - i;
585
                time_pp= s->pp_field_time + field_select - i;
586
                time_pb= s->pb_field_time + field_select - i;
586 587
            }
587 588
            s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0]*time_pb/time_pp + mx;
588 589
            s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my;
......
631 632
            for(i=0; i<2; i++){
632 633
                s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0];
633 634
                s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1];
634
                s->p_field_select_table[i][mb_xy]= s->field_select[0][i];
635 635
            }
636
            s->current_picture.ref_index[0][xy           ]=
637
            s->current_picture.ref_index[0][xy        + 1]= s->field_select[0][0];
638
            s->current_picture.ref_index[0][xy + wrap    ]=
639
            s->current_picture.ref_index[0][xy + wrap + 1]= s->field_select[0][1];
636 640
        }
637
        
641

  
638 642
        /* no update if 8X8 because it has been done during parsing */
639 643
        s->current_picture.motion_val[0][xy][0] = motion_x;
640 644
        s->current_picture.motion_val[0][xy][1] = motion_y;

Also available in: Unified diff