aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rv34.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2009-03-13 13:48:44 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2009-03-13 13:48:44 +0000
commit923ed9748ce6cb91c1a25928efc746b6b77fccb7 (patch)
tree85bb1779fa8c2f70d977d14204d388fc43522a87 /libavcodec/rv34.c
parentabb785f19e30f618b8de6f9f94dc8408e2a27ac5 (diff)
downloadffmpeg-923ed9748ce6cb91c1a25928efc746b6b77fccb7.tar.gz
Fix direct and skip MB motion compensation in RV4:
two conditions were incomplete and zeroing motion vectors was performed only on half of them. Originally committed as revision 17947 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rv34.c')
-rw-r--r--libavcodec/rv34.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index c2277076a5..ee105280b3 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -787,15 +787,16 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type)
case RV34_MB_B_DIRECT:
//surprisingly, it uses motion scheme from next reference frame
next_bt = s->next_picture_ptr->mb_type[s->mb_x + s->mb_y * s->mb_stride];
- if(IS_INTRA(next_bt))
+ if(IS_INTRA(next_bt) || IS_SKIP(next_bt)){
fill_rectangle(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], 2, 2, s->b8_stride, 0, 4);
- else
+ fill_rectangle(s->current_picture_ptr->motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], 2, 2, s->b8_stride, 0, 4);
+ }else
for(j = 0; j < 2; j++)
for(i = 0; i < 2; i++)
for(k = 0; k < 2; k++)
for(l = 0; l < 2; l++)
s->current_picture_ptr->motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_picture_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][k]);
- if(IS_16X16(next_bt)) //we can use whole macroblock MC
+ if(!(IS_16X8(next_bt) || IS_8X16(next_bt) || IS_8X8(next_bt))) //we can use whole macroblock MC
rv34_mc_2mv(r, block_type);
else
rv34_mc_2mv_skip(r);