diff mpegvideo.c @ 2266:514949de5d15 libavcodec

set AVCodecContext.width/height to the picture width/height instead of the one stored in the bitstream (that only matters if lowres!=0)
author michael
date Mon, 27 Sep 2004 02:39:55 +0000
parents c93da911905e
children 5443c3fc2448
line wrap: on
line diff
--- a/mpegvideo.c	Sun Sep 26 23:01:42 2004 +0000
+++ b/mpegvideo.c	Mon Sep 27 02:39:55 2004 +0000
@@ -1720,11 +1720,13 @@
         uint8_t *ptr;
         int i;
         int h_chroma_shift, v_chroma_shift;
+        const int width = s->avctx->width;
+        const int height= s->avctx->height;
         s->low_delay=0; //needed to see the vectors without trashing the buffers
 
         avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &h_chroma_shift, &v_chroma_shift);
         for(i=0; i<3; i++){
-            memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*s->height:pict->linesize[i]*s->height >> v_chroma_shift);
+            memcpy(s->visualization_buffer[i], pict->data[i], (i==0) ? pict->linesize[i]*height:pict->linesize[i]*height >> v_chroma_shift);
             pict->data[i]= s->visualization_buffer[i];
         }
         pict->type= FF_BUFFER_TYPE_COPY;
@@ -1764,7 +1766,7 @@
                         int xy= mb_x*2 + (i&1) + (mb_y*2 + (i>>1))*s->b8_stride;
                         int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
                         int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
-                        draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100);
+                        draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
                       }
                     }else if(IS_16X8(pict->mb_type[mb_index])){
                       int i;
@@ -1778,7 +1780,7 @@
                         if(IS_INTERLACED(pict->mb_type[mb_index]))
                             my*=2;
                         
-                        draw_arrow(ptr, sx, sy, mx+sx, my+sy, s->width, s->height, s->linesize, 100);
+                        draw_arrow(ptr, sx, sy, mx+sx, my+sy, width, height, s->linesize, 100);
                       }
                     }else{
                       int sx= mb_x*16 + 8;
@@ -1786,7 +1788,7 @@
                       int xy= mb_x*2 + mb_y*2*s->b8_stride;
                       int mx= (pict->motion_val[direction][xy][0]>>shift) + sx;
                       int my= (pict->motion_val[direction][xy][1]>>shift) + sy;
-                      draw_arrow(ptr, sx, sy, mx, my, s->width, s->height, s->linesize, 100);
+                      draw_arrow(ptr, sx, sy, mx, my, width, height, s->linesize, 100);
                     }
                   }                  
                 }
@@ -3702,7 +3704,7 @@
             if(s->first_field  && !(s->avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
         }
 
-        h= FFMIN(h, (s->height>>s->avctx->lowres) - y);
+        h= FFMIN(h, s->avctx->height - y);
 
         if(s->pict_type==B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER)) 
             src= (AVFrame*)s->current_picture_ptr;