diff mpegvideo.c @ 717:6cba3b6196f0 libavcodec

optimization
author michaelni
date Wed, 02 Oct 2002 17:07:39 +0000
parents dcbcf9676c9f
children 71f669e9f633
line wrap: on
line diff
--- a/mpegvideo.c	Wed Oct 02 16:36:43 2002 +0000
+++ b/mpegvideo.c	Wed Oct 02 17:07:39 2002 +0000
@@ -1684,9 +1684,15 @@
             }
         }
 
-        dest_y = s->current_picture [0] + (mb_y * 16* s->linesize  ) + mb_x * 16;
-        dest_cb = s->current_picture[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
-        dest_cr = s->current_picture[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
+        if(s->pict_type==B_TYPE && s->avctx->draw_horiz_band){
+            dest_y = s->current_picture [0] + mb_x * 16;
+            dest_cb = s->current_picture[1] + mb_x * 8;
+            dest_cr = s->current_picture[2] + mb_x * 8;
+        }else{
+            dest_y = s->current_picture [0] + (mb_y * 16* s->linesize  ) + mb_x * 16;
+            dest_cb = s->current_picture[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
+            dest_cr = s->current_picture[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
+        }
 
         if (s->interlaced_dct) {
             dct_linesize = s->linesize * 2;