]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
add width and height in context and use them
authorbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 26 Jun 2007 20:10:26 +0000 (20:10 +0000)
committerbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 26 Jun 2007 20:10:26 +0000 (20:10 +0000)
patch by Vitor: [vitor1001 gmail com]

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9438 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/roqvideo.c
libavcodec/roqvideodec.c

index e478d4c10bec66351464a682cccee524e638dd39..d53d090f0835834a9ae5f8bdfccff70d6fd870df 100644 (file)
@@ -102,10 +102,10 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax
     my = y + deltay;
 
     /* check MV against frame boundaries */
-    if ((mx < 0) || (mx > ri->avctx->width - sz) ||
-        (my < 0) || (my > ri->avctx->height - sz)) {
+    if ((mx < 0) || (mx > ri->width - sz) ||
+        (my < 0) || (my > ri->height - sz)) {
         av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n",
-            mx, my, ri->avctx->width, ri->avctx->height);
+            mx, my, ri->width, ri->height);
         return;
     }
 
index 2836912f7890ef902b278ee2ea6bc52361b5239b..8a3328ecc69c7da1945929cc029ea621e2fa4bfd 100644 (file)
@@ -145,11 +145,11 @@ static void roqvideo_decode_frame(RoqContext *ri)
         }
 
         xpos += 16;
-        if (xpos >= ri->avctx->width) {
-            xpos -= ri->avctx->width;
+        if (xpos >= ri->width) {
+            xpos -= ri->width;
             ypos += 16;
         }
-        if(ypos >= ri->avctx->height)
+        if(ypos >= ri->height)
             break;
     }
 }
@@ -160,6 +160,8 @@ static int roq_decode_init(AVCodecContext *avctx)
     RoqContext *s = avctx->priv_data;
 
     s->avctx = avctx;
+    s->width = avctx->width;
+    s->height = avctx->height;
     s->last_frame    = &s->frames[0];
     s->current_frame = &s->frames[1];
     avctx->pix_fmt = PIX_FMT_YUV444P;