diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-11-30 05:37:03 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-11-30 05:37:03 +0300 |
commit | f0ec23943861c42b2633c821ddfac45c61899973 (patch) | |
tree | c126d1e00185beff6c6b2e358a2e2036e2cddb51 /libavcodec/mpeg12.c | |
parent | 419bddd36692ebdbba88089b9acb702639f2f0f1 (diff) |
Fix dual prime motion compensation in field pictures.
Fixes issue1125.
Originally committed as revision 20666 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 74b8eea869..2f8928dee5 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -448,18 +448,20 @@ static int mpeg_decode_mb(MpegEncContext *s, for(i=0;i<2;i++) { if (USES_LIST(mb_type, i)) { int dmx, dmy, mx, my, m; + const int my_shift= s->picture_structure == PICT_FRAME; + mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]); s->last_mv[i][0][0] = mx; s->last_mv[i][1][0] = mx; dmx = get_dmv(s); my = mpeg_decode_motion(s, s->mpeg_f_code[i][1], - s->last_mv[i][0][1] >> 1); + s->last_mv[i][0][1] >> my_shift); dmy = get_dmv(s); - s->last_mv[i][0][1] = my<<1; - s->last_mv[i][1][1] = my<<1; + s->last_mv[i][0][1] = my<<my_shift; + s->last_mv[i][1][1] = my<<my_shift; s->mv[i][0][0] = mx; s->mv[i][0][1] = my; |