Mercurial > libavcodec.hg
comparison h263.c @ 1948:d10578f7fd40 libavcodec
exporting field_select/ref_index values
author | michael |
---|---|
date | Mon, 19 Apr 2004 03:33:23 +0000 |
parents | a3f44c9168aa |
children | 6876ae55b5e7 |
comparison
equal
deleted
inserted
replaced
1947:b306574523ad | 1948:d10578f7fd40 |
---|---|
575 } | 575 } |
576 return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1; | 576 return MB_TYPE_DIRECT2 | MB_TYPE_8x8 | MB_TYPE_L0L1; |
577 } else if(IS_INTERLACED(colocated_mb_type)){ | 577 } else if(IS_INTERLACED(colocated_mb_type)){ |
578 s->mv_type = MV_TYPE_FIELD; | 578 s->mv_type = MV_TYPE_FIELD; |
579 for(i=0; i<2; i++){ | 579 for(i=0; i<2; i++){ |
580 int field_select= s->next_picture.ref_index[0][s->block_index[2*i]]; | |
580 if(s->top_field_first){ | 581 if(s->top_field_first){ |
581 time_pp= s->pp_field_time - s->p_field_select_table[i][mb_index] + i; | 582 time_pp= s->pp_field_time - field_select + i; |
582 time_pb= s->pb_field_time - s->p_field_select_table[i][mb_index] + i; | 583 time_pb= s->pb_field_time - field_select + i; |
583 }else{ | 584 }else{ |
584 time_pp= s->pp_field_time + s->p_field_select_table[i][mb_index] - i; | 585 time_pp= s->pp_field_time + field_select - i; |
585 time_pb= s->pb_field_time + s->p_field_select_table[i][mb_index] - i; | 586 time_pb= s->pb_field_time + field_select - i; |
586 } | 587 } |
587 s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0]*time_pb/time_pp + mx; | 588 s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0]*time_pb/time_pp + mx; |
588 s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my; | 589 s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my; |
589 s->mv[1][i][0] = mx ? s->mv[0][i][0] - s->p_field_mv_table[i][0][mb_index][0] | 590 s->mv[1][i][0] = mx ? s->mv[0][i][0] - s->p_field_mv_table[i][0][mb_index][0] |
590 : s->p_field_mv_table[i][0][mb_index][0]*(time_pb - time_pp)/time_pp; | 591 : s->p_field_mv_table[i][0][mb_index][0]*(time_pb - time_pp)/time_pp; |
629 motion_y = s->mv[0][0][1] + s->mv[0][1][1]; | 630 motion_y = s->mv[0][0][1] + s->mv[0][1][1]; |
630 motion_x = (motion_x>>1) | (motion_x&1); | 631 motion_x = (motion_x>>1) | (motion_x&1); |
631 for(i=0; i<2; i++){ | 632 for(i=0; i<2; i++){ |
632 s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0]; | 633 s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0]; |
633 s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1]; | 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 ]= |
636 } | 637 s->current_picture.ref_index[0][xy + 1]= s->field_select[0][0]; |
637 | 638 s->current_picture.ref_index[0][xy + wrap ]= |
639 s->current_picture.ref_index[0][xy + wrap + 1]= s->field_select[0][1]; | |
640 } | |
641 | |
638 /* no update if 8X8 because it has been done during parsing */ | 642 /* no update if 8X8 because it has been done during parsing */ |
639 s->current_picture.motion_val[0][xy][0] = motion_x; | 643 s->current_picture.motion_val[0][xy][0] = motion_x; |
640 s->current_picture.motion_val[0][xy][1] = motion_y; | 644 s->current_picture.motion_val[0][xy][1] = motion_y; |
641 s->current_picture.motion_val[0][xy + 1][0] = motion_x; | 645 s->current_picture.motion_val[0][xy + 1][0] = motion_x; |
642 s->current_picture.motion_val[0][xy + 1][1] = motion_y; | 646 s->current_picture.motion_val[0][xy + 1][1] = motion_y; |