summaryrefslogtreecommitdiff
path: root/libavcodec/h263.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-04-19 03:33:23 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-04-19 03:33:23 +0000
commit7c4f71c428327c57247cb2d2c55fcda6c878e24a (patch)
tree0a7e62531511d6b7b3a5275af4db122082e2b81f /libavcodec/h263.c
parent8857a7ef32439b6cadea6707effd686786919084 (diff)
exporting field_select/ref_index values
Originally committed as revision 3035 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r--libavcodec/h263.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 8b8ea7c1b0..ec776eb980 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -577,12 +577,13 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my){
} else if(IS_INTERLACED(colocated_mb_type)){
s->mv_type = MV_TYPE_FIELD;
for(i=0; i<2; i++){
+ int field_select= s->next_picture.ref_index[0][s->block_index[2*i]];
if(s->top_field_first){
- time_pp= s->pp_field_time - s->p_field_select_table[i][mb_index] + i;
- time_pb= s->pb_field_time - s->p_field_select_table[i][mb_index] + i;
+ time_pp= s->pp_field_time - field_select + i;
+ time_pb= s->pb_field_time - field_select + i;
}else{
- time_pp= s->pp_field_time + s->p_field_select_table[i][mb_index] - i;
- time_pb= s->pb_field_time + s->p_field_select_table[i][mb_index] - i;
+ time_pp= s->pp_field_time + field_select - i;
+ time_pb= s->pb_field_time + field_select - i;
}
s->mv[0][i][0] = s->p_field_mv_table[i][0][mb_index][0]*time_pb/time_pp + mx;
s->mv[0][i][1] = s->p_field_mv_table[i][0][mb_index][1]*time_pb/time_pp + my;
@@ -631,10 +632,13 @@ void ff_h263_update_motion_val(MpegEncContext * s){
for(i=0; i<2; i++){
s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0];
s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1];
- s->p_field_select_table[i][mb_xy]= s->field_select[0][i];
}
+ s->current_picture.ref_index[0][xy ]=
+ s->current_picture.ref_index[0][xy + 1]= s->field_select[0][0];
+ s->current_picture.ref_index[0][xy + wrap ]=
+ s->current_picture.ref_index[0][xy + wrap + 1]= s->field_select[0][1];
}
-
+
/* no update if 8X8 because it has been done during parsing */
s->current_picture.motion_val[0][xy][0] = motion_x;
s->current_picture.motion_val[0][xy][1] = motion_y;