[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec motion_est.c,1.115,1.116

Michael Niedermayer CVS michael
Sun Dec 25 00:47:31 CET 2005


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

Modified Files:
	motion_est.c 
Log Message:
hmm did i mess the scaling of these up at some point?
anyway, this change decreases bitrate and increase PSNR by ~1.00 on my test file, other files also benefit significantly


Index: motion_est.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- motion_est.c	23 Dec 2005 19:05:48 -0000	1.115
+++ motion_est.c	24 Dec 2005 23:47:29 -0000	1.116
@@ -1177,7 +1177,7 @@
             pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = vard;
             c->mc_mb_var_sum_temp += vard;
             if (vard <= 64 || vard < varc) { //FIXME
-                c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+                c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
             }else{
                 c->scene_change_score+= s->qscale;
             }
@@ -1268,7 +1268,7 @@
 #endif
     if(mb_type){
         if (vard <= 64 || vard < varc)
-            c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+            c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
         else
             c->scene_change_score+= s->qscale;
 
@@ -1289,7 +1289,7 @@
         }
     }else if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){
         if (vard <= 64 || vard < varc)
-            c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+            c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
         else
             c->scene_change_score+= s->qscale;
 
@@ -1395,7 +1395,7 @@
             s->current_picture.mb_type[mb_y*s->mb_stride + mb_x]= 0;
 
         if (vard <= 64 || vard < varc) { //FIXME
-            c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+            c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
         }else{
             c->scene_change_score+= s->qscale;
         }
@@ -1828,7 +1828,7 @@
             c->mb_var_sum_temp    += varc;*/
             c->mc_mb_var_sum_temp += vard;
 /*            if (vard <= 64 || vard < varc) {
-                c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+                c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
             }else{
                 c->scene_change_score+= s->qscale;
             }*/





More information about the ffmpeg-cvslog mailing list