[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec motion_est.c,1.106,1.107

Michael Niedermayer CVS michael
Wed Jul 27 15:16:38 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv14726/libavcodec

Modified Files:
	motion_est.c 
Log Message:
motion vector limit for mpeg2


Index: motion_est.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- motion_est.c	17 Jun 2005 15:02:52 -0000	1.106
+++ motion_est.c	27 Jul 2005 13:16:35 -0000	1.107
@@ -1896,6 +1896,11 @@
         int best_fcode=-1;
         int best_score=-10000000;
 
+        if(s->msmpeg4_version) 
+            range= FFMIN(range, 16);
+        else if(s->codec_id == CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL)
+            range= FFMIN(range, 256);
+
         for(i=0; i<8; i++) score[i]= s->mb_num*(8-i);
 
         for(y=0; y<s->mb_height; y++){
@@ -1950,9 +1955,10 @@
     int y, range;
     assert(s->pict_type==P_TYPE);
 
-    range = (((s->out_format == FMT_MPEG1) ? 8 : 16) << f_code);
-    
-    if(s->msmpeg4_version) range= 16;
+    range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code);
+
+    assert(range <= 16 || !s->msmpeg4_version);
+    assert(range <=256 || !(s->codec_id == CODEC_ID_MPEG2VIDEO && s->avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL));
     
     if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
     
@@ -2000,9 +2006,8 @@
     int y, h_range, v_range;
 
     // RAL: 8 in MPEG-1, 16 in MPEG-4
-    int range = (((s->out_format == FMT_MPEG1) ? 8 : 16) << f_code);
+    int range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code);
 
-    if(s->msmpeg4_version) range= 16;
     if(c->avctx->me_range && range > c->avctx->me_range) range= c->avctx->me_range;
 
     h_range= range;





More information about the ffmpeg-cvslog mailing list