diff motion_est.c @ 218:9df2d13e64b2 libavcodec

(commit by michael) motion-estimation on width/height not divisable through 16 files bugfix
author arpi_esp
date Thu, 24 Jan 2002 19:06:47 +0000
parents ec4642daa6fe
children b640ec5948b0
line wrap: on
line diff
--- a/motion_est.c	Thu Jan 24 15:25:11 2002 +0000
+++ b/motion_est.c	Thu Jan 24 19:06:47 2002 +0000
@@ -409,13 +409,20 @@
     if (s->unrestricted_mv) {
         xmin = -16;
         ymin = -16;
-        xmax = s->width;
-        ymax = s->height;
+        if(s->avctx==NULL || s->avctx->codec->id!=CODEC_ID_MPEG4){
+            xmax = s->mb_width*16;
+            ymax = s->mb_height*16;
+        }else {
+            /* XXX: dunno if this is correct but ffmpeg4 decoder wont like it otherwise 
+	            (cuz the drawn edge isnt large enough))*/
+            xmax = s->width;
+            ymax = s->height;
+	}
     } else {
         xmin = 0;
         ymin = 0;
-        xmax = s->width - 16;
-        ymax = s->height - 16;
+        xmax = s->mb_width*16 - 16;
+        ymax = s->mb_height*16 - 16;
     }
 
     switch(s->full_search) {