[xiph-commits] r14654 - branches/theora-thusnelda/lib/enc

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Apr 3 12:00:15 PDT 2008


Author: xiphmont
Date: 2008-04-03 12:00:12 -0700 (Thu, 03 Apr 2008)
New Revision: 14654

Modified:
   branches/theora-thusnelda/lib/enc/mcenc.c
   branches/theora-thusnelda/lib/enc/mode.c
Log:
Milks a little more performance out of the recent halfpel tuning, does
so without damaging bitrate.



Modified: branches/theora-thusnelda/lib/enc/mcenc.c
===================================================================
--- branches/theora-thusnelda/lib/enc/mcenc.c	2008-04-03 15:15:10 UTC (rev 14653)
+++ branches/theora-thusnelda/lib/enc/mcenc.c	2008-04-03 19:00:12 UTC (rev 14654)
@@ -24,10 +24,10 @@
 #define OC_YSAD_THRESH1            (256)
 /*The amount to right shift the minimum error by when inflating it for
    computing the second maximum Y plane SAD threshold.*/
-#define OC_YSAD_THRESH2_SCALE_BITS (3)
+#define OC_YSAD_THRESH2_SCALE_BITS (4)
 /*The amount to add to the second maximum Y plane threshold when inflating
    it.*/
-#define OC_YSAD_THRESH2_OFFSET     (128)
+#define OC_YSAD_THRESH2_OFFSET     (64)
 
 /*The vector offsets in the X direction for each search site in the square
    pattern.*/
@@ -566,7 +566,7 @@
   }
 
   if(!_goldenp) 
-    mb->aerror = *best_err;
+    mb->aerror = *best_err>>1;
   mb->analysis_mv[0][_goldenp].x=best_vec.x<<1;;
   mb->analysis_mv[0][_goldenp].y=best_vec.y<<1;;
 
@@ -591,8 +591,11 @@
   mv.x = mb->analysis_mv[0][_goldenp].x>>1;
   mv.y = mb->analysis_mv[0][_goldenp].y>>1;
   
-  oc_mcenc_ysad_halfpel_mbrefine(cpi,_mbi,&mv,err,_goldenp);
+  err=oc_mcenc_ysad_halfpel_mbrefine(cpi,_mbi,&mv,err,_goldenp);
   mb->analysis_mv[0][_goldenp]=mv;
+  if(!_goldenp)
+    mb->aerror = err;
+
 }
 
 void oc_mcenc_refine4mv(CP_INSTANCE *cpi, 

Modified: branches/theora-thusnelda/lib/enc/mode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/mode.c	2008-04-03 15:15:10 UTC (rev 14653)
+++ branches/theora-thusnelda/lib/enc/mode.c	2008-04-03 19:00:12 UTC (rev 14654)
@@ -633,9 +633,8 @@
 	cost[CODE_INTER_PLUS_MV] -= 384;
 	
 	/* the explicit MV modes (2,6,7) have not yet gone through
-	   halfpel refinement as it's a relatively expensive
-	   operation.  We choose the explicit mv mode that's already
-	   furthest ahead on bits and refine only that one */
+	   halfpel refinement. We choose the explicit mv mode that's
+	   already furthest ahead on bits and refine only that one */
 	if(flag4mv && cost[CODE_INTER_FOURMV]<cost[CODE_INTER_PLUS_MV] && cost[CODE_INTER_FOURMV]<cost[CODE_GOLDEN_MV]){
 	  oc_mcenc_refine4mv(cpi, mbi, block_err);
 	  cost[CODE_INTER_FOURMV] = cost_inter4mv(cpi, qi, mbi, &mb_4mv_bits_0, &mb_4mv_bits_1);



More information about the commits mailing list