Browse code

rv20 mv prediction in b frames fix

Originally committed as revision 2712 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2004/01/18 11:59:01
Showing 1 changed files
... ...
@@ -547,6 +547,10 @@ static int rv10_decode_packet(AVCodecContext *avctx,
547 547
             return -1;
548 548
     }
549 549
 
550
+    if(s->pict_type == B_TYPE){ //FIXME remove after cleaning mottion_val indexing
551
+        memset(s->current_picture.motion_val[0], 0, sizeof(int16_t)*2*(s->mb_width*2+2)*(s->mb_height*2+2));
552
+    }
553
+
550 554
 #ifdef DEBUG
551 555
     printf("qscale=%d\n", s->qscale);
552 556
 #endif
... ...
@@ -575,7 +579,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
575 575
     s->rv10_first_dc_coded[0] = 0;
576 576
     s->rv10_first_dc_coded[1] = 0;
577 577
     s->rv10_first_dc_coded[2] = 0;
578
-
578
+//printf("%d %X %X\n", s->pict_type, s->current_picture.motion_val[0], s->current_picture.motion_val[1]);
579 579
     s->block_wrap[0]=
580 580
     s->block_wrap[1]=
581 581
     s->block_wrap[2]=
... ...
@@ -600,7 +604,8 @@ static int rv10_decode_packet(AVCodecContext *avctx,
600 600
             av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
601 601
             return -1;
602 602
         }
603
-        ff_h263_update_motion_val(s);
603
+        if(s->pict_type != B_TYPE)
604
+            ff_h263_update_motion_val(s);
604 605
         MPV_decode_mb(s, s->block);
605 606
         if(s->loop_filter)
606 607
             ff_h263_loop_filter(s);
... ...
@@ -635,7 +640,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
635 635
         *data_size = 0;
636 636
         return 0;
637 637
     }
638
-    
638
+
639 639
     if(avctx->slice_count){
640 640
         for(i=0; i<avctx->slice_count; i++){
641 641
             int offset= avctx->slice_offset[i];