summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-12-14 20:48:12 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-12-14 20:48:12 +0000
commit31b1ec5d38dddd98086f036209ea71838f8dabcb (patch)
treef1517781221ac5972d7bff00d82df278d15db432 /libavcodec/mpeg12.c
parentfad05f523c03dd0df5d7172cff641c668247034a (diff)
mv vissualization & field picture fix
Originally committed as revision 2610 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 69a41dda1f..2d50ff9b73 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2161,11 +2161,14 @@ static int mpeg_decode_slice(AVCodecContext *avctx,
if (ret < 0)
return -1;
- if(s->current_picture.motion_val[0]){ //note motion_val is normally NULL unless we want to extract the MVs
- const int wrap = s->block_wrap[0];
- const int xy = s->mb_x*2 + 1 + (s->mb_y*2 +1)*wrap;
+ if(s->current_picture.motion_val[0] && !s->encoding){ //note motion_val is normally NULL unless we want to extract the MVs
+ const int wrap = field_pic ? 2*s->block_wrap[0] : s->block_wrap[0];
+ int xy = s->mb_x*2 + 1 + (s->mb_y*2 +1)*wrap;
int motion_for_top_x, motion_for_top_y, motion_back_top_x, motion_back_top_y;
int motion_for_bottom_x, motion_for_bottom_y, motion_back_bottom_x, motion_back_bottom_y;
+ if(field_pic && !s->first_field)
+ xy += wrap/2;
+
if (s->mb_intra) {
motion_for_top_x = motion_for_top_y = motion_back_top_x = motion_back_top_y =
motion_for_bottom_x = motion_for_bottom_y = motion_back_bottom_x = motion_back_bottom_y = 0;