[FFmpeg-cvslog] r9438 - in trunk/libavcodec: roqvideo.c roqvideodec.c

benoit subversion
Tue Jun 26 22:10:26 CEST 2007


Author: benoit
Date: Tue Jun 26 22:10:26 2007
New Revision: 9438

Log:
add width and height in context and use them
patch by Vitor: [vitor1001 gmail com]


Modified:
   trunk/libavcodec/roqvideo.c
   trunk/libavcodec/roqvideodec.c

Modified: trunk/libavcodec/roqvideo.c
==============================================================================
--- trunk/libavcodec/roqvideo.c	(original)
+++ trunk/libavcodec/roqvideo.c	Tue Jun 26 22:10:26 2007
@@ -102,10 +102,10 @@ static inline void apply_motion_generic(
     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;
     }
 

Modified: trunk/libavcodec/roqvideodec.c
==============================================================================
--- trunk/libavcodec/roqvideodec.c	(original)
+++ trunk/libavcodec/roqvideodec.c	Tue Jun 26 22:10:26 2007
@@ -145,11 +145,11 @@ static void roqvideo_decode_frame(RoqCon
         }
 
         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(AVCodecContex
     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;




More information about the ffmpeg-cvslog mailing list